LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

error -1073807298

Hi,
I have a serial communication between a NI system (transmitting data in a loop) and a PC (receiving), using VISA objects (read and write).
It  is working ok with one PC, but when I changed to another PC this situation occurred:
At the first data received an error is notified:
Error -1073807298 occurred at VISA read in XXX.vi.
Possible reason: VISA: Could not perform operation because of I/O error.
 
I modified the vi program to not interrupt the program when an occurs and to save all the status transmission erros in an array. So I verified that this happens only at the first data received, the following ones are ok, no errors are notified.
As I said, at first PC this transmission is still working without errors.
Does anyone could help me?
Thanks,
Celia
0 Kudos
Message 1 of 8
(5,425 Views)
If you use a third party USB-Serial adapter, than you can sometimes get the I/O errors. In my case, a have had an third party USB controller, which did not supported IO_CTL, but VISA can't work without it. So I use this library insteed of VISA http://www.mhst.de/downloads.html
0 Kudos
Message 2 of 8
(5,423 Views)
Would it help if you put a VISA open function before your while loop?
0 Kudos
Message 3 of 8
(5,418 Views)


@Ravens Fan wrote:
Would it help if you put a VISA open function before your while loop?


Every VISA VI, which use the violett wire will open the ressource automatically.
0 Kudos
Message 4 of 8
(5,409 Views)


Eugen Graf wrote:

Every VISA VI, which use the violett wire will open the ressource automatically.


I thought they were all self opening.  But I figured it was one thing to try.
0 Kudos
Message 5 of 8
(5,405 Views)

Hi,

I put a VISA open function before the while loop as you suggested but isn´t work as well, occurs an error at the first transmission data.

I´m stacked at this point because I can´t make a stand alone program to run in a target PC. It´s been very difficult to me to make Labview programs work, every time there is a little problem like this to solve that the courses didn´t teach.

Thank you two for your help.

Celia

0 Kudos
Message 6 of 8
(5,384 Views)
Is your device continuously sending its data?  How often does it send the data?  I see you have VISA read, but no VISA write or handshaking employed to tell the device when to send the data.  So it seems to be that you are reading from a device that continuously sends its data.  By your settings, it looks like you are always reading a 12 byte packet that ends with an asterisk  *.
 
I think what may be happening is that on the first read, you have the chance of the serial port opening up in the middle of the byte stream coming from the device and that you are missing some bytes.  Let's say you miss 4 bytes and get the final 8 when the termination character comes in, and that trips the error.  On the second and later reads, the port remains open so it is able to collect the whole packet of data in the buffer.
 
Unless you have a way to control when the device sends its data, you may have to live with this problem and just tell it to ignore that specific error.
0 Kudos
Message 7 of 8
(5,371 Views)
The program that receives data (in attachment above) runs before the program that transmits the data in the NI system is started. So the receiving program waits the first data to be sending (no chance the first data be lost). Besides, this happens just in one of the two PCs.
There is no handshaking because the time to receive and save de data is less than the time between transmissions. A seven bytes packet that ends with an asteristik (to inform the end of the packet) are sending,  Tweve bytes are used in case of timeout.
I've tried to use a VISA flush, just in case, before the loop. But it didn't work.
 
0 Kudos
Message 8 of 8
(5,363 Views)