From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use repeated values in a ring text control? There are another similar control?

Solved!
Go to solution

Hello guys,

I'm working on an application that, at stat-up, read some basic config values from a file and passes it to a ring text control, like a ini file.

The ring text control is perfect to use in diagram blocks because I can select a specific text and I have the value associated with it, in a very clear way, but... I can't use duplicated values, and my application have more than two duplicated values!

There are an alternative way or control that replaces the ring control and maintains these good qualities?

 

Thanks a lot

0 Kudos
Message 1 of 15
(3,459 Views)

You seem to say that you are using the ring mostly on the diagram side. Is it also an indocator or control that the user sees? If not, you could e.g. use an array of clusters, each cluster element containing a string and a numeric. You could also use variant attributes for name/value pairs.

If you also need it as a real ring control, just use sequential values and use an array lookup table and index into it and get the real values.

 

Can you show us a mode defined example where what you are trying to do seems like a good solution?

 

0 Kudos
Message 2 of 15
(3,449 Views)

Duplicates?

How do you tell which one is which?

Can you append an index # to the duplicates?

 

George Zou
0 Kudos
Message 3 of 15
(3,443 Views)

Lets be clear.  do you have duplicate String elements or Value elements.

 

Duplcate Strings are allowed but will really annoy users and cause surprizing bugs unless you disable all but one duplicate selection and I wouldn't even try that. About the only time dup strings make any sense is "-" which is an unsetectable seperator and the item editor does not implement support for the feature. For rings, enums and combo-boxes values must be unique.

 

A custom control with a looser set of rules (possibly an X-Control) would be the work around but, you will have serious user, developer and maintainance issues with this.

 

if you have mutiple "Conditions" that should have the same effect there are better ways.  Can you show a use case example?  The use case would help us guide you to select a better method.


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 15
(3,429 Views)
Well, he said "duplicate values", not items. One possible use case would be a sorted list of items, where some are synonyms and should map to the same value. I already described some alternatives.
0 Kudos
Message 5 of 15
(3,419 Views)

@altenbach wrote:
Well, he said "duplicate values", not items. One possible use case would be a sorted list of items, where some are synonyms and should map to the same value.

With that in mind, Variant Attributes would be the best way to go.


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 6 of 15
(3,401 Views)

Hi,

I'll try to clarify some details.

All of itens in the ring are used only in block diagram, if needed, there are some VIs that change the values.

There are no duplicated strings, only values.

I'm using the text ring as a list of constants, the size is fixed and well defined. All of values came from a config.ini file that is read at start-up moment.

This ring have informations about my instruments and procedure, for example, number of measurements per cycle, number of cycles, instrument curve adjustments, etc. These values will change only when the instrument is calibrated or when the procedure is updated, so, I change the config.ini file and the LabVIEW code is always the same.

I attached a small part of my code that shows the ring text and where some elements are used for one instrument (I can have more than one instrument).

 

Right now, I had an ideia, I can use global variables, so I can use one global VI to procedures constants, one to Instrument1, one to Instrument2, and so on. This is a good approach?

 

Download All
0 Kudos
Message 7 of 15
(3,363 Views)

Ah, I see where you are going with this.  Global Variables actually work very well as "constants".  So if they are written to at the very beginning from reading a configuration file and only written rarely, I think the global variable is a good approach.


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 8 of 15
(3,353 Views)
I've used locals quite often when reading from an ini file to set parameters. I don't see the benefit of creating a ring control instead of just initially writing directly to the local.
0 Kudos
Message 9 of 15
(3,343 Views)

The benefits of a ring is to group constants of same family, like, parameters of instrument, parameters of process, general parameters, etc.

0 Kudos
Message 10 of 15
(3,339 Views)