LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ohaus Adventurer Pro - VISA Serial help

Solved!
Go to solution

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.

Download All
0 Kudos
Message 1 of 5
(3,577 Views)

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.

*************************************************
CLD
*************************************************
0 Kudos
Message 2 of 5
(3,567 Views)
Solution
Accepted by topic author BadAzzS10

"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.

*************************************************
CLD
*************************************************
0 Kudos
Message 3 of 5
(3,561 Views)

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.

0 Kudos
Message 4 of 5
(3,558 Views)

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.

Message 5 of 5
(3,551 Views)