LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What are the functions of timeout?

In serial communication what functions are provided by timeout? Does it specify the time of getting data from the devices and if the device doesn't send any thing back within that time it will send out error message or it's the time to specify the limit execution of vi?
0 Kudos
Message 1 of 9
(3,953 Views)
Se:

As described in help files "timeout" sets the timeout value for the write and read operations. In another words, read and right must be completed within this time frame (default 10 sec). If there was no response past the timeout period, it will output an error!

USCTrojan
Message 2 of 9
(3,952 Views)
Thanks USCTrojan,

Now would it be efficient to use timeout when there are a few commands to be sent continously and each command required different "time period" or do not use timeout but instead using wait node in the function pallet to wait for a specific time for each command?
0 Kudos
Message 3 of 9
(3,952 Views)
In my previous experience, I have always used the standard 10 sec time out. The timeout rarely becomes a factor, as the read or write processes almost always completes in less than a second. In another words, timeout is more like an error control to alarm you about a loose connection or a bad serial link, and I have never used it to control the different time periods required by each of your commands (as you set timeout only once, during configure serial port).

What I will do in your case is to put the various commands in sequence (or case) structure inside a while loop. Have in each structure a command and a wait ms function. All these can be done with original setting (timeout 10s) intact.

I hope this helps

USCTrojan
0 Kudos
Message 4 of 9
(3,953 Views)
For example in a sequence structure I have a few commands to move things around, say the first command takes 60000ms, sencond command takes 50000ms and third command take 1000ms (using wait unil milliseconds. Does it mean that I need to add up all the waiting time i.e. the timeout should be assigned to 12000ms? Sorry I'm just so confused
0 Kudos
Message 5 of 9
(3,952 Views)
You do not need to add at all

Timeout and time control are two different issues...
Timeout only comes into play when the serial device is taking too long to respond. When this occurs, it will output an error. Think of timeout as the amont of time that each VISA function determines that there is an error.

Now in your case, the longest time that the VISA has to wait is for the first command. so just set timeout to be 61000ms (slightly above the value) and you should be fine!

Point of clarification:
I am still not quite certain which one of the following is your case:
1. Your machine takes time (say 60000 for the first command) to respond to the input (whether it�s a read request or a write command) or,
2. You wan
t to the vi to wait (say 60000 after the first command), before sending a second command.

If the case is 1st, then what I had told you is what you should try implementing. If your case is the 2nd, you do not have to be concerned at all with timeouts, as "wait until ms time� does not interfere with VISA (or simply put, VISA won�t display error as long as it gets a response from serial device within the timeout period, and whatever happens after is irrelevant, until next VISA command!)

Also, wait ms and wait until next ms multiple are VERY different. Go to help for their descriptions and determine which one do you need!

I hope this helps!
0 Kudos
Message 6 of 9
(3,952 Views)
HI
I have been using a Pulnix TM1040 and a frame grabber PCI-1422 of NI for a while. Before they all ran well but now, when grabbing, it showed a dialog:"IMAQ error: the serial read didnot complete within the specified timeout period". I have downloaded the camera file from NI but the sesults were the same.
Does anyone know about this problem, please help me. I need to fix this as soon as possible for my experiment because now I am running out of time.
If you can, reply one more to my email: nguyenhk@aero.pauir.itb.ac.id
Thank you very much.
0 Kudos
Message 7 of 9
(3,785 Views)
0 Kudos
Message 8 of 9
(3,778 Views)
Hi nguyenhk -

Please see my reply to your post in the appropriate thread - http://forums.ni.com/ni/board/message?board.id=200&message.id=9759#M9759
David Staab, CLA
Staff Systems Engineer
National Instruments
0 Kudos
Message 9 of 9
(3,758 Views)