03-15-2023 11:32 AM
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?
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
Solved! Go to Solution.
03-15-2023 01:15 PM
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…
03-15-2023 08:19 PM
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.