The Serial Receive block in Blockly is interpreting a space character as a NULL character

AutomaxionAutomaxion Posts: 17
edited 2020-10-01 - 10:37:19 in General Discussion
I have a program where I am trying to read values sent continuously by a balance that are in the format (sign)(3 spaces)(0.0000)(space)(g). The balance output is terminated by CR LF. When outputting zero, the sign is replaced by a space. This has been confirmed using a terminal program which also shows that sometimes the g is not appended or read (I can live without the 'g').

When using the code generated in Blockly, only '+' or '-' or '0.0000' is being displayed. Where there is a sign, then this is read but anything else after is not read. Without the sign, the leading spaces do not affect the reading of the data but are not included as text which makes extracting the text needed by position, difficult.

I interpret this as meaning that the spaces following any text are being interpreted as NULL characters and stopping text being read in.

See https://github.com/parallaxinc/solo/issues/515
Sign In or Register to comment.