LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

state machine visa timeout

I am having an issue where the Serial VISA will time out in a state machine even though I close the serial port using the VISA close.  When the VI is used in a plain while loop, it works fine, but as soon as I put it in a state machine, it does not work.  It appears that the error I am getting si that it does not read any bytes.  It is returning error 5004 and 5003 which I have defined as bytes read = 0.

I am reading 2 serial instruments

I made sure that I could read from both instruments, using a previous program thatI had written that used a plain while loop (and an abomination of prperty nodes and references) and it did not have any trouble reading teh data.

I attached the NI- SPY output that I got when I ran the VI.

I can attach my VI if needed, but it is rather large and with many subvi-s.

Kenny
Kenny

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

Kenny,

I would open both serial ports at the beginning of the program and leave them open.  Use the reference from each port to read form either port.  Maintain and used both references the entire time the program is running. Close both serial  ports when the program is complete.

Hope this helps,

 

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 2 of 4
(2,886 Views)

Thanks for the suggestion.  Between that and me realizing that I had converted variant to data wrong and was trying to use the same serial port for both instruments I got it working (DOH!!)

 

kenny

Kenny

0 Kudos
Message 3 of 4
(2,879 Views)
No worries, be happy!  Your software is working.
Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 4 of 4
(2,875 Views)