LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

combobox populating with string from another VI

Hi all!
I have two VI's, one with user combo boxes and another one with string controls. My objective is to populate the comboboxes on the first VI with the user string input from the second VI.
To accomplish that i'm using a global array for each one of the comboboxes populating them from the second VI. Is this the best way to do it?

 

I'm very new into this Labview thing, and still struggling with the past years of C programming.

 

Thanks in advance,
Pedro Salazar

0 Kudos
Message 1 of 10
(3,671 Views)

Well, if that's the only thing you're doing than it should suffice. But don't get too attached to local and global variables. Using them extensively is not recommended. Since you're at the beginning stage of this, have a look at how queues, notifiers etc. work. They are under the synchronization pallet.  

 

PS. You may get even more productive replies/criticism/advice Smiley Wink if you attach code example to your thread. 

 

 

Kas

0 Kudos
Message 2 of 10
(3,658 Views)

I've done a quick research about queues and notifiers but i don't know if they will do the job. Won't all the data be lost if the receiver VI is not running?

Is it better to write the data to an excel file?

 

PSalazar

0 Kudos
Message 3 of 10
(3,649 Views)

"Won't all the data be lost if the receiver VI is not running?"

 

If the source queue is closed by the time the recieving queue (in this case VI) runs than thats true. 

 

Alot of other factors need to be taken to consideration before you decide using a particular function i.e. will your VI's be running in parallel or not (which is what I thought), is the user VI or the other one acting as main VI, are you looking to interrupt the proces because of some other external influance (i.e. hardware), do you need to log these messages/strings etc.

 

It all depends on what the main goal is and what type of control you want to have. If its just what you described on your first thread (i.e. sending a message/string from one VI to another), then you should be ok. What you described sounds more like messages/tasks (from a programming point of view) and not data (as in measurement readings) and if thats the case then I don't recomend saving to HD. You'll just be adding extra complexity/processing power and resources to something thats easily accomplished otherwise.

 

I didn't mention this earlier but another way is something known as Action Engine (AE for short).  

 

http://forums.ni.com/t5/LabVIEW/Community-Nugget-4-08-2007-Action-Engines/m-p/503801/highlight/true#...

 

This is where a 3rd VI (in this case SubVI) will act as the message carrier between the two VI's. 

 

Kas

0 Kudos
Message 4 of 10
(3,637 Views)

The main goal is to have one VI to insert data and another to use all the inserted data for measurement control. This two VI will never run simultaneously and after the data insertion the user can just turn off the computer.

 

I think it will be best to think of another way to do this maybe with just one VI.

 

Thank you once again zerotolerance.

0 Kudos
Message 5 of 10
(3,614 Views)

well, have one vi write it to a file....then have the second one read it?

0 Kudos
Message 6 of 10
(3,609 Views)

I'll do it if can't find another way, but from what I know about Labview (that is almost nothing) this will be the safest solution, preventing data loss (if the user does not open the VI containing the combobox), and ensuring that the values inserted into the string control populate permanently the combobox from the other VI. Am I wrong?

 

What about the use of a reference and property node, is it possible? 

 

0 Kudos
Message 7 of 10
(3,601 Views)

@PSalazar wrote:

 

This two VI will never run simultaneously....

 


 

what is the point in having references after you had made this statement? just write to the disk and the info is there for whomever wants it. you can still have references and variables to pass when ran together.....

 

0 Kudos
Message 8 of 10
(3,596 Views)

It might be a little easier to "keep this simple" if you include some code, Pedro. Have you found the "Strings[]" property node?

Then you are interested in preserving the Combo Box strings when the VI is closed then opened again? Try it - it works!

This is one VI, but I didn't completely understand your use case.

stringToCombo.png

0 Kudos
Message 9 of 10
(3,582 Views)

Without seeing some code, i'll say the combobox vi only needs a string array input (and ofc the standard error in/out) and in that vi you'll set the strings[] property of the combobox.

 

The connector pane = the procedure parameters, and i assume you'd need some strings in C also. 😉

 

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 10
(3,566 Views)