From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

A subvi that runs only the first time labview is opened?

Solved!
Go to solution

I'm looking to create a subvi that only runs the first time LabVIEW is opened on the computer (every time you completely close LabVIEW and reopen it, it will run). I've been told this can be done by using a Boolean variable and setting the default setting to true, after the vi runs once it turns off, so that the case that contains this subvi is just skipped over.

I don't have any starting code, so I don't have anything to attach or show. I'm just not sure how to make the Boolean variable turn off after the first run and reset when labview restarts.

 

Any help is appreciated, and if you have a better way of doing it than the way I explained let me know!

We are trying to avoid doing a button press event to trigger the vi to run, we'd like it to be automated.

0 Kudos
Message 1 of 5
(2,394 Views)
Solution
Accepted by notAWizard0555

Data Communication pallet/Synchronization/FirstCall? function.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 5
(2,378 Views)

Thank you!!

0 Kudos
Message 3 of 5
(2,354 Views)

@notAWizard0555 wrote:

I'm looking to create a subvi that only runs the first time LabVIEW is opened on the computer (every time you completely close LabVIEW and reopen it, it will run).


You cannot "run" anything automatically if LabVIEW is opened, just if your VI is run for the first time after that.

0 Kudos
Message 4 of 5
(2,350 Views)

@altenbach wrote:


You cannot "run" anything automatically if LabVIEW is opened, just if your VI is run for the first time after that.


Actually, if you place a VI called lv_init.vi in vi.lib, it will be called every time LV is launched (see here), but based on the discussion this is unlikely to be what the OP actually wants and I can't say I ever had any actual use for it, certainly not for code in an actual program. If anything, I would expect it would be useful for launching some edit time daemons.


___________________
Try to take over the world!
Message 5 of 5
(2,310 Views)