Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Wait on Event

With LabView 7.0, and windows XP, I'm trying to use the Visa Wait on Event .vi to delay the execution of a command for 3 minutes. The program doesn't do this. It reads the "wait on event" .vi and continues to the next step, which terminates my control. What am I doing wrong in this program?
0 Kudos
Message 1 of 13
(5,063 Views)
Does this function return any sort of error or warning?

Note that (according to the VISA reference manual) this function only works with NI's ENET-Serial devices. Is that what you are using?

If so, have you actually confirmed that you haven't received a byte at the serial port? Have you tested this with the Bytes At Port property node?

Let us know...

Brian
Message 2 of 13
(5,063 Views)
I don't get any errors and I am not using an ENET serial device. Thanks for the answer.
0 Kudos
Message 3 of 13
(5,063 Views)
Is there any way to get the desired results without using an ENET -serial device? Please advise. Thanks.
0 Kudos
Message 4 of 13
(5,065 Views)
If you are just wanting to delay your program by three minutes, then use the "Wait (ms)" and wait for 180000 milliseconds.

If you are wanting to wait up to three minutes for data to come in on the serial port, but you want to read it as soon as possible, you could just set your VISA timeout to 3 minutes, and just do a VISA Read.

It's not clear what you want the program to do. Do you know the motion controller is going to take 3 minutes to get into position, or are you waiting for the motion controller to send you a response letting you know that it's in position?

Brian
0 Kudos
Message 5 of 13
(5,065 Views)
I want the program to send 4 commands to the port immediately and then wait for 3 minutes until it sends the next command. This will give me a 3 minute interval in which to complete my cycle before I send the last command which is a "return" command. The controller is going to take three minutes to get into positon before I want it to return. Will the "wait (ms)" function work here?
0 Kudos
Message 6 of 13
(5,065 Views)
Yes.
0 Kudos
Message 7 of 13
(5,065 Views)
I placed the wait (ms) command on the block diagram and hilighted the execution of the script. I still get the same results...no wait before the last (return) command. Do I have to wire this to the Visa loop somehow in order for the "wait" to take effect? I am attaching the new file for your review. Please advise. Thanks.
0 Kudos
Message 8 of 13
(5,065 Views)
Your Wait isn't wired to the rest of your program, so the wait is happening in parallel to the rest of your application. The Wait is just placed on top of the VISA and Error wires, without being wired to them.

You need to put a sequence structure around the Wait, and wire the VISA session through the sequence structure. This will ensure that the Wait happens before the "Return" VISA Write.

I hope this helps.

Brian
0 Kudos
Message 9 of 13
(5,065 Views)
Thanks! It works as I you said, but now my Data Acquisition, which runs in parallel, "waits" as well. I would like this to continue from start until finish, including the "wait" period, as I still have motion during this time. Any suggestions? Thanks again!
0 Kudos
Message 10 of 13
(5,065 Views)