01-12-2015 12:59 PM
I have a case structure in which the data type to send to the "Open and Verify Variable Connection" VI is determined. This VI is polymorphic and can handle any data type, but I can't seem to simply pass a constant of the determined type to the VI outside of the case structure, because tunnels can't handle multiple types. I can place an instance of the polymorphic VI inside each separate case, but that doesn't seem elegant. I just wanted to check that there isn't a workaround I am missing?
01-12-2015 01:41 PM
Your polymorphic VI should be replacing that case structure.
01-12-2015 01:59 PM - edited 01-12-2015 02:00 PM
The polymorphic VI I am referring to is the "Open and Verify Variable Connection" VI provided by NI, which requires a data type input. My case selector is acting on information other than the data type to determine the appropriate data type to pass.
01-12-2015 02:09 PM
Perhaps you could use the polymorphic vi before the case structure and have the case structure output a variant...
01-12-2015 02:10 PM
But the data type must be known at compile time. So what information are you using to find the data type?
01-12-2015 02:28 PM
PSP Variable refnums. I am in the process of converting a number of Network Shared Variable read / write nodes to programmatic access. I'm using the system configuration VIs to allow a user to select from any number of mostly identical cRIO controllers available on the network (which would all have identical shared variable libraries deployed), and then using the determined hostname of the selected controller to construct the PSP container refnum which is passed to the "Search Variable Container" VI. I am indexing the array of refnums passed out of that VI (comprising all of my network shared variables which are specific to the selected controller) in a FOR loop, with some code to strip only the variable name from the end of the refnum and passing that as a string into my case structure. I know the data type of any particular variable, so I can easily put an instance of the "Open and Verify Variable Connection" VI in each case, but ideally I would pass only the data type information out of the case structure:
01-13-2015 09:58 AM
Hi,
You can extract your data in the case structure and do anything else you need to do, convert to a variant and then pass to a single Open and Verify Variable Connection.