How to Ignore CR LF ASCII Codes in Serial Receive with LabVIEW

By Ralph - Last updated: Monday, March 8, 2010 - Save & Share - One Comment

In one of my recent LabVIEW projects, my application needs receive the message which send by an ECU unit, and to store the message exactly as it send. And the content of the message is hex data, every byte of this message has a specific meaning to this ECU unit, and I need these data to check if the ECU works as desired.

I programmed this application simply with the default VISA read VI. But when I debugged the application to receive the message send by the ECU, sometimes the message was not complete. When I check the send data with the received data, I found out that LabVIEW automatically breaks the message read when it receives 0x0A or 0×25, and these two hex are carriage return and line feed respectively in ASCII.

To receive the message as desired, we need to disable the read function response to the 0x0A and 0×25 in LabVIEW. Here is how to do it: place VISA Configure Serial Port VI in the diagram, there is an input which called “Enable Termination Character”, the default value of that input is TRUE, which causes the uncomplete data I talked above. To ignore CR LF ASCII codes, we just need set the input to FALSE, wiring a false constant to it.

No related posts.

Posted in LabVIEW, Serial & GPIB, VI Hardware, VI Software • Tags: , , , , , Top Of Page

One Response to “How to Ignore CR LF ASCII Codes in Serial Receive with LabVIEW”

Comment from Etfa
Time October 8, 2010 at 9:16 am

For serial port communication, this is not enough:

you also have to set the ASRL End In (Serial Settings:End Mode for Reads) to: None.

otherwise, it will still stop at the termination character even if you set the Enable Termination Character to False.

Write a comment