Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

fix error 1073807339

When I run my VI to acquire serial data it crashes and give the following error if there is no data available for short time:
Error -1073807339 occurred at VISA Read in tchain_read.vi
Possible reason(s):

VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.

How do I fix this or adjust the length of the timeout so this will not occur.

Thanks
Message 1 of 6
(4,168 Views)
You can set the timeout by running the VISA Configure serial settings VI from the Instrument Control>>Serial palette. However, the default timeout is 10 seconds, so I would like to understand how your application works. The applications shouldn't crash. At most it should give you an error message.
What I suspect is that either the app doesn't crash (but just throws the error) or that it's set to stop when it has an error. Try using the find function (Edit>>Find) to find if the configure VI is already located anywhere in your code. Also, try opening the Example Finder (Help>>Find Examples) and searching for "Serial".
As for a solution - A timeout occures when the time passed and you don't get the number of bytes you asked for. How many bytes are you asking for? You can use the Bytes at Serial Port property node to determine how many bytes are waiting and wire that into the Read VI.
I hope this helped.

___________________
Try to take over the world!
Message 2 of 6
(4,163 Views)
actually the VI does not crash I just get the error message when there is no incoming data, that was a bit of misinformation. The VI reads data from a temerature string that outputs a data string of 111 bytes once a minute. I will attempt to increase the timeout.
Thanks
Message 3 of 6
(4,155 Views)
Here is the VI. I tried to set a timeout value but keep getting an error. could you set the timeout value to 60 seconds and send it back.
then I will know what I am doing wrong. Thanks
Message 4 of 6
(4,152 Views)

You already have the configure VI in your code, right before the read VI. The timeout input is on the top. Just hover above that input, right click and select Create>>Constant. Then, change the 10000 (10 seconds) to 60 or 70000.
Also, I suggest you move the configure VI out of the loop. It should only run when the code starts. In general, VIs which pass errors, which don't have their error output wired to something, pop up an error message. If you wire the error output of the read VI, the error message won't pop up.
Also, your VI is a bit messy, with wires not being straight. You should organize it more, for your sake. To learn more, I suggest you read the LabVIEW user manual. Also, try searching this site and google for LabVIEW tutorials. Here is one you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide.


___________________
Try to take over the world!
Message 5 of 6
(4,151 Views)
Not having reviewed the vi in question, I'd like to add a comment. I'd call a timeout of more than, say a few seconds, for bad coding style. It will, IMHO, eventually 'fall backk onto your own feet' when changing & testing your code later.
The least thing to do is to a add a highlighted comment on this enlarged timeout.
Better, however, was a while loop containing the serial read with a short timeout. It should also have some code that ignores the timeout error and some code to finish the loop when the data is received or when a given number of iterations have passed. When you have some displays for the number of bytes received and a USR that concatenates the received data, the operator can always see what happens and does not need to wait for the timeout to stop the serial read.

Just my €0.02!
Greetings from Germany!
--
Uwe
Message 6 of 6
(4,142 Views)