LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem reading from RS-232 Device by Visa Read when runnig the Reading VI as a sub.vi

Hi fellows
 
Igot a VI, with a VISA serial write Icon and a VISA serial read.
I write a command to the device at com port with the VISA write icon and expecting to get an OK as response from the device. Then I read from the device, By using the VISA read Icon. to ensure the 'OK' response from Device was. So when I run the Vi, all thing work. But when I run the Vi as a sub vi, I can only detect that the VISA write is running, but not the Visa read. I can see this by looking at the Bytes at port before the VISA read. Its ZERO.
three pics are attached
 
Regards
HFZ
 
HFZ
0 Kudos
Message 1 of 3
(2,767 Views)
Hi HFZ,
 
perhaps this is because you are not using the VISA-close.vi in addition to the VISA-open.vi in the sub-vi.
Therefore running the sub.vi in your main-vi's while-loop whitout calling VISA-close can result in a problem.
 
Please try using the VISA-open.vi previous to your while-loop and remove it from your sub.vi.
 
Regards,
 Andi
~~~ Logic is a systematic method of coming to the wrong conclusion with confidence ~~~
0 Kudos
Message 2 of 3
(2,751 Views)
I would also suggest you stick a few probes on the error wires and the VISA resource name to verify that you passed it to the subVI.
0 Kudos
Message 3 of 3
(2,729 Views)