LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing multiple data types out of a case structure

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?

 

0 Kudos
Message 1 of 7
(4,256 Views)

Your polymorphic VI should be replacing that case structure.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(4,237 Views)

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.

 

0 Kudos
Message 3 of 7
(4,224 Views)

Perhaps you could use the polymorphic vi before the case structure and have the case structure output a variant...

0 Kudos
Message 4 of 7
(4,216 Views)

But the data type must be known at compile time.  So what information are you using to find the data type?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 7
(4,214 Views)

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:

 

1.png

0 Kudos
Message 6 of 7
(4,199 Views)

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.

 

 

0 Kudos
Message 7 of 7
(4,142 Views)