10-01-2011 06:45 PM
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.
10-03-2011 03:17 PM - edited 10-03-2011 03:18 PM
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
10-03-2011 03:26 PM
10-03-2011 04:39 PM
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).
10-03-2011 04:41 PM
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.
10-04-2011 03:27 PM
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