LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial write read time and status codes at the same time.

Hello Everyone,
I am trying to check a status on a test VCR every 10 seconds. I am sending a time code request inside of a for loop set for 10 with a delay of 1000 ms. Then I am sending a status code request and comparing that with a match true false string. I am using visa write read with LabView 7.1 with Win2K. I am attaching the sub vi to see if someone can help me. I have been reading about visa open dual sessions. I might need to try this. I am a newbie and my vi is a little unorganized. I can communicate with the VCR with a write followed by a read but the only difference is I am polling the VCR in this sub vi when before I was only writing or reading one to two times. If remove the time or the status request they work independently of each other but together they do not.  Thanks for your time.
 
bh3560
0 Kudos
Message 1 of 4
(2,619 Views)
Put your Bytes at Port function inside a while loop, and exit that loop only when the Bytes at Port returns a number greater than zero or some number of bytes you expect to receive.  Put a 100 mSec delay inside that loop.  Do this for both Bytes at Port locations.  You may be trying to read too fast.  Also, you might consider putting a timeout inside the Bytes at Port loops in case the port doesn't ever return anything.  To do this, just test the loop iteration counter, like i>10, and wire that through an OR gate to the Stop sign.  So your loop would exit when i>10 or when Bytes at Port > some number.
 
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 4
(2,611 Views)
tbob,
Thanks for your help. I tried your recommendation and it worked with some change in the timing on the second byte at port while loop . I was also able to remove the for loop and it still works fine. It polls the vcr every second and it will still stop at the end of the tape. 
 
Thanks again,
bh3560   
 
 
0 Kudos
Message 3 of 4
(2,588 Views)
I'm always glad to help.
- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 4
(2,582 Views)