Jump to content

python and LabVIEW combination work


Recommended Posts

I would like to build a model using image data and NI-cRIO-9063 and NI 9264 for voltage control.

for image, I made a script in python using OpenCV libraries that detecting some points . For voltage control, I use cRIO-9063 with NI 9264 voltage controller.

My question is, I am new in LabVIEW and I don't have any idea how can I make a loop for voltage control in python. Is there any library available in python that directly connect cRIO and NI 9264 devices? if not then how can I combine my image data(which is in python) with cRIO device? I need argent help.

Link to comment
  • 2 weeks later...

Lookup the LabVIEW Python Node for calling Python from LabVIEW. That may not meet your needs on a CRIO.  Under the linux-rt the VI runs in a chroot jail and so you have to do some tricks like using SSH to call python. Google and the NI forums should have some information on that. Another option is to pass data via TCP/IP.
 

Also there is a DAQmx driver for Python, if you want to do everything in Python. The latest CRIOs (at least some of them) support DAQmx within LabVIEW. Not sure if that support extends to Python.

Hope that helps.

Link to comment
6 hours ago, Stagg54 said:

Lookup the LabVIEW Python Node for calling Python from LabVIEW. That may not meet your needs on a CRIO.

Correct, the LabVIEW Python Node currently supports desktop only, not cRIOs. Here is an Idea Exchange post calling for support to be extended to cRIOs: https://forums.ni.com/t5/LabVIEW-Real-Time-Idea-Exchange/Python-Node-support-on-LabVIEW-Realtime-systems/idi-p/3904897?profile.language=en

 

6 hours ago, Stagg54 said:

Under the linux-rt the VI runs in a chroot jail and so you have to do some tricks like using SSH to call python.

No, that's wrong. In NI Linux RT, VIs can access the entire system (as long as the lvuser account is given the required permissions).

It's the LINX Toolkit (for BeagleBone and Raspberry Pi) that puts LabVIEW in a chroot jail.

So, although the Python Node isn't available on cRIOs, you can share data between a LabVIEW application and a Python application via inter-process communication (IPC).

Link to comment
8 hours ago, JKSH said:

No, that's wrong. In NI Linux RT, VIs can access the entire system (as long as the lvuser account is given the required permissions).

It's the LINX Toolkit (for BeagleBone and Raspberry Pi) that puts LabVIEW in a chroot jail.

So, although the Python Node isn't available on cRIOs, you can share data between a LabVIEW application and a Python application via inter-process communication (IPC).

Correct about the LabVIEW chroot only being an issue on the Linx Targets.

But several IPCs will actually work even across chroot jail borders such as good ol TCP/IP (usually my IPC of choice as it works on the same machine, across VMs, on different machines on the same subnet and with some proper setup even across the world). Even shared memory could be made to work across chroot border, but it's complicated, sensitive for correct configuration, and shared memory is difficult to interface to in any case.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.