There are a couple of ways of doing this.
If this is a sub-VI where you will only count the number of times it has been called during the operation of your main VI, then you want a sub-VI that is a functional global variable. You put the entire sub-VI in a while loop that has a True wired to its conditional stop terminal. Thus it only executes once when it is called. You create a shift register that is uninitialized, and increment it by one within the loop. As long as the sub-VI remains in memory, it keeps track of the value in the shift register.
The second way would be to store the values of interest in a file. Then you break up the sub-VI into 3 steps (a flat sequence structure can help guarantee the execution order.) In the first step, you read the data file and write the values to the controls or indicators of interest. In the second step, you do the main work of the VI, perhaps even incrementing the counter by one. In the third step, you write the values of the controls or indicators back out to the data file. You would use this structure if you were interested in maintaining the data between runs of the main program as well.