LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Set Timeout Or Wait Function

Hi guys, I want that my VISA waits for a certain number of seconds doing always the same operation.

The first  idea I had is shown in Immagine, after that I saw the Visa set Timeout but I haven't understood how it works.

What I want is that the instrument I'm controlling stays in the :TRACe1:MODE MAXHold (without resetting the comand, so no cicle) until I want.

Which is the correct solution?

 

Download All
0 Kudos
Message 1 of 7
(4,490 Views)

What is the difference between them?

0 Kudos
Message 2 of 7
(4,487 Views)

crap the image has been overwritten.
I have attached the correct ones.
Bytheway with the second method seems that it doesn't wait for nothing...

Download All
0 Kudos
Message 3 of 7
(4,479 Views)

The second one is the timeout period wait for reply from an instrument before having an error when using VISA read. Since you wish to wait in peak hold for a certain period before next operation, use the first one.

Message 4 of 7
(4,471 Views)

Hi Kate first of all thank you for your reply so the second one should be used between the write&read visa function, is it correct? For example when I want acquire the data from the instrument I should give some time between the instruction sent with the Write Visa and the feedback received from the Read Visa, have I understood well?

Another thing about the first immage using this configuration  are you sure that the last value that I read from the instrument will be the result of all the things seen from 0 to 20seconds?
You will find the reason of this question watching the immage attached. As you can see the doubt I have is that the output of the image2 is the same of the input of the image1.

To be more accurate the instruction :TRACe1:MODE MAXHold has this function: Maintains the minimum for each point of the trace, and updates each trace point if a new minimum is generated in successive sweeps.

So what I want to see is the final result of the successive sweeps, for example the final result of all the sweeps after 20 seconds.

 

I hope that this clarify you what I'm asking for.

 

Download All
0 Kudos
Message 5 of 7
(4,465 Views)

At the risk of being late to the party, the instrument seems to support SCPI commands; therefore, instead of using a hard-coded wait for the command that takes a long time, see if you can tack on a *OPC? to turn your command into a query and put a read after it.  The instrument will then be set to return something (usually a "1") in the read buffer to tell you the operation was completed.  The VI will then wait only as long as it needs to, instead of for a hardcoded wait time.  The thing to remember here is that you must then make sure that the VISA timeout is longer than what you expect the longest time the longest command will take to complete.  (Of course, the DOWNSIDE to doing this is that you will have to wait that amount of time for a timeout condition - something that might beome a deterrent to using this method if, say, you expect errors and the command takes a minute to complete.)

 

IMHO, if you are using hardcoded waits, it usually means you don't completely understand how to communicate with the equipment.  USUALLY...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 6 of 7
(4,440 Views)

Hi bill, thank you for your reply. What you have written is correct the problem is that in this case I need the Wait (ms) Function because is the user that should set the waiting time. The instrument to control is an SA and I need to wait for a certain time (not defined...it could be 10minutes or 1h or more) to see the update in Max Hold function.

Message 7 of 7
(4,421 Views)