02-01-2011 02:32 PM
All,
I'm having some issues with the VISA Serial Read/Write VIs. I cannot get the weight when requested by sending a "P", then a carriage return, then a line feed. In my VI below, I'm returning 0 bytes at the port when I run my VI with highlight execution turned off. When I turn it on, I can read the weight just fine.
I can use the Hyperterminal program just fine without any hiccups at all.
I'm using LabView 2010 and Windows 7. I'm a litle stumped.
Solved! Go to Solution.
02-01-2011 03:15 PM
Do you receive any return count from Visa Write fun? Likely when running in highlight execution Visa write has enough time as the VI is running slow. Just as a test place a delay between write and read and run in normal mode, see what happens. Also you can try to place a loop and read until end of command is read and build on the value read in each iteration.
02-01-2011 03:21 PM
"Basic Serial Write and Read.vi" that ships with LabVIEW shows the way to implement delay between write and read commands....just as an FYI.
02-01-2011 03:24 PM
Yes, I return 3 from the VISA Write VI. I thought that execution was so fast that I wasn't writing. That's what I did check.
For the delay, do you mean the Serial Break VI? If so, I've tried that too with no success.
02-01-2011 03:34 PM
No, a delay is not serial port break. It is the Time Delay function. But the use of the delay and the bytes at serial port are not at all required if your device is sending a termination character. Just wire a larger number of bytes than you expect to the VISA Read. It will wait and then automatically terminate when the term character is detected.