LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can case structure's subdiagrams reflect on values of a typedef control?

Solved!
Go to solution

Hello,

 a simple situation: I have a wire which changes dynamically its value, but it's assured to have values corresponding  to a typedef 'd enum. Now I want to wire this wire to a case structure and have a case for each value of the typedef 'd enum - which is possible to only do manually. But is there a way to have the case structure maintain its subdiagrams reflecting the enum keys? So that if i swap two keys in the enum's typedef, the cases in the case structure swap too?  Would you think of another approach to produce the same functionality?

 

(my current kind of workaround is to put the case structure in a subVI and set the typedef'd enum as Control which makes the case structure reflect on the enum values, but the actual incomming value changes according to the outer VI)

 

Thank you for any ideas!

0 Kudos
Message 1 of 3
(2,865 Views)
Solution
Accepted by ravyh

Hi ravyh,

 

use the little function shown in this LabVIEW Idea!

(Don't forget to support that idea in case you find it helpful…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(2,851 Views)

1. Is there a reason your "other VI" could not output the type def?

2. The Coerce To Type is really what you want, but you could likely get away with the Type Cast as well.


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 3 of 3
(2,838 Views)