LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a simple program time data logging using CVI-Track the usage of the program

-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

0 Kudos
Message 1 of 2
(4,253 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(4,236 Views)