LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using LabVIEW code with Python Nodes to communicate with cRIO FPGA code

Solved!
Go to solution

Hi All,

 

I've been making some labview code to control many devices from a cRIO for some research and part of this requires python nodes to issue commands to one device. Additionally, I've used python nodes for some quick calculations to condense some labview code (this could be done in labview but I'd prefer to keep it the way it is).

 

There is another device that requires pulse generation from the cRIO (pulse widths on the order of microseconds). Because of this, the real-time resources cannot generate tight enough pulses and I need to use FPGA for this. 

 

The problem is that python nodes cannot be used on FPGA targets, so I will likely need to divide my code. Does anyone have some insight into this type of problem. My best guess for a solution is to find a way to send commands to the FPGA from labview on my computer, but I don't know how to do that. 

 

I've attached what is likely the best example part of my code to illustrate this problem. You can see I'm using python nodes to do a simple calculation which returns as two numbers. The integer sent to the sequence structure represents the number of pulses to be generated (I've removed the wiring for those parts because the resources are now FPGA type, but you could imagine those true and false booleans turning the pulse from high to low). Is there a way to instead move that sequence structure to the FPGA and send a command along with the integer to activate the pulse generation? Or am I going about this the wrong way?

 

loomisa6_0-1678897928931.png

 

Also as a note, I'm pretty new to labview. Most of my experience is in python, so I could be missing something obvious.

 

Thanks,

 

Alex

0 Kudos
Message 1 of 3
(805 Views)
Solution
Accepted by topic author loomisa6

Hi loomisa,

 


@loomisa6 wrote:

The problem is that python nodes cannot be used on FPGA targets, so I will likely need to divide my code. Does anyone have some insight into this type of problem. My best guess for a solution is to find a way to send commands to the FPGA from labview on my computer, but I don't know how to do that. 

 

Is there a way to instead move that sequence structure to the FPGA and send a command along with the integer to activate the pulse generation?


Yes, you need to split your VI into several parts!

LabVIEW (and the FPGA module) comes with a lot of example projects. They explain how to transfer data between host computer, cRIO, and FPGA. You should start with learning from them!

Once you know the FPGA basics you can also "move the sequence" to the FPGA - with modifications regarding accessing DIO pins and timing behaviour…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(785 Views)

You can refer to FPGA - Pulse Train Generation Using LabVIEW and reuse the FPGA VI to compile for the .lvbitx. Then instead of using LabVIEW Host VI, you can use FPGA Interface Python API. You can refer to the example to convert the LabVIEW API to python API.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 3 of 3
(757 Views)