LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Batch record data under sudden power loss

Hello,

I am currently using LabView 2011 with both the FPGA and real time packages as well. Our system data is transferred into LabView from a cRIO-9073, using C-series modules, to a FIFO-dominant FPGA. The FIFO method then populates specific arrays once the record data button is pressed. The arrays populate during the system test but no data is recorded until the program is stopped or the record data variable returns false. The concern with this method arises with power loss to the cRIO. If the cRIO loses power, all of the data in the arrays is not recorded and thus lost. Is there a way to record all data during a loss of FPGA connection without recording the data line by line? For reference, we record data in 20 second intervals and run the program for around 6 hours straight so recording line by line is not an option due to the effect on the computer. Once again this is LabView 2011, so WatchDog is not as helpful as it is in the newer versions. I attached the zip folder with all the Vis to this message. Also in the top while loop of the main, the TDMS file write VIs was part of an attempt I haven't completed yet. 

I also know my code(s) needs cleanup, I am a self-taught LabView programmer who tried to do what worked! 🙂

 

Thank you for any help one can provide and have a great day!

0 Kudos
Message 1 of 8
(2,585 Views)

As a longtime Test guy, my knee jerk reaction is to approach your problem by addressing the cause and not the effect.

 

The effect is that you sometimes lose data.  The cause is that primary power is unreliable. 

 

An UPS is more cost effective than coding around an environmental failure.  That's my $0.02!


"Should be" isn't "Is" -Jay
Message 2 of 8
(2,583 Views)

I already have a UPS. This is just a safety precaution because eventually the system will have to be tested for 24 continuous hours. 

0 Kudos
Message 3 of 8
(2,555 Views)

So where is your problem then?

 

That you lose power for longer than the UPS can handle?

That you don't have all the equipment connected to a UPS?

That you need the UPS to signal to your PC that it is now on battery backup and initiate an orderly record and shutdown?

 

0 Kudos
Message 4 of 8
(2,511 Views)

Chris - RavensFan is correct. We need to know what series of events need to take place in order to assist you.

0 Kudos
Message 5 of 8
(2,505 Views)

Oh, the problem is such: I want to know if there is a way to record the data if everything in the system fails; just for peace of mind. Say the cRIO UPS loses power, the backup battery fails and the FPGA loses connection to the computer without recording the data. This is simply just a final box to check that if worst thing that can happen comes to pass, and everything but the computer fails, is there a way to record the data? The computer and cRIO are on their own unique UPS's. A better question I should have asked is: is there a way to receive a boolean value from the FPGA source if it times out or becomes disconnected by some accidental incident?

 

I appreciate all the feedback as well!

0 Kudos
Message 6 of 8
(2,500 Views)

Or something other than a boolean value, just is there a way to have a value be returned if the FPGA times out or becomes disconnected?

0 Kudos
Message 7 of 8
(2,495 Views)

You're talking about PC power failure, FPGA power failure, breakdown in network  (network router power failure?)  You can't protect against everything.  You can try to by putting all of those on the UPS.  but then you talk about a UPS failure.

 

Note that if the UPS can connect to your PC, there is LabVIEW code that can monitor the state of your UPS.   I have a VI located in this message https://forums.ni.com/t5/LabVIEW/How-to-monitor-a-UPS-by-serial-port/m-p/3318622#M972401, but the original link that I got this VI from seems to be broken.

 

You can make sure your devices sent a periodic message to say "I'm here".  If a device doesn't get a message in a finite amount of time, that would be the signal that it is time to do something like save data and shutdown.

 

But if you just bothered to save data often enough, a lot of this is probably unnecessary.

0 Kudos
Message 8 of 8
(2,491 Views)