LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

First call is always true

I want to set the value of a numeric slider every time a sertain mode is set. I would suspect the "first call' would be the obvius solution. But for some reson it is always

'true"

Is there a nother good way of solving this problem, or am I doing somthing wrong?

 

/REO

 

 

0 Kudos
Message 1 of 3
(2,797 Views)

It seems you are using the "continuous run" button to run your VI. Don't!

 

Since this causes the VI to restart whenever it completes, "first call?" will always be true. Place your code in a while loop and use the plain run button. Now "first call?" will only be true the first time it is encountered during the run.

 

The "continous run" button is a debugging tool, and should not be used for regular operation. 🙂

 

 

Message 2 of 3
(2,791 Views)

Hai,
 
The first call function will always return TRUE in your case the reason is as follows:  When a VI runs for the first time this fuction returns TRUE and this VI should remain in memory (in execution mode) so that when it is called the next time it will give FALSE.  But the vi does not stay in memory i.e. when you press run button it executes and unloads from memory when execution completes.
 
One Workaround is keep the VI in memory or put a while loop with unintialized shift register and should run only once! Look at the VI that i have attached.

 

Hope this helps.

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 3 of 3
(2,766 Views)