Page 1 of 1

CSafe_SetUserCFG1_CMD

Posted: February 18th, 2015, 4:22 pm
by Phil_M
Hi all,

Can someone explain the two examples relating to the above wrapper command from the Concept2 Preliminary manual in the SDK.

On pg 50 in Appendix 2, it gives two examples using the command wrapper. One for a short command and one for a long command.

1) Get higher resolution workout times:
Command Frame 0xF1 0x1A 0x01 0xA0 0xBB 0xF2

0xF1 and 0xF2 are the start flag and end flag.
0x1A is the Csafe_SetUserCFG1_CMD itself, and
0xA0 is the CSAFE_PM_GET_WORKTIME Command.

What are 0x01 and 0xBB doing? I have managed to successfully run the above command, but when I try and switch out worktime for something else, it errors. I assume I need to change 0x01 and 0xBB for something else, but as I dont know what they are doing, I cant work out what to change them to.

the long example is essentially the same.

2) Get workout type and drag factor:
Command Frame: 0xF0 0xFD 0x00 0x1A 0x02 0x89 0xC1 0x50 0xF2

Again, 0xF0 and 0xF2 I understand to be the extended frame start flag, and the usual stop flag.
0x1A is the command wrapper
0x89 is workout type and 0xC1 is drag factor.
0xFD is the Erg Address
0x00 is the PC address

So we are left with 0x02 after the command wrapper when in the previous example there was an 0x01,
and then after the two commands there is an 0x50. What are these doing, and how are they chosen? If I wanted a different set of commands, how would I determine what numbers were required before and after?

Does the 0x01 and 0x02 refer to the number of following commands to look out for?
What determines the 0xBB and 0x50 numbers which follow the commands and appear before the stop flag.

Any help greatly appreciated.

Thanks,
Phil

Re: CSafe_SetUserCFG1_CMD

Posted: July 6th, 2015, 6:08 pm
by dxpack
In the first example:

0x01 is the SETUSERCFG1 message content length (the SETUSERCFG1 message content being 0xA0)
0xBB is the checksum on the frame content (0x1A, 0x01, 0xA0). The checksum is byte for byte XOR on the frame content. If you change the frame content you need to calculate the correct checksum.

Similarly for the second example:

0x02 is the SETUSERCFG1 message content length (the SETUSERCFG1 message content being 0x89 0xC1)
0x50 is the checksum on the frame content (0x1A 0x02 0x89 0xC1).

Re: CSafe_SetUserCFG1_CMD

Posted: July 19th, 2015, 3:34 pm
by Phil_M
Excellent,

Thank you for this, it makes perfect sense.

Amazed to get an answer after all this time. Thanks for checking the older posts.