LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem when trying to keep track of uptime with non voltaile storage

Solved!
Go to solution

Hi All,

 

My application needs to keep track of the no. of time in seconds various banks of pumps have been running.  This code runs on a cRIO.  A section of the timed loop that executes this code is in the attached picture.  It all works fine, but sometimes the thread seems to stop for no apparent reason.  Any ideas?  I never see any error info printed out the error out display control.

 

Thanks,

Sean

0 Kudos
Message 1 of 5
(3,066 Views)

Hello,

 

What exactly do you mean by the thread stopping? The Timed Loop stops when it should not? I don't see what stop condition has been set to quit the loop.

National Instruments
0 Kudos
Message 2 of 5
(3,039 Views)
Solution
Accepted by topic author sean m
Are you getting any errors on any of those error wires that eventually lead to the right hand error node of the loop?  I think it is easily possible to get an error on a file operation.  If you get an error going to that right hand error node, it will stop the timed loop.  Open up context help and hover over that part of the time structure for more information.
0 Kudos
Message 3 of 5
(3,030 Views)

Thanks for the response, I thought some type of error encountered could be causing the problem.  In the attached diagram below is my proposed new solution.  If there is an error opening the file, the counter is set to zero (not sure what else I could set it to).  If there is an error writing the updated value to the file, the error code is sent up to the host GUI via a network shared variable but the program should still continue.  Still not sure exactly what I can do if the system can no longer write the file.  Is there any generic way of storing non-volatile values in LabviewRT?  All this messing around with files is quite low-level.  I also have Labview DSC (the databasepackage), but it doesn't look like LabviewRT can interface to it.

 

Thanks for your time,

Sean

0 Kudos
Message 4 of 5
(3,010 Views)

If you have any errors opening the file, then you are going to have to figure out what they are and how to fix them.  That or figure a way to work around it.

 

The DSC system does work with RealTime module and shared variables.  Now somethings you can't do such as shared variable logging on a SV hosted on a realtime module, but can if the SV is hosted on a PC.

 

The only other thing I'd be concerned about it is frequent writing to a file that is stored in non-volatile memory.  Some forms of non-volatile memory have a limited number of writes they can take.  So if this is one of those types, and you are doing frequent writing such as every 5 seconds, you could possibly kill the use of the memory faster than you might think.

0 Kudos
Message 5 of 5
(3,003 Views)