LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to get data to a user interface?

Hi,

I'm using labview 6i. I have an application with a handful of "core" vi's that actually run my application, doing the data acquisition, analysis, and control. I am currently using these same vi's for my user interface. I also have a number of vi's that contain menu's for configuring the "core" vi's. My questions is, what is the best way to seperate the "core" vi's from the user interface vi's. Global's, data socket, control references, others?

Thanks for the help.
0 Kudos
Message 1 of 4
(2,883 Views)
I'd assume you have a reason for needing to separate your vi's - perhaps simply for good organization if nothing else.
My approach is to keep the "core" or "non-user-interface" vi's separate from the user-interface vi's. In fact, I often have my user-interface vi be the main vi which calls the subvi's as needed. Its all a matter of finding the best, most logical organization that fits your needs.
You may want to visit Labview's Tutorial Manual chapter called "Program Design".
Good Luck.
0 Kudos
Message 2 of 4
(2,883 Views)
Hi Sal,

I have been a strong advocate of control refnums ever since LV 6i hit the streets. I recomend you look into using them to provide this conectivity.

You could accomplish this by using a variation on the following.

In your UI, create refnums for each of the controls or indicators that must be monitored or updated. Pass the appropriate refnums to each of the "core.i's" at program init time. Inside each of the core.vi's, use property nodes to read the control's values when appropriate and similarly for display purposes. (Note: Not all boolean mechanical actions are compatible with this technique. In those case you will have to explicitly write false values after find the control to be true or vise versa).

By using this technique, you can keep the UI diagrams clea
n. Depending on your app. the UI diagram could consist of the init's I mentioned above, and a while loop that watches if it's time to exit.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 4
(2,883 Views)
Hi Ben,
Thanks for the info. I've read some about refnums but never used them. Can you tell me what are the advantages of using refnums instead of global's? Thanks.
0 Kudos
Message 4 of 4
(2,883 Views)