LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Configure Struct Output from Mathscript Node

Is it possible to configure a struct output from a Mathscript node, rather than just relying on the (sometimes poor) auto-detection? e.g. sometimes auto-detection creates an output as an array/matrix when it is actually a scalar. You can right click, and configure that output as a scalar and be on your way. With structs however, you can only select "Struct" from the data type selector.

0 Kudos
Message 1 of 4
(2,503 Views)

Hey, raceybe,

Based on the documentation I can find, structs passed out of MathScript nodes are converted into clusters in the LabVIEW environment.

You could unbundle the cluster, make whatever changes you want to make, and then bundle them back into a cluster. May not be the cleanest solution, but it'll get the job done.

What exactly are you trying to configure about the output?

NickelsAndDimes
Product Support Engineer - sbRIO
National Instruments
0 Kudos
Message 2 of 4
(2,458 Views)

The issue I'm having is that the data types that Labview "guesses" using auto typing are wrong or unwieldy. One common mistake I see is that a scalar double is interpreted as 2D array, or a scalar double is interpreted as complex. And the auto typing isn't always consistent, even when not using structs. Similarly handled values are typed differently and need to be reassigned manually, resulting in coercion dots inside the Mathscript block.

 

Ideally, it would be nice if you could fully configure the struct like you can manually configure each Mathscript output type. In short, it appears we are left with Labviews auto typing without any opportunity for manual reassignment.

0 Kudos
Message 3 of 4
(2,455 Views)

My inclination would be to make sure that the structure in the MathScript code is set up properly. If MathScript thinks it's dealing with a 2D array instead of a scalar, it would follow that LabVIEW also thinks it's dealing with the wrong data type.

NickelsAndDimes
Product Support Engineer - sbRIO
National Instruments
0 Kudos
Message 4 of 4
(2,445 Views)