LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

visa error -1073807253 with serial write following read

The attached program uses the VISA serial tools to snoop on an inter-module bus (RS-485), decode packets, and respond to address 0xF in the packet. Serial is 38400 baud, N81, no flow control.  Packets are exchanged in 100 ms-wide slots. If I have only the read functions  (VISA Read vi) it works fine. If I add the VISA Write section, which sends a response packet back after a packet with the proper address is received, I get "visa error -1073807253": VISA serial framing error. If I do the math right each 23 byte packet should take 6 ms to send, so it shouldn't be a collision problem. Any thoughts would be appreciated. 

Download All
0 Kudos
Message 1 of 6
(3,095 Views)

I found a knowledge base article that seems to address the problem that you are having.

 

Here it is:

http://digital.ni.com/public.nsf/allkb/F3E0621CB71AA16786256F970000FC57?OpenDocument

 

Hope that helps,

 

Doug B

 

Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(3,069 Views)

I just took a quick look and I haven't found anything that can garantee that there is a 6ms delay between the VISA Read and Write functions. Try adding a delay using the wait function, maybe it will solve the problem.

 

Ben64

0 Kudos
Message 3 of 6
(3,064 Views)

I had actually found this and put it in earlier, after I posted the vi but before your reply, and it still gives the error. Interestingly, the error is on the Write, not the Read. Does the serial port monitor transmitted data? In this case it could be colliding with the next packet sent by the processor module (which doesn't check to see if the bus is clear before sending).

0 Kudos
Message 4 of 6
(3,060 Views)

The "Synchronous operation" flag is set, but you think that the outgoing Write characters are getting stepped on by the following Read operation (from the next cycle)? the Read operation doesn't return until the termination character ("/r") at the end of the packet.

0 Kudos
Message 5 of 6
(3,059 Views)

It seems like we have had customers experience this problem in the past and one way it has been solved is to assert the RTS line before writing, then after the write, delay by 1ms and the de-assert the line. This has taken care of similar problems in the past so I would suggest trying something similar and seeing if that gets rid of the error.

 

Doug B 

Applications Engineer
National Instruments
0 Kudos
Message 6 of 6
(3,044 Views)