PDA

View Full Version : Serial Modifiers



eshatara
- 23rd April 2009, 14:35
I cannot seem to find a complete description of the modifiers that can be used for serial communication. For Example the manual shows the following as being allowed:

{I}{S}BIN{1..16}
{I}{S}DEC{1..5}
{I}{S}HEX{1-4}

Questions:

What are {I} and {S} and how are these used. Examples?

Thanks...

Chris

Luckyborg
- 23rd April 2009, 16:17
Under Serout2 they give explanations of the {I} and {S}. My manual has it on page 143. {I} will send an indication character "%" for binary, "#" for decimal and "$" for hex values. {I} will send negative numbers if bit 7 is a one. Google "2s complement" if you don't know how negative values are computed.

Consider:
B0 = 16
Serout [SBIN B0] would send %00010000
Serout [SDEC B0] would send #16
Serout [SHEX B0] would send $10

B0 = 255
Serout[IDEC B0] would send -1

eshatara
- 23rd April 2009, 17:44
That was quite helpful.

I had looked at the Serout2 writeup but did not read beyond the 1) - 7) explanations.


..Thanks...Chris