LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically filling text rings

Hello,

I have got the following problem:

In a sub VI I use two different TextRing controls, named TextRing1 and Text Ring2. I want to fill TextRing2 with Text constants programmatically in depent of the Text wich is selected in TextRing1. For Example if in TextRing1 is the string "One" selected, Text Ring2 shall contain the value 'Two' and if in TextRing1 the string "Three" is selected, the TextRin2 shall contain the string "Four".

I want to use this subVi in a Host Vi which calls the subVI. The values for the Text Rings are passed as constants to the subVI. Now during programming i want, that the string values of TextRing2 constant are suggested correctly in dependence wich string is selected in TextRing1 constant. Is there a way to realise this in LabView? Could please anybody help me? Thanks a lot.

0 Kudos
Message 1 of 18
(3,833 Views)

Event structure, value change event on TextRing1; change index of TextRing2.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 18
(3,830 Views)

Hello Yamaeda,

thanks for your reply, could you please make an example.

0 Kudos
Message 3 of 18
(3,827 Views)

Example attached.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 18
(3,820 Views)

Hello, can you please convert the example vi to LabView version 8.6. Thanks

0 Kudos
Message 5 of 18
(3,817 Views)

I thought 2010 would be old enough. 😉

8.6 attached.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 18
(3,800 Views)

Hello Yamaeda, i have made an example of my problem: i have attached two VIs. A sub Vi which fills combobox 2 with strings in dependence of the string wich is selected in combobox1. So far this works fine. The sub vi is called from the host vi, and values of sub combobox 1 and combo box 2 are given via constants. Now my problem is, when i select string b in combobox1 constant, i want that the combobox2 constant automatically is filled with value b1 and b2 in the host vi.

Download All
0 Kudos
Message 7 of 18
(3,794 Views)

So you are trying to programmatically modify a diagram constant at run time?? Why??

 

Turn the diagram constants in the main VI into controls and wire their reference into the subVI. Now you can manipulate them at will via property nodes.

0 Kudos
Message 8 of 18
(3,776 Views)

Here's some quick code that should get you started. (downconverted to LabVIEW 8.6)

 

(note that the property node belongs after the case structure and that you don't need the timeout case. Also, the subVI call needs to be configured to show the front panel since it is intereactive and needs user interaction to complete (right-click...subVI node setup)).

0 Kudos
Message 9 of 18
(3,767 Views)

hello altenbach, thanks for your reply,

my goal is to get the right values suggested in the text ring 2 constant of the host vi, in depedence of which value i have selected before in text ring 1 in the host vi, this values shall be suggested during programming of the host vi, and not during the host vi is running. I want to realize a kind of intellisense for the text ring constants of the sub vi, because i have very long text constants which i dont want to type in manually during programming of the host vi. I use the the sub vi many times in a long sequence in the host vi, and every time i have to type in the text constants manually by hand.

0 Kudos
Message 10 of 18
(3,743 Views)