Showing results for 
Search instead for 
Did you mean: 

How to call a Vi running on myrio to the main VI running on PC

I have programmed a test that gets the velocity and the torque of the drum motor and they are running fine on the myrio. I tried to make them a SubVi so i can call them from the main VI (running on the computer) and make a report and it's not working . 

So my question is how can run a subvi that's in the myrio work on the Main Vi running on the computer ?


0 Kudos
Message 1 of 4

You need to treat the myRIO like a separate computer, because it is.  So why should you expect a VI you are calling on your PC to be magically ran on the myRIO?


What you need to do is create a program on the myRIO and add to it a communication scheme for sending data to your PC.  Personally, I prefer using the standard TCP with the STM library.  I know others who prefer Network Streams.  Then on the PC side, you just have another VI that just reads that data and stores it somewhere for the rest of your application to use.

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 4

Thanks Crossrulz, 

i am reading on the STM Library now. This maybe a stupid question but i will ask anyway. If implement your suggestion, so on the PC side if just press the start button would it trigger as well those Vi's on the myrio ?

0 Kudos
Message 3 of 4

Hi hertmate,


on the PC side if just press the start button would it trigger as well those Vi's on the myrio ?

Here the same applies: Why should a program on a different computer start because you press a button on your own computer?

The VI on the myRIO should run before you start your PC/host VI!


LabVIEW comes with a lot of example VIs and projects. There are also projects explaining how to use those RIO targets and how to have them communicate with your PC!

(Those examples most often use shared variables, which can get "nasty". The STM library is a good replacement to reach a "more stable" communication between PC and myRIO.)

Best regards,

using LV2020 on Win8.1+cRIO
0 Kudos
Message 4 of 4