05-24-2011 05:58 PM
Hi all,
What is the “Format 0” box above? Not asking specifics, but generalities. When you click on it, it expands like below. I would like to make CPHA an input to this function (i.e. provided from the front panel). Haven’t run across something like this before, so wondering if somone could provide some pointers on where to look. This is NI provided example code that I am modifying, specifically the DAQmx SPI code. Thanks!
Gary
05-24-2011 06:14 PM
show polymorphic selector
05-25-2011 01:25 PM
Any way to set/change the polymorphic selector from the front panel?
05-25-2011 01:40 PM
NO. you cannot change the polymorphic selector from the Front panel.
A polymorphic vi is a set of closely related vi's called instance vis (they all have the same connector panes although the datatype may differ). they assist the developer by easilly replacing one type of function with another similar function but the specific instance vi must be determined and in memory at compile time and cannot change at run time. If there were a way to change the instance vi selection from the FP the block diagram code would change at run time and that is not allowed.
That being said: there are ways to dynamically dispatch a vi (choose the vi to run programatically) but, not by using polymorphism as LabVIEW implements polymorphism. Is there a need for your application to do this? we' can point you in that direction but, there are some more advanced LabVIEW features to master to achieve this behavior.
05-25-2011 01:49 PM
Hi Jeff,
Thanks for the reply. I am using NI's DAQ example code to generate SPI. I'd like to have CPOL and CPHA (SPI settings) configurable from the front panel. However, CPHA is set with a polymorphic selector in the example code. Just trying to figure out the best (i.e. easiest) way to make it run-time configurable. I've had LabVIEW training thru Core 2, if that gives you and indicator of my expertise (i.e. beginner).
05-25-2011 02:31 PM
Use a case statement with instance vi's in there own cases selectable from a FP control. All instance available at run time (easiest)