LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error - 1073807339 during a Visa write

I'm performing a VISA Write operation, and have received error -1073807339 that says, "Timeout expired before operation completed.  At the start of my program I have a sub vi that initializes a Comm port session and then I don't close it until I stop the program.  While the program runs I have a sub vi that writes to this port using the same session from the initialization but it doesn't work.  I've tried using the Visa timeout VI before the write but that only sets a delay for the error to occur.  If I close the session after the initialization then it works but I don't want to do a Visa Close until I stop Labview.  Any ideas as to why it doesn't work with one open session at the beginning of my program.
0 Kudos
Message 1 of 11
(9,313 Views)
Hi

This error usually occurs when you are writing large amounts of data. You will receive this error if it takes longer than the default timeout to send your data. The easiest solution to this problem is to increase the default value for you VISA Session. You can do this using the VISA Set Timeout VI located on the VISA Advanced Pallet in LabVIEW.
the above solution is from the ni website and
if you look at this URL you will be able to solve your problem.
http://digital.ni.com/public.nsf/allkb/874B379E24C0A0D686256FCF007A6EA0

Nitin
0 Kudos
Message 2 of 11
(9,299 Views)
While a VISA Write timeout could occur when you have a large amount of data being written, I don't think that's the case here because you say it works if you close the session. Frankly, that is something I don't quite understand. What version of LabVIEW and VISA are you using? If you close the session after the initialization, do you have to reconfigure the serial port? Could you attach your program or an example that demonstrates this behavior?
0 Kudos
Message 3 of 11
(9,289 Views)

I'm using LV 8.0 and what ever version of Visa came with it.  I don't have to reconfigure the serial port after a close.

Attached is a zip file with an example called "Visa example.vi" along with all the files needed to run it.  Please note the file path used in the program.

Thanks,

Jeff

0 Kudos
Message 4 of 11
(9,274 Views)
I believe your problem is originating in your "Get Serial Configuration" VI.  You are using property nodes to set the values of the front panel controls, then feeding those controls into the "VISA Configure Serial Port" VI.  The problem is that the values are read from the controls before they are set by the property nodes, so the port settings are configured to whatever the defaults are for the front panel controls.

Try converting all of the text from your configuration file to the appropriate numbers and wire them directly to the "VISA Configure Serial Port" VI, eliminating all property nodes from this VI.  This should allow the proper serial configuration.

I expect that your system is working after you close the serial port, because VISA is using default values when the port is reopened, which just happen to work with your system.

Take a look at the attached file to see an example of modifications which may allow your application to work properly.

Jason S.
Applications Engineer
National Instruments
Message 5 of 11
(9,256 Views)

Thanks Jason,

The solution you provided seems to work.  However now I'm getting Error -1073807252 during a read, VISA:  (Hex 0xBFFF006C) An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived.  Any idea's on a solution for this error???

Jeff
0 Kudos
Message 6 of 11
(9,242 Views)
This would inidicate to me that you are not reading and processing the data from the COM port as quickly as data is being transferred from your instrument.  You may consider adding a VISA Property node to monitor the "Bytes at Port" property as your program is running.  This property tells you how much data is waiting in the read buffer.  As you run your program, if this does not remain near 0, and continues to grow larger, you may not be processing your data fast enough to keep up with your instrument.

Jason S.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 11
(9,231 Views)

If somebody tries to find a (possible) solution for the error

mentioned before - here's one way to solve the problem:

 

When using "Advanced Serial Write and Read.vi" for reading

data from a FIFO memory, try to set the value for the timer

"Wait Until Next ms Multiple" of the main while loop (where

the actual reading and writing is done) to "0"!

 

This way, the reading will be fast enough to avoid a buffer

overflow.

Even when I had set this value to "1" with the "number of bytes

at serial port" property still being zero, the buffer overflow

occured at a certain data point of the FIFO or after a certain

amount of seconds...

 

Sincerely,

Christian

0 Kudos
Message 8 of 11
(8,103 Views)

Hello all,

 

I have the same problem with VISA.

 

jefska, have you resolved the problem of communication?

 

 crickert, I haven't understood how you resolve the problem. Can you send pleace a screenshot of your recommendation or if you can it sent me to my email? (astrorich_19@gmail.com)

 

Regards!

0 Kudos
Message 9 of 11
(7,047 Views)

Hi Deutschrich, try to set the delay (when writing / reading from a VISA port from within a loop) to 0, see attachment. This had something to do with the "status"-unbundling from the error line of VISA - remove it and your VI will work fine even without having to set the delay to 0. Cheers

0 Kudos
Message 10 of 11
(7,028 Views)