LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to select I/O for every instance of a subVI? (FPGA)

Hi
 
I'm creating a library of subVIs in LabVIEW FPGA for a cRIO system. As an example I have one subVI that handles output to one 8 channel DO module and has an array of size 8 as input.
 
Let's say the user of my library wants to use this SubVI for two DO modules located in slots 1 and 2 of a cRIO chassis. Information of what channels to write to then has to be passed to the two SubVIs. As I understand it I cannot wire I/O controls as input to the SubVI.
 
It would be an acceptable solution to let the user open the front panel of the SubVI and set the 8 controllers manually. However when using more than one instance of the SubVI these changes get saved to all instances.
 
Perhaps this could be solved by building a Express VI and let the user set the channels every time a SubVI is placed on the block diagram but I'm not even sure building Express VIs for LabVIEW FPGA is possible?
Any ideas on how to tackle this? How to make generic FPGA SubVIs that can be used as multiple instances and with different I/O connected to it?
 
/Emil
0 Kudos
Message 1 of 5
(2,999 Views)

vestman,

express vi's are possible in LV FPGA... I have not done it, but take a look at the new PID in LV 8.5, they are simply express vi's.  I'm just a little curious about your motivation to create the libarary of sub vi's for for IO.  Do these modules have specific functionality along with the IO? ... just wondering... I have created libararies for specific operations that I perform often, but I always just use the NI IO nodes outside the subvis.... they are simple and low overhead.

SteveA
CLD

-------------------------------------
FPGA/RT/PDA/TP/DSC
-------------------------------------
0 Kudos
Message 2 of 5
(2,980 Views)

Emil,

If your using LabVIEW FPGA 8.5, check out the following help topic as this might help out:

Using SubVIs on the FPGA (FPGA Module)

The section on specifying I/O Items when calling SubVIs will be very interesting to you....

Basset Hound

0 Kudos
Message 3 of 5
(2,975 Views)

The reason for creating the subVIs is to make programming easier for the user, most of which have limited experience in LV. There is also some additional functionality built in to the subVIs.

The most preferable solution would be if the user could select I/O from an already created controller... maybe I will have to try to create an Express VI after all.

Basset Hound, I read the article you suggested and figured out what I was doing wrong with the input. Thank you.

Too bad you have to configure every I/O control by itself... Maybe a set of 8 already configured I/O controls can be specified as a custom tool? Any thoughts on this?

/Emil

0 Kudos
Message 4 of 5
(2,956 Views)
I have made some more tests with I/O controls as subVI inputs and this is what I've found.
 
My first approach was to create a custom control in the form of an array of 8 configured FPGA I/Os. This did not work because "This construct could potentially cause a reference to be dynamic.".
 
When I changed the control to a cluster of 8 configured I/Os it worked, not sure why this is less dynamic but apparently it is.
 
/Emil
0 Kudos
Message 5 of 5
(2,946 Views)