From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Replace index values of an array with strings

Solved!
Go to solution

I have a 2D array control (or indicator) CH x T : each cell of the array contains the voltage recording for the channel and at the time represented by the respective row and column.

 

I would like to be able to scroll the data by showing the channel names and the time values in the Index display instead of the numeric values.

For example, instead of seeing 0,1,2,3 etc as row index values I would like to see Channel1, Channel2, Channel3 etc.

Is this somehow possible?  

 

Any idea is very welcome!

 

Thank you in advance!

Cheers.

MG

0 Kudos
Message 1 of 8
(4,392 Views)

The easiest solution is probably to use a table indicator instead of an array, so that you can set the row and column headers. You can either enter the headers while editing the front panel, or you can set them programmatically using a property node for the table. Tables only display strings, so you will need to convert your data array to strings, but many of the number-to-string conversion functions accept arrays so this is simple.

0 Kudos
Message 2 of 8
(4,382 Views)

Do you mean you want to display only 1 text value at a time? If that is the case why don't you try using a Ring control with the Channel names along with the time value concatenated and scroll up/down the ring to change the values.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 8
(4,344 Views)
Solution
Accepted by topic author MG70

If you want to display the data as a 2D array, but use channel & time as the Index display, you can use Text rings and an Event structure.  You can shrink the display of the array if you only want to show one value.

 

Example_VI.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 4 of 8
(4,314 Views)

Doh!  Or, you could do this - http://digital.ni.com/public.nsf/allkb/64DCAB86E5E0D83886256E5F005E9B96  Customize the array control by replacing the numeric indicators with Text rings.

 

Example_VI_FP.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 5 of 8
(4,308 Views)

Hello jcarmody,

 

this is exactly what I was looking for!

 

Thanks a million!

MG

0 Kudos
Message 6 of 8
(4,296 Views)

Cool!

 

But the strings can only be edited in "Customize Control"

I could not see a property node to be able to edit the "Strings And Values [ ]" of the Text Ring of the array index?

Even better if you could edit the strings in the Test Ring at run time.

Omar
0 Kudos
Message 7 of 8
(4,256 Views)

@jcarmody wrote:

Doh!  Or, you could do this - http://digital.ni.com/public.nsf/allkb/64DCAB86E5E0D83886256E5F005E9B96  Customize the array control by replacing the numeric indicators with Text rings. 

 


Oh how neat.  I can't think of a time when I would want to do something like this instead of using a listbox, but I like it because I didn't know you could do it.

Message 8 of 8
(4,248 Views)