LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting the USB hub NI-Myrio

Solved!
Go to solution

After connecting the USB hub to NI-Myrio. I want to fix every port in one component in Myrio.
I want to use sampling to be more detailed.
For example: after connecting 5 port usb hub to myrio, I plug usb serial converters to each port on this usb hub. But the problem here is that the composition of each device is different. Can't the ports on the USB hub ( port 1=com 1, port 2=com2,port 3=com3,port 4=com4,port 5=com5) cannot be assigned a value?

The reason I want it this way is that when I connect 5 devices at the same time, they are randomly assigned to the compports. And what information will be sent to which device is confusing.

 

Any opinion you give is worthy of respect.

0 Kudos
Message 1 of 13
(1,847 Views)

What you are doing seems (to me) to be a little bit strange.  The myRIO is a LabVIEW Real-Time target, running NI Real-Time Linux to enable it to do highly deterministic I/O on multiple A/D, D/A, and DIO ports.  It normally is interfaced with a PC running LabVIEW (serving as the Host) and handling such non-deterministic tasks as file I/O and handling serial communication with USB DAQ devices.

 

When plugging USB devices into a PC running LabVIEW, it is fairly simple to use DAQmx to interrogate the devices and to thereby identify what devices are connected, which would allow you to (on the Host side of the Project) assign the various DAQ devices to whatever Task you needed them to do.

 

Why don't you attach some code to give us a better idea of what you are really trying to accomplish?  [Seems to me that this is a suggestion you've heard before ...].

 

Bob Schor

0 Kudos
Message 2 of 13
(1,822 Views)

Hi  
First of all, I did not fully understand what you said. But I would like to explain the situation a little more.
I connected a usb hub to the usb port on the NI-myrio and attached a serial converter to each of the USB hub ports.
When I test with NI-visa, a comport address is assigned for each attached device. For example, 5 com ports appear on the NI-myrio in addition to the internal default 2 ports.
But devices are assigned random port numbers. What I want to do (which might sound a bit crazy) is to set the com port number for each device plugged in.

 

I did not create any code snippet. Because first I want to understand if it is possible to set the com port numbers to be assigned.

usb hub.png

0 Kudos
Message 3 of 13
(1,808 Views)

Your question boils down to "How do I do such-and-such", and my comment was "What (really) do you want to do?", or "Why are you doing such-and-such?".  I think of the myRIO (and other RIO devices) as superb configurable I/O devices, particularly when precise timing and synchronization are desired.  Devices that use serial communication, on the other hand, are frequently less precise with timing and synchronization.  So to paraphrase my remarks another way, "Why plug the USB Hub into the myRIO instead of into the PC?".  I have had a little experience with reading from multiple Serial Ports (using a concentrator that bundled the data and set it over TCP/IP), and the PC lapped it right up.

 

Bob Schor

 

P.S. -- "Because it is there" is not the response I'm looking for in the question "Why the myRIO?".

0 Kudos
Message 4 of 13
(1,796 Views)

@Bob_Schor wrote:

Your question boils down to "How do I do such-and-such", and my comment was "What (really) do you want to do?", or "Why are you doing such-and-such?".  


because the devices I use use serial communication and I have to read the data over serial communication.


So to paraphrase my remarks another way, "Why plug the USB Hub into the myRIO instead of into the PC?".  I have had a little experience with reading from multiple Serial Ports (using a concentrator that bundled the data and set it over TCP/IP), and the PC lapped it right up.

 

 


Do you recommend converting the usb connectors to ethernet?

0 Kudos
Message 5 of 13
(1,790 Views)

I think what I really recommend is that you attach all of your relevant code, including the Project (.lvproj) File.  [Hmm, have you ever heard this recommendation here on the LabVIEW Forums?].  I really do not understand what you are trying to do, and, less important, perhaps, how you are trying to do it. 

 

Bob Schor 

0 Kudos
Message 6 of 13
(1,775 Views)
Solution
Accepted by topic author constructionworker

I solved this problem, I changed the name of the specified comport via NI-Max and used it this way. Every time I use the name of the inserted usb device, not the com port number.
Thank you for the reply.

0 Kudos
Message 7 of 13
(1,721 Views)

Hi,
1) You used any RS485/RS422 to USB converters?
2) You lose any data when acquiring all 5 COMs data?
3) You connected all to USB Hub and then to myRIO?
4) Can you please attach your VI that how you read all five?

Thank you

0 Kudos
Message 8 of 13
(606 Views)

Deleted by author.


0 Kudos
Message 9 of 13
(595 Views)

Michael,
[A colleague borrowed my PC to ask NI for a Quote.  I didn't notice this when I answered this post on the Forum, so I'm answering it again so you'll know it is coming me.  I apologize for my oversight ...]

 

     You posted 4 questions to a topic @ConstructionWorker asks (and answered!) more than two years ago.  It is unlikely he will see your belated reply to his (now old) Post, and hence will not know you are requesting his code (which he never provided when he needed help).

 

     If you have a "new question", you should generate a "New Message", explain clearly what you want to do, and provide as much detail (including your code, preferably "Saved for Previous Version" in LabVIEW 2019 or 2021, which many of the experienced Forum users, myself included, seem to prefer.  Also, please explain why you want to connect a USB Hub to a myRIO -- what is the overall Project?

 

Bob Schor

0 Kudos
Message 10 of 13
(587 Views)