LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with function fist call

Hi,
I have got an issue with the first call function, I use it to start a counter in a VI and this VI is called by a value change in my main VI ,
fisrt time the main VI call my VI  the first call works well but if I stop my VI and go back to main VI and after restart my VI by pushing a button on the main VI the function first call never take value 1.

why first call does work only one time?do I have to use another VI  and if the answer is yes wich one should I use to do what I want to do

I join a part of my VI because the complete VI is too heavy

thank you

Olivier
Download All
0 Kudos
Message 1 of 2
(2,543 Views)
You will likely get many replies to other options (such as storing the value in an .ini file) but allow me to explain the "first call" function to the best of my experience.

Copy and past from LabVIEW Help:
First Call? returns TRUE the first time the VI runs after the first top-level caller starts running, such as when the Run button is clicked or the Run VI method executes. If a second top-level caller calls the VI while the first top-level caller is still running, First Call? does not return TRUE a second time. After all the top-level callers become idle and a top-level caller starts again, First Call? returns TRUE the first time the VI runs after the idle state. Reentrant VIs have an instance per data space. Therefore, a shared reentrant VI returns TRUE for each data space instance the first time its top-level caller calls it.


Roughly, it returns a true for the first run during that instantiation. Each time you hit run is a new instantiation and thus a new first run.

When I have needed to store values locally, I have created a temp file or an INI file. Look into the "Configuation file VIs" in the file I/O Palette.
0 Kudos
Message 2 of 2
(2,540 Views)