LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

menu ring indicator definition

Hello,
 
   Can I create a menu ring indicator one and re-use it numerous times? I have tried to copy the menu ring and what I really end up with a numerous menu rings that do not track the updates to the menu ring when I update the original. I would like to be able to create a menu ring indicator ONCE, and use the indicator numerous times and have ALL of them contain the updates that I have made to the original menu ring indicator. How can I do that?
 
Regards,
 
Kaspar
Regards,


Kaspar
0 Kudos
Message 1 of 7
(4,133 Views)
You want a type definition. Basically it is a custom control that forces all instances of itself to change when one instance is editted. Make a menu ring on the front panel. Right click --> Advanced --> Customize. Up at the top where it says control, you can change it to type def. Search around a bit for explanations of type defs, there are lots of them, including an excellent explanation of type def's in this nugget
Jeff


Using Labview 7 Express
Message 2 of 7
(4,123 Views)

Here are two options:

  1. Use a subVI which will output the list of values and fill each copy of the ring using the Strings[] property when you start your program.
  2. Use a typedef. The strings of a ring control are not part of the data type of a ring, so they will not update when you change them, but if you change the type of the control you can force an update and then the new strings will be used.
    The easiest way to do this is to change the representation, click File>>Apply, change the representation back and apply again. You should note, however, that there is some danger in this - you should try to keep to the same number of bits of your current representation or higher, so you don't get coercion on your current values if they are out of range. Also, you should be careful even if you stay within the same number of bits, because if you change an I32 to a U32 you will lose values like -1. They might be translated back correctly, but I never checked.

___________________
Try to take over the world!
Message 3 of 7
(4,120 Views)
A strict typedef will hold the strings of the ring (as well as other properties such as size, which you might not want to lock to one setting).

Matt W
Message 4 of 7
(4,096 Views)


Matt W wrote:

A strict typedef will hold the strings of the ring (as well as other properties such as size, which you might not want to lock to one setting).

Correct, but just now I remembered what the problem with it was - this won't work for block diagram constants of the ring, so it will work fine for the UI (which is what the original poster wanted), but not for constants.

___________________
Try to take over the world!
Message 5 of 7
(4,075 Views)
Will an Enum strict typedef work for diagram constants also? Please clarify me.
- Partha ( CLD until Oct 2027 🙂 )
Message 6 of 7
(4,071 Views)


parthabe wrote:
Will an Enum strict typedef work for diagram constants also? Please clarify me.

Definitely. In an enum, the strings are part of the data type, so any change to the strings will force an update even if you're using a regular typedef.
For rings, the strings are only part of the display, so they are updated for FP rings, but not for BD rings. To do that, you should do what I described earlier, which will work for a standard typedef too.

___________________
Try to take over the world!
Message 7 of 7
(4,060 Views)