From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

What is the first event that we can call after click on the run button.

Solved!
Go to solution

Dear all,

 

I want to call an event when I click on the run button, before start any other actions. Can any one suggest me a solution other than the time out event?

 

Thank you

 

Gayanthika 

0 Kudos
Message 1 of 6
(2,236 Views)
Solution
Accepted by topic author 0112687888

You can associate an event to a (hidden) boolean (or other control), then fire it by writing to a value(sgnl) property node of it before the event loop starts.

0 Kudos
Message 2 of 6
(2,232 Views)

Thanks for your answer, may I know how it is possible to identify that the user click stop button.

0 Kudos
Message 3 of 6
(2,225 Views)

And I found another solution, We can check a boolean local variable and use a case structure in the Time out event to call the First event.

0 Kudos
Message 4 of 6
(2,222 Views)

@0112687888 wrote:

And I found another solution, We can check a boolean local variable and use a case structure in the Time out event to call the First event.


Solution to what problem, exactly? That sentence make very little sense. Can you explain a little more what you are trying to say? Maybe attach a VI?

 

To see if the user has pressed the stop button, you would use a "value changed" event assigned to the stop button.

0 Kudos
Message 5 of 6
(2,214 Views)

There are a lot of ways to do it but I don't think you really need a "start event". If you do then you can use a hidden control as Altenbach suggests.

 

Another option is to use the timeout event and then set the timeout to -1 so it never fires again.

 

Timeout Start.png

 

The reason I say that I don't think you need a startup event is because you can just execute some startup code before the event loop like this

 

startup code firs.png

 

The advantage of the first method is that you can have some other "reinitialize" event that sets the timeout back to 0 so the startup code is called. But all your events should be doing is sending messages to some other loop anyway so you still don't need a startup event.

 

Attached are both VIs in LabVIEW 8.0 format.

=====================
LabVIEW 2012


Download All
Message 6 of 6
(2,192 Views)