Showing results for 
Search instead for 
Did you mean: 

how can i present a clk in my front panel?

I want to present a clock to show how much time pass since the program start, i need it to work parallel to the main block
0 Kudos
Message 1 of 11
What is your main problem : customizing a control to create a clock or to measure the elapsed time ? How should this clock look like ?
There is a nice example of a clock with dial and needles in this discussion. An easy alternative is to use a simple string indicator with a time format.

0 Kudos
Message 2 of 11
Here is a little example that I have just written for you. A local variable of the stop button could be used instead of the notifier. I won't make the example to difficult to understand and therefore I didn't use an event structure to handle the press of the button in the main loop.

Feel free to post back if you need further help.
0 Kudos
Message 3 of 11


Thx for your help, but i can't open your files becouse they save to 8.5 and i have 8.2.1

I think i didn't explain my problem as well, I need a timer to show the elapse time since the program start.


0 Kudos
Message 4 of 11

yechielo a écrit:

I think i didn't explain my problem as well, I need a timer to show the elapse time since the program start.

My example does exactly that ! Run the attached LV8.2 version and post back if needed.

0 Kudos
Message 5 of 11
Thx a lot for your help, that exactly what i need, but now I have a new problem
I need to stop the program when the user press the stop button (that's work) or the DAQ finish to sample, and that's not work.......
how i, synchronize the DAQ and the stop button to stop the program?
i add my program
0 Kudos
Message 6 of 11
Your program makes no sense. You have no data acquisition running continuously. The only thing you have running is the elapsed time. If you are using the Run Continuous button, don't do that. It is not to be used for that purpose and you should never use the stop button on the toolbar. Put your acquisition/display/file write in the main while loop.
Message 7 of 11


you right, I reorganze my program, the main idea in my program is to collect data from DAQ for knowm time, present the elapsed time in my front panel and in the end write the data to xls file.

my program need to stop if the DAQ finish to collect the data or the user press on stop button

now, the DAQ read data, the time presents but i can't stop the program when the DAQ finish to work

i add my program, any comments accepted

Thx for your help

0 Kudos
Message 8 of 11

First of all, since the DAQ cannot be stopped, the stop button is useless. All you need is wait for the DAQ to finish, then stop the timer loop. Also, your sequence structure is useless, because the sequrence of events is entirely determined by dataflow. What's up with all these hidden indicators? If you can't see them, you don't really need them. 😉

I would not bulk up the code with all this fancy stuff (notifiers, time formatters, etc). All you really need is a loop that spins once per second and then display the iteration counter as HH:MM:SS. If you want fractional seconds, run the loop a bit faster, divide the iteration counter accordingly, and display it as DBL with a format of, for example.

Here's a lightweight alternative. I left a few comments on the diagram. See if it makes sense.

Sorry, I don't have DAQ installed, so I cannot run your code or look at the DAQ express VI. How long is the DAQ actually taking?


Message Edited by altenbach on 03-09-2008 10:02 AM
Message 9 of 11
Sorry, forgot to set the time format for the time indicator.
Overall, the code is not very satisfactory, because the DAQ cannot be interrupted and the code is linear. Better would be a program desinged as a state machine that runs when opened and starts out in a wait state.
Message 10 of 11