Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Running Python and LabVIEW on myRIO

Solved!
Go to solution

Hey everyone!

 

I’ve been doing a control & acquisition project using myRIO and LabVIEW. Now I want to add python in my project to do some data analysis and even machine learning.


However, I found that LabVIEW’s Python Node is not supported on real-time targets.

 

Is it possible to run python script along with LabVIEW on myRIO?

Any suggestions?

 

 

0 Kudos
Message 1 of 8
(4,880 Views)
Solution
Accepted by topic author PurpleWINDD

The myRIO Operating System is called NI Linux Real-Time.  It has a specialized Linux kernel for Real-Time processing.  It is highly unlikely that any currently-existing Python distribution can be loaded and incorporated into this OS.  Without a Python interpreter running on the myRIO, you will not be able to run a Python script there.

 

Bob Schor

0 Kudos
Message 2 of 8
(4,822 Views)

Thank you, Bob!

 

Now I decided to add myRIO as a network drive to my PC and run Python scripts on my PC.

0 Kudos
Message 3 of 8
(4,791 Views)

Sounds like a good plan.  I'm not quite sure what you mean by "add myRIO as a network drive to my PC" -- I assume you mean to "Add Network Drive" on your PC, and let the PC do file I/O on the myRIO.  Given that the PC is (probably) running Windows, and the myRIO is definitely running Linux, I regard this as "dangerous".  I've successfully used Network Streams to pass data back and forth between Host (PC) and RT Target (myRIO, PXI, etc.).  I'm typically using the RT Target for Data Acquisition and Control, and never saving appreciable data there (maybe some configuration files, generated on the RT device for the RT device), and doing all the File I/O (typically saving data for later analysis on the PC) on the PC.  But I'm a "Nervous Nellie", especially when it comes to Linux/PC interactions ...

 

Bob Schor

0 Kudos
Message 4 of 8
(4,775 Views)

Hey, Bob.

 

Sorry for the late reply.

 

Yes I’m working with a Windows PC and myRIO.

 

I attached a USB flash drive to the myRIO via a USB hub. And I save all my acquired data as TDMS files on that flash drive. And I use Network-published shared variable for storing and displaying my data.

 

Everything is working ok now. But I’m wondering if I’m doing this wrong. Because I read on this forum that there are better ways for data communication than NPSV. Now you’re saying you’re using Network Streams. Could you please elaborate on that. Or point me to some resources?

 

Thanks!

 

 

0 Kudos
Message 5 of 8
(4,539 Views)

I found this NI document for “

Streaming Data Using a Network Stream”. It seems to be a good start point.

0 Kudos
Message 6 of 8
(4,532 Views)

 

Here's a link to an old (2013) post of mine -- be sure to read the entire thread, because the "solution", as I recall, has a bug in it ...

 

Bob Schor

0 Kudos
Message 7 of 8
(4,524 Views)

Thanks, Bob!

0 Kudos
Message 8 of 8
(4,497 Views)