Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using NI USB-232/4

I have the USB-RS232/4 interface.

The communication to each individual port does not happen simultaneously. I can only read and write to one com port at a time. Is there a way I can communicate with all four ports at once?

Could I solve this by using four single port USB-RS232 adaptors?. 

0 Kudos
Message 1 of 4
(3,102 Views)

If you stop and think about this, you will see that all of your USB connections provided externally are through a hub.  Now each serial port becomes a separate hub off of that USB connection.  This means that you will be communicating in a serial style. 

 

While the throughput speed of each USB port is more than sufficient to handle the much slower RS-232 baud rates, you must set up your code to write commands and read commands separately.  Performing many of the query commands requires waiting for the piece of equipment on the other end to read the message, parse the command, perform the required function, format the results and send them back.  If you allow your code to interleave the commands from the responses, it could appear to arrive in more of a parallel fashion.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
Message 2 of 4
(3,060 Views)

Thanks Minions.

Yes, my code is bundled (write, wait, read) ... four separate iterations, yet independent while loops, of Write and Read.

So your advice is highly valuable ... don't wait for a response before sending a command to the next meter. ... this will be a definite solution.

Thanks again ... I will do this next time I am at the lab.

0 Kudos
Message 3 of 4
(3,057 Views)

If these are all meters or pieces of equipment that can be triggered, then sampling the actual instruments can occur in parallel. 

  1. Connect the trigger between all pieces of equipment 
  2. Write the commands to the instruments in a serial fashion with each to await the trigger.
  3. Pulse the trigger
  4. Read back results serially from each piece of equipment

While the setup and readings of the instruments do not occur in a parallel fashion, the sampling by those instruments that trigger will occur in parallel.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
Message 4 of 4
(3,047 Views)