From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Best practice to connect with multiple serial devices

Hello Everyone

 

I want to establish communication with 16 serial (COM) devices at the same time and I need to know the best way to make this possible and efficient these are my ideas:

 

-Make a for loop in the VISA serial port configuration and read the buffer data in an array

-Make 16 parallel while loops and obtain the individual data of each instrument

 

Attach code example with 4 serial (COM) instruments

 

If you have any information of the best way to make thie please let me know

 

Kind regards

0 Kudos
Message 1 of 3
(981 Views)

Are you communicating with 16 of the same devices?  What I do is I have a loop for each device I am communicating with.  Assuming the same device, you can get away with developing 1 VI to handle a single device, make it reentrant, and then dynamically call as many clones of that VI as you need (in this case 16).

 

Otherwise, I REALLY question your code.  Most of all, you generally should not be using the Bytes At Port.  But to go any further with that, we need to know A LOT more about the devices you are communicating with and/or their communication protocol.  I highly recommend this presentation: VIWeek 2020/Proper way to communicate over serial


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(958 Views)

Hello crossruiz

 

Wow, thank you for the quick reply!

 

Q: Are you communicating with 16 of the same devices?

A: The device that I wish to connect is a wireless receptor from Mitutoyo called UWAVE-R (attach pdf sheet). This device acquires data of different digital measuring instruments every device has the capacity to save around 100 instruments in 100 channels,

 

Q: Otherwise, I REALLY question your code.  Most of all, you generally should not be using the Bytes At Port.  But to go any further with that, we need to know A LOT more about the devices you are communicating with and/or their communication protocol

A: My project consists in connect 16 of this same device with VISA. the reason that i need to implement 16 of the same device is that the distances of operation in my company are too high and with only 1 device connected it will be not possible to obtain all the measure instruments data (attach example  map of my company) you can see the area of inspection are around 20 MTS

 

What I do is I have a loop for each device I am communicating with.  Assuming the same device, you can get away with developing 1 VI to handle a single device, make it reentrant, and then dynamically call as many clones of that VI as you need (in this case 16).

If you have an example of this it will be very helpful if you share it otherwise don't worry I think I have the main idea of this point 🙂

 

If you need anything else please let me know or if you think that the best solution is making a reentrant clone of the same VI like you post it before let me know too.

 

Regards

Download All
0 Kudos
Message 3 of 3
(943 Views)