I am working with a PXI-1000B unit with a 8241 card in it which contains 4 RS485 ports, identified by COM3, COM4, COM5, and COM6 respectively. I set up the necessary connections to do an RS485 loopback test in two wire mode as described in this article:
http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/d5cc369b3e3e6f0586256d1600563245?OpenDocument
I set up the loopback test using ports COM3 and COM4. I was then able to open 2 hyperterminal sessions, one for COM3 and one for COM4, and send messages back and forth. Whatever I typed into one window would be displayed in the other. I then took the Labview example program "Serial Communication.vi" (it's in the demos, go to help->find exam
ples->Hardware Input and Output->Serial) and modified it slightly. I made a separate Resource name input for the Serial Read VI instead of using the one output from the VISA read VI. I then ran the program and set the first resource to COM3 (the port which writes the string), and the second one to COM4 (the one which reads the string back). The program ran correctly and read the input string back without any error. But then when I try to run the program again, it doesn't read anything back and the error out box displays the following:
VISA Read in Serial Read with Timeout.vi->RS422.vi
The error code is 0x3FFF0006
I found out that if I switched which COM port was reading and which was writing, the program would run correctly again. But then every time I run the program, I have to switch which COM port is reading and which is writing. How can I prevent this and make it so that COM3 is always writing the string, and COM4 is always reading it?