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 add new items to a ring

Hello,
 
i have a problem to add new items to a ring control ! I wrote a dialog which wants the user to input a profile name as text. This can be done as often as possible, but now i want to write the new profile name to the ring control. The first one as first in the ring control, the second profile name as second and so on...
 
Something like that:
 
>ring control
 profile 1
 profile 2
 profile 3
 .
 .
 .
 
I don't get it... Maybe someone can help me ? Smiley Very Happy
 
I think it can be done with a property node for the ring but i can not program an increasing counter like in C (X=X+1) which holds the value X everytime i run the case structure... ARRRGH !! Smiley Mad
0 Kudos
Message 1 of 7
(3,609 Views)
Are you tring to use a menu ring control or an enum? For a menu ring control just wire an array of strings to the "Strings[]" property (see attached). The values are set automatically.

For an enum control you can't do this programmatically.

Or did I completely misunderstand your question?

Message Edited by smercurio_fc on 01-25-2006 11:31 AM

Message 2 of 7
(3,589 Views)

Thanx, but the problem is... i have written a routine that prompts the user to write down an profile name. This profile name is saved on disk. And now i want to select from an ring the saved profiles. The problem is the indexing of these profiles in the ring...

ring

profile 1  (index1)

profile 2 (index2)

So when you saved more than one profile after another (you can only save one per routine) you can select profile 2 to load and run from the ring...

So i have a problem to put these new profiles in the ring or maybe in an array, because i don't know how to increase the array by one after you saved a new profile !

Hope this describes my problem better...Smiley Wink

Message Edited by Estrakay on 01-26-2006 02:21 AM

Message Edited by Estrakay on 01-26-2006 02:22 AM

0 Kudos
Message 3 of 7
(3,565 Views)

Hi

I'd suggest you to split up this two steps. In step one you write the new profile text to disk. In step two you read all available profiles from disk and fill the ring with this values - so you will have the most recent values available.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 7
(3,552 Views)

Found the way to add. It was much simpler than I thought

 

Use strings property of menu ring

alexela_0-1659288933914.png

 

This appends new row to menu ring. 

 

 

 

0 Kudos
Message 5 of 7
(1,607 Views)

@alexela wrote:

This appends new row to menu ring. 


(did you notice that this thread was from 2006? 😮 )

 

The correct tool to append (or prepend) an element to an array is "built array", not "insert into array".

 

altenbach_0-1659382463864.png

 

"Insert into array" is needed for the rare cases where you need to add an element somewhere in the middle, shifting all higher elements up in index. Using it with an unwired index creates confusing code because it is not always obvious to everybody where the insertion will occur.

 

(There does not seem to be an obvious way to stop your VI?)

0 Kudos
Message 6 of 7
(1,568 Views)

I was searching for same question )

You right, right way is to use build array, I tested with insert and it worked too. 

I just saw some wrote that this is not working... 

 

0 Kudos
Message 7 of 7
(1,562 Views)