COM port appending NUL to string...

For general discussion related FlowStone
Post Reply
fixstuff555
Posts: 151
Joined: Thu Oct 21, 2010 3:24 pm

COM port appending NUL to string...

Post 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.
Attachments
comport.fsm
(9.1 KiB) Downloaded 1537 times
Embedded
Posts: 143
Joined: Sat Oct 30, 2010 1:42 pm

Re: COM port appending NUL to string...

Post 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.
fixstuff555
Posts: 151
Joined: Thu Oct 21, 2010 3:24 pm

Re: COM port appending NUL to string...

Post 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.
DSP
Posts: 150
Joined: Fri May 14, 2010 10:55 pm

Re: COM port appending NUL to string...

Post 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.
fixstuff555
Posts: 151
Joined: Thu Oct 21, 2010 3:24 pm

Re: COM port appending NUL to string...

Post 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.
Post Reply