LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 serial ports in the same program

If I init 2 serial ports (com 1 and 2) the system only communicates with one or the other not both
0 Kudos
Message 1 of 4
(2,622 Views)
I don't understand what you've got here. Your example program only has a single serial port init so only one port at a time can be initialized and only a single port at a time can be written to and read from. Or are you attempting to call this VI as a subVI twice in a main program?
Message 2 of 4
(2,622 Views)
Yes I am calling this program multiple times throughout the program and sometimes I write to com 1 and sometimes to com 0. I have recently made this work by closeing and reinitializing the port after each communication
0 Kudos
Message 3 of 4
(2,622 Views)
And if you want simultaneous communication, I suggest you use VISA instead of the old serial drivers and set the VISA Read/Write for asynchronous. The old serial drivers are no longer supported by NI and are gone in LabVIEW 7.
0 Kudos
Message 4 of 4
(2,622 Views)