How to Ignore CR LF ASCII Codes in Serial Receive with LabVIEW
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.
Related posts:
- The Difference Between Chart and Graph in LabVIEW We can use chart and graph to display our acquired...
- A Better Way to Access Variables in Complex Programs in LabVIEW In some LabVIEW programs, we need to access the value...