03-28-2017 08:50 PM
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?.
03-29-2017 02:36 PM
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.
03-29-2017 05:16 PM
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.
03-30-2017 08:39 AM
If these are all meters or pieces of equipment that can be triggered, then sampling the actual instruments can occur in parallel.
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.