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.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

MyRio to MyRio Communication

Solved!
Go to solution

Hello, 

 

I am new to using both LabVIEW and the MyRio products. I am attempting to communicate between two MyRio - 1900 devices to enable cooperative control of two motors in different locations. Each MyRio would be responsible for reading from its own motor encoder, sending that information to the other MyRio, and controlling its own motor to match the position of the other (based on an average position, not master/slave motor control).

 

I have read as much as I can find about the benefits of SPI, UART, and Shared Variables on the LabVIEW platform, but they all seem to have similarly weighted pros and cons. I can establish a WiFi network, or hard wire the MyRios together.

 

Additionally, I would ultimately like to link the whole system to a tablet running Data Dashboard.  Can anyone give me advice on what would be the best course of action to establish communication between the MyRios? Do you know of any example code that I can get started with?

 

Thank you kindly, 

David 

0 Kudos
Message 1 of 6
(3,576 Views)

If you are using Data Dashboard, you have to use Network Published Shared Variables.  So just use those to communicate between your myRIOs.


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 6
(3,555 Views)
Solution
Accepted by topic author TeleBears

 Hey David,

 

I think what will decide this is what you need from this system.

How far apart are they?

What kind of reliability do you need, and what is the cost if communication fails?

 

Wireless is generally going to be less reliable than wired, but if the devices are far apart you might have to go wireless.

Wireless would generally be easier to implement (in my opinion) as you don't need to worry about physical connections. Also, Shared Variables are pretty easy to program with.

 

If you go with wired, I think UART / serial would be easier than SPI. If I remember right, myRIO can only act as a SPI master (so it would be hard to communicate between to myRIOs with SPI).

Andrew T.
"His job is to shed light, and not to master" - Robert Hunter
Message 3 of 6
(3,513 Views)

Hi David,

 

As crossrulz pointed out, you will have to use Network Published Shared Variables anyway in order to work with Data Dashboard. Thus, it would probably be simplest to just use those. Here's a few resources about using NPSV's that may be helpful:

 

Regards,

Regards,

Michael Whitten
Senior RF Applications Engineer
0 Kudos
Message 4 of 6
(3,508 Views)

Thank you to everyone for the advice.

 

At this point I have made a functional prototype using UART. I am also considering the option of using Shared Variables, but from initial tests the latency seems to be too much to work as a method for delivering control states. 

0 Kudos
Message 5 of 6
(3,502 Views)

Thank you for the thoughtful insight. This is for a senior project, so many of the parameters are up to me to decide. The project is a set of mini arcade machines that allow users to thumb wrestle by wire. I would ideally like to extend it to function over the internet but I am working on a pretty tight timeline. I am currently using UART and am successfully transferring the states between the controllers. Once I have everything working I am probably going to go back and see if the latency of Shared Variables allows them to be used. 

 

Thanks again!

 

Regards, 

David

0 Kudos
Message 6 of 6
(3,484 Views)