LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unflatten From String Error 74 in Nested While Loops of Simple State Machine

Hi I am working with a simple state machine that I use to monitor CO2 gas in the air. I am using VISA serial communication, and the issue I have is that when I am trying to use another read buffer for the second state in my SSM the unflatten from string error 74 occurs preventing me from reading any data. I am using the same structure I used to read the data in the default state. I have searched the message boards, but have been unable to find a solution.

 

I am also having an issue with the sensor responses outputting to my graph that I would like to prevent from happening. When I send a new command to the sensor the output response is graphed instead of ignored. How do I suppress the response?

 

All suggestions for improvement are welcome.Thanks

0 Kudos
Message 1 of 5
(662 Views)

What does the string data look like when unflatten is successful compared to when it has an error? Is the VISA read timing out when you get the error?

 

If there certain data you don't want to go to the graph, you will have to check for it and filter it out.

0 Kudos
Message 2 of 5
(646 Views)

It is a Hex String of two bytes. I have attached what it looks like from the front interface when in the sample gas ppm state.

 

0 Kudos
Message 3 of 5
(589 Views)

Since you are using a Raw/Hex/Binary protocol, you need to disable the Termination Character.  It is on by default from the VISA Configure Serial Port.  When it is enabled, the read will stop when a Carriage Return (0xA) is read.  This can happen quite often with a Raw/Hex/Binary protocol.  So just wire a FALSE constant to the "Enable Termination Character" input on the top of the VISA Configure Serial Port.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(583 Views)

Hi Crossrulz,

 

So I did some reading on the termination character. If my understanding is correct, then the reason my issue occurred was that the termination character bytes and one of the bytes I was trying to read are the same and therefore the read operation is aborted and then no data or incomplete data was sent to the unflatten from string function?

 

Also, my CRC for the status check command in the inner while loop was incorrect as well, but I made the change as suggested and I am still having the same error. I have attached the updated code with the proper CRC added. 

 

 

0 Kudos
Message 5 of 5
(566 Views)