01-09-2015 03:22 AM
Hello
I have to get the time at which my PXI has shutdown and what time it started, and same thing i have log in to excel sheet.I have to genarate report in labview, how many hours we have utilized PXI in a week or month.Any Help?
Thank You
Pradeep
01-09-2015 03:41 AM
Pradeep,
just brainstorming:
Create an application you place in autostart (running after/during boot) which runs in background simply logging times every minute or 5 minutes.
An additional analysis tool reads the file(s) every week/month (and deletes them as necessary) and uses the information to calculate the up-time.
This will, of course, only display a rough estimation, but it is simple to implement.
Norbert
01-09-2015 07:49 AM
Following up on Norbert's suggestion, this Snippet is code I extracted from one of the NI-supplied Project Templates, designed to write error messages into a PXI error log. To prevent the log file from taking over all of the disk space, it has a maximum size specified (here in a Global, but you could use a local constant) -- if the file gets too big, the first half is essentially "thrown away".
BS
01-13-2015 02:46 AM - edited 01-13-2015 02:47 AM
Hi Norbert
Thank You for your suggestion
I dont want to run that program in baground all the time....while starting the PXI it should only update start time in file or log and while shut down it should update shutdown time in same file or log....I tried your suggestion and I am runnig a .exe in a start up and writing the start time in file but how to get the shutdown time?
01-13-2015 03:06 AM
Thank You Bob
I will try this code...I want to log the shutdown time of PXI in a file. If i run a .exe(that .exe will only execute one time log the start time and it will stop) in start up which will log start time of PXI similarly i should log shutdown time also without running any code in background..
01-13-2015 03:15 AM
@ELNO wrote:
Hi Norbert
Thank You for your suggestion
I dont want to run that program in baground all the time....while starting the PXI it should only update start time in file or log and while shut down it should update shutdown time in same file or log....I tried your suggestion and I am runnig a .exe in a start up and writing the start time in file but how to get the shutdown time?
If you don't have an exe already running.... i think there is no way. Maybe you can "hack" the Windows Event logs as i think the shutdown time is logged there, but as mentioned, i see this as a hack.
So the clean way is my recommendation.
Norbert
01-13-2015 06:59 AM
While it is easy, in principle, to have a program that runs (and stops) when the PXI starts, it's a bit trickier to do this when the PXI stops. In our lab, the usual way to stop the PXI is to turn off its power! Note that we are working on a VI that "predicts the future" and writes the Power Off event 5 seconds before the user flips the switch, but there are still a few details left to code ...
BS
P.S. -- lest anyone ask for more details about this project, take another look at my signature ...