LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying an Enum Within a Cluster, With Another Enum in the Same Cluster

Hello all, 

 

In one of my programs, I have an array of clusters, each containing one enum control, one text ring and two numeric controls. The ring lists the service IDs for input signals and the enum lists the input signals. Each service ID is associated with certain signals, but not all. What I am trying to do is program the cluster so that when the user selects a service ID from list, the signals enum shows only the signal associated with the service ID. This would make the program a lot more convenient for users. Currently, the enum shows all the signal names, and the users must make sure to choose the correct combination of ID and signal. 

 

How do I do this? The idea is to get the enum to display only the list of trigonometric functions when the selected ring is 5 and VREFs when the ring is 7.

 

I really appreciate any help! Thank you

Download All
0 Kudos
Message 1 of 9
(3,274 Views)

Hi taasin,

 

I see two options for quick solutions:

1. Depending on the ring item you can enable/disable certain enum items (and preselect one enabled item)

2. Replace that enum by a ring: now set the items of that ring depending on the item selection of the first ring…

Best regards,
GerdW


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

I don't think this is possible to do in the way you have things set up. All elements of an array must have the same properties. So that means if you change the items in the ring for one element of the array, it would affect all the elements.

 

Edit: Oh I didn't realize the enum was the one you wanted to only show certain items in, rather than the ring. I still don't think it will work since you can't disable different enum items in different elements of the array.

0 Kudos
Message 3 of 9
(3,262 Views)

Hi GerdW,

Your first option was what I was thinking. I unbundled the cluster and made the Text Ring (service ID) the case selector. So, depending on the case (ID) the enum (signal) would display different lists. 

However, that is where I am stuck. 

I thought of unbundling the cluster so that I would modify the enum for each case. But the issue is that the enum is a control and I cant modify it. Should I use property nodes?

And then, once I do edit the enum, how do i bundle it back from each case and put it back into the cluster?

 

Thank you

0 Kudos
Message 4 of 9
(3,245 Views)

Hi taasin,

 

you need to work with references to edit the properties of those controls…

Wouldn't it make more sense the have that serviceID in an enum? Is the list of IDs fixed?

 

(Still the comments on "same properties for each element in an array" applies.)

Best regards,
GerdW


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

Hi GerdW,

In the actual program, there are 6 IDs and they are 5, 6, 7, 8, 20 and 30. I went with Text Rings so that I can change the values of these items. 

Gotcha, I'll try using reference to modify the controls.

 

Thanks!

0 Kudos
Message 6 of 9
(3,232 Views)

I'm fairly certain you can't modify just ONE of the dropdowns in the list, but you CAN modify each list just before the dropdown happens.

 

Capture the Mouse Down? event on the Ring. Fill its Strings values with the ones you want the user to select, then let the event happen. (Note, Mouse Down happens *after* the mouse down event happens, Mouse Down? happens *before*).

 

Basically, you'll be changing the items selectable in the Ring control each time the user clicks said Ring control.

 

Edit: You will need to manually extract the specific element clicked on in the Mouse Down? event. Try this code: https://forums.ni.com/t5/Example-Programs/How-To-Return-the-Index-of-a-Mouse-Select-Array-Element/ta...

 

(Idea taken from this lovely blog: http://culverson.com/monster-panel-iii/)

Message 7 of 9
(3,210 Views)

Hi All,

 

Thank you for your responses! I did manage to figure a way out. It doesn't change the list depending on the ID like I wanted it to. But, it does disable all signals that are not associated with the particular ID. 

I included a snippet of the code.

 

Thank you!

0 Kudos
Message 8 of 9
(3,204 Views)

If you're comfortable with Object Oriented stuff, this would be a great application for a QControl.

0 Kudos
Message 9 of 9
(3,200 Views)