Page 1 of 1
COM port appending NUL to string...
Posted: Sat Apr 30, 2011 4:26 am
by fixstuff555
I have a question about the COM port primitive. Is it supposed to append a NUL character after whatever string is sent? If its supposed to do that, how can I turn it off. I am playing with a simple RPC call to an MBED chip, but I'm getting a NUL appended to the string, and it will eventually fault out the MBED after too many of those.
Re: COM port appending NUL to string...
Posted: Sat Apr 30, 2011 1:48 pm
by Embedded
You have added (or copied) a New Line (NL) component to the Data input of the Comport. This will add a <CR> to each data transmission (used for terminating the string for some boards).
Just delete this NL Component.
Re: COM port appending NUL to string...
Posted: Sat Apr 30, 2011 5:34 pm
by fixstuff555
I need the new line carriage return. What I don't need is the NUL it adds to that. I'd actually prefer a way to append a 0D hex and 0A hex (CR+LF). The input to the COM primitive is a string. I'd prefer raw data, that I would convert a string to if I wanted to.
Re: COM port appending NUL to string...
Posted: Mon May 02, 2011 11:22 pm
by DSP
Not sure about the NUL char being added to the sting, I haven't seen that?
If you want to work with raw data then just use the Hex mode on the comport module.
Re: COM port appending NUL to string...
Posted: Wed May 04, 2011 2:46 am
by fixstuff555
Yeah, thanks for that. For some reason I thought that the hex mode was for received data only. In hex mode, there isn't a null sent, its just plain hex data, which is fine. I also figured out the com port thing a day or two ago - the drop down lists are 0 based, which is why you had to add a 1 to it; makes sense.