Support Forums
Serial Data transmission

I try to transmit ASCII: NUL dec: 0

If I set CV98=1 and transmit 1Serial("{\0%c[98CV]\255}")
I get in HEX: 00 01 FF it is correct.

If I set CV98=0 and transmit 1Serial("{\0%c[98CV]\255}")
I get in HEX: 00 FF it is incorrect.
I need in HEX: 00 00 FF
I must be flexible with a variable CV and can not hardcoding \0 in the real command (measuring value)

What do i wrong?
Thanks

Volker

I try to transmit ASCII: NUL dec: 0 If I set CV98=1 and transmit 1Serial("{\\0%c[98CV]\\255}") I get in HEX: 00 01 FF it is correct. If I set CV98=0 and transmit 1Serial("{\\0%c[98CV]\\255}") I get in HEX: 00 FF it is incorrect. I need in HEX: 00 00 FF I must be flexible with a variable CV and can not hardcoding \\0 in the real command (measuring value) What do i wrong? Thanks Volker

Hi Volker,

Unfortunately, you cannot pass the integer value and convert it using %c since the conversion will take ASCII representation and the representation of ASCII 0 is NULL (empty).

Best regards,
dataTaker Expert

Hi Volker, Unfortunately, you cannot pass the integer value and convert it using %c since the conversion will take ASCII representation and the representation of ASCII 0 is NULL (empty). Best regards, dataTaker Expert
10
1
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft