04-16-2014 08:20 PM
-Objective: Is to record this CVI program time during the start and the end of this program information are record into a doc file (must be run in background) and retrieve the data when needed.
Addition: Add total time and record into a doc file also.
I think information needed are CVI timer, CVI write to file , CVI read from file…etc ? any think I miss out?
-Is there any example or advice related to the above to share with me to ease my writing?
Thanks
04-17-2014 01:53 AM
If you have a timer running (either a UI timer or a async timer), the time from the last execution of the timer callback is received in eventData2 parameter, while the total execution time of the program is in eventData1. Times are given in seconds.
You can display them on a numeric control via
SetCtrlVal (panelHandle, PANEL_TOTALTIME, *(double *)eventData1);
Apart from this, the simplest way of timing (subject of the accuracy of the system clock) is to use Timer () instruction: save it at the beginning of the program and use (Timer () - saveTimerValue) to obtain a rough appreciation of elapsed time. I use it very often if I don't need high accuracy in timer measurement.
With reference to file I/O I can suggest you to search in the example finder (Help >> Find examples...): CVI comes with several sample projects that you may want to examine to have ideas on possible alternatives for file access.