04-15-2026 07:56 AM
How can I get a malleable VI to break when a numeric input does not have units?
Solved! Go to Solution.
04-15-2026 09:52 AM
When I don't find an appropriate node to make a specific type assertion, I instead try to find an assertion of the opposite of what I want.
I then use a diagram "break inversion" technique to achieve the initial type assertion:
You can even have multiple negative assertions before the actual code if required.
Regards,
Raphaël.
04-15-2026 10:44 AM
@raphschru wrote:
When I don't find an appropriate node to make a specific type assertion, I instead try to find an assertion of the opposite of what I want.
I then use a diagram "break inversion" technique to achieve the initial type assertion:
You can even have multiple negative assertions before the actual code if required.
Regards,
Raphaël.
Nice trick! Just FYI though, I played around with it and if you want to filter waveforms that don't have units, you need to add a "Get waveform components" to another "exclusion" frame and do the check again. That assertion will let a waveform through that has units, so the wrong frame will execute:
04-15-2026 11:04 AM - edited 04-15-2026 11:10 AM
@BertMcMahan wrote:Nice trick! Just FYI though, I played around with it and if you want to filter waveforms that don't have units, you need to add a "Get waveform components" to another "exclusion" frame and do the check again. That assertion will let a waveform through that has units, so the wrong frame will execute:
I don't think units are supported in waveforms. It seems the unit you set in the waveform constant is simply ignored.
"Get Waveform Component" returns a unitless array and "Get Waveform Information.vi" from the Data Type Parsing palette returns a unitless numeric variant type.
04-15-2026 01:25 PM - edited 04-15-2026 01:26 PM
Looks like you're 99.9% right. Apparently the waveform controls themselves DO handle it, but it seems you can't do anything WITH those units. You can't even wire up an array with units to Build Waveform.
But, if you JUST use waveform controls/indicators, it works:
I believe plots will use whatever units you give them, but you can't adjust it anywhere I can see.
(seems like every time I try to use units for anything, I find a case like this within about an hour and give up! See also https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Make-units-work-all-the-way-or-skip-them/idi-p/180351...)