LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

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

Solved!
Go to solution
Highlighted

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
(153 Views)
Solution
Accepted by topic author notAWizard0555
05-15-2019 09:32 AM

Data Communication pallet/Synchronization/FirstCall? function.

 

-AK2DM

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

Thank you!!

0 Kudos
Message 3 of 5
(113 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.


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 4 of 5
(109 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
(69 Views)