LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting up an initialization routine to run once

I'm starting my first LabView project. Hopefully my question isn't too basic.

There are several booleans and menu ring properties that I want to set when the executable is launched. I only want to run this section of the VI once (when launched) and don't seem to be able to do this. I haven't found any sample code for this. If someone would point me in the right direction I will appreciate it.

Additionally, I come from a VB background and have yet to grasp G code data flow. If there is a text or other instruction available, please let me know.

thanks,

todd
0 Kudos
Message 1 of 12
(4,117 Views)
Todd

can you send me a copy of what you are working with , or a scaled down version and i'll see what we can work out.

Dan (dan.bookwalter@hst.stoneridge.com)
Message 2 of 12
(4,117 Views)
Try to use the "First call?" function located in your Advanced>>Synchronization palette. I have attached an example that shows how you can use it.
0 Kudos
Message 3 of 12
(4,117 Views)
Not bad for a "first Project" type question.

There is always the option of wrapping all of the init code in a single frame seq structure "out front" that uses data flow to force it to execute first.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 12
(4,117 Views)
Dan,
Thank you for answering. I really don't have much to send you.

I have a boolean button and 3 menu rings. When the application is launched I would like the button to be in the ON state and the menu rings to be invisible.

When the boolean is clicked, one of the menu rings will appear. One of the other menu rings will appear based on the selection from the first menu ring. Lots of things will happen once all of the menu selections are made but I wanted to get the first part working before adding anything else.

Well, one other thing I want to get working initially is a second boolean button that will "reset" the screen to the initial values (boolean button to ON and the menu rings invisible.

thanks for your help.

todd
0 Kudos
Message 5 of 12
(4,117 Views)
Are you wanting to set default conditions? One simple way is to let LabVIEW handle this for you. Make sure that all values are set to the proper defaults and that all controls/indicators that you want hidden are hidden and then go to "Make Current Values Default" under the Operator menu. This sets the default values which will be saved the next time that you save the file. Also, LV will save the current state of the controls/indicators (hidden, etc.) as the default. These will be the defaults when you build your executable.
0 Kudos
Message 6 of 12
(3,951 Views)
Todd

i'll try to wire up something to give you an idea of one way you can handle your init and reset stuff, at least the way i understand it...

Dan
0 Kudos
Message 7 of 12
(4,117 Views)
Todd

here is one way to do it using an event structure and property nodes... there are many ways to accomplish the init etc... i like to use the event structure so i did it that way... this is very basic so there is no error handling etc... and yes you need to get a handle on the dataflow concept it is the heart of LabVIEW. it's not very difficult its just different than "standard" programming.

Dan
0 Kudos
Message 8 of 12
(4,117 Views)
John,
Thanks for answering.
I was going to set my startup defaults the way you described, but as a LabView rookie I'm in the learning mode and want to figure out how to do these things actively.

I certainly appreciate your input.

todd
0 Kudos
Message 9 of 12
(3,951 Views)
Dan,
Thank you very much. This is exactly what I was looking for. I sucks to be a rookie again.

thanks again,

todd
0 Kudos
Message 10 of 12
(4,117 Views)