LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variant data in type specification structure

Solved!
Go to solution

Hello all,

In the attached VI snippet I have a Type Specification Structure (TSS) that I want to be able to include a case for what to do when wired Variant data as a separate case from 'unknown, use last diagram' data.

Forum Post TSS.png

As per Manual:

 

Type Specialization Structure
Has one or more subdiagrams, exactly one of which LabVIEW compiles and executes, depending on the order and the compilation result of the subdiagram.
LabVIEW declines subdiagrams in order if they have syntax errors.
 

My problem is caused by all 'unknown datatype' being typecast to the variant case, and never reaching the 'unknown datatype' subdiagram.

 

Any suggestions on how to get the following behavior out of a TSS?

  1. If Numeric element is wired, run this subdiagram
  2. If Boolean element is wired, run this subdiagram
  3. if Variant element is wired, run this subdiagram
  4. in all other cases run this subdiagram.
________/~~~~~~~~*********~~~~~~~~\________
Certified delinquent LabVIEW developer. Recertifying at next NI Days
0 Kudos
Message 1 of 2
(2,271 Views)
Solution
Accepted by topic author szewczak

One of the new toys included in LabVIEW 2018 is the Assert Type function.  It is hiding in the Comparison->Assert Type palette.  What this function does is break a diagram when the two inputs do not match data types.  So if the input is, for example, a string, it will break the Variant case and so the next case will be chosen.


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
Message 2 of 2
(2,213 Views)