Sign in to follow this  
Followers 0
larry818

Logging power off?

8 posts in this topic

Hi, Is there a way to log when the power goes off? What I've got is a FX2N with F940GOT that has the alarm history function. I log in alarm history any fault condition, but for my system, a power off is also considered a fault (usually caused by the maintenance personnel). Since both the plc and ts stay self powered for a bit when the line power is cut, I'm hoping that there's a way to do this. I've tried the obvious stuff... Thanks!

Share this post


Link to post
Share on other sites
It's possible with monitoring of M8007 special bit (at least it's tested with FX3U).

Share this post


Link to post
Share on other sites
I am thinking right from the top of my head now But the FX2n has a real time clock that continues running after a power off. You could run a routine that checks the time once a second and if the expected time is correct then - no power off If the expected time is greater than expected (ie after a power off) then calculate the difference and not only do you have a power off result but also how long it was off

Share this post


Link to post
Share on other sites
I've experimented with m8007 and m8008. I think the problem is that the plc sets the m8008 bit for less than 10ms, while the got needs a minimum of 600ms to notice it. It's not even reliably monitor on the pc. Sometimes it see it, sometimes not. I'll try the RTC route. I need to start using it in any case for the astronomic lighting function I'm planning. Thanks! L

Share this post


Link to post
Share on other sites
Naturally, the HMI is unable to monitor PLC devices for the time until it stop, but this is enough to analize the M8007 bit in the controller. In such systems, the log should be implemented in the controller, and after PLC will be powered the log can be viewed with any operator panel or read onto the SCADA level. And indeed a bit strange when the HMI is working, while the controller has stopped, because operator control panel is an auxiliary part of the automation system ...

Share this post


Link to post
Share on other sites
Oddly, the PLC does scan at least once after the power fails, and that data is, sometimes, readable on the programming software. The GOT also takes a while to power down, but it's just too slow to do anything in that short time. Unfortunately, as I was coding the rtc version, I realized that there is no way (or no non-insane way) to get the power fail time into the alarm history. So, I settled on latching a relay with M8008 and just logging it as a "power failure cleared" and allow the alarm history function to log the time the power comes back. It's not ideal, but it is easy and at least I know there was a power failure.

Share this post


Link to post
Share on other sites
Typically in such systems requires not just discover that there was a power failure, but also put a time stamp when the power failure has occurred and when power supply was restored again. But besides the loss of power, there is another situation that usually need to fix, it is a transition of the controller to stop mode... As already mentioned, we implemented the control of a power failure by analyzing of M8007 special bit (and not M8008). Equipment, which we made, should have been run after power is restored, if prior to his disappearance it was run. All information about the duration of loss of power has being recorded in the log.

Share this post


Link to post
Share on other sites
Thinking outside the box: You could add a power filter transformer or UPS in front of the PLC and HMI, to give you a little more time after power-loss on the main machine. Then you could put in a device to monitor machine power. If you lose machine power, you'll have enough uptime to log the failure before the PLC/HMI goes down. Alternatively, you could add the transformer/UPS to only the HMI, and log a communications loss to the PLC as a power-loss event. Obviously, this would also catch comm-wire breaks and such as power-loss, but might be easier.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0