LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial visa read freezes if I turn off termination characters?

I have a while loop, that has a visa write that sends a command x (does not need anythign appended to it to work with my device), then a visa read that reads the response. the response is two lines like: 

 

sdfasd

sadfdfasdfasdfasdf

 

Takes a few seconds for it to write out the response as it does so one character at a time, maybe 1sec total. If in the visa configure block outside the while loop I turn termination chars to true the visa read works fine and reads the first line. If I turn it to false the whole thing freezes and times out. Shouldn't it just read everything based on how many bytes I told it to and skip over the carriage return in the response? Why doesnt it?

0 Kudos
Message 1 of 4
(2,844 Views)

Well the application doesnt freeze, but it does pause on the visa read and it will pause there until it either gets as many bytes as you specify or it times out, whichever comes first. Can you provide some code?



-Matt
0 Kudos
Message 2 of 4
(2,836 Views)

sorry I can't provide the code at the moment, if i tell it to read one byte I get the same timeout error though.

0 Kudos
Message 3 of 4
(2,829 Views)

It will be very helpful to have code.  If there are no bytes at the port then it will timeout. How do you know there are bytes at the port when you perform a read?



-Matt
0 Kudos
Message 4 of 4
(2,814 Views)