Power loss flexy 205 - set all tags to 0

How is it possible to set all tags to 0 when the power is lost in the flexy 205?
I have a monitoring system in a equipment but when the flexy 205 lose power, it only detects that the equipment is stopped when the power is reset and the flexy reads all the actual values of the tags.
Example:
Tag - motor_On
Start time 08:00
Power lost 09:00
Power restart 10:00
Duration On - 2:00
If it is possiblem to set the tag to 0 at 09:00, correct duration On should be 1:00.

Hello joniregalado,

Welcome to hms.how!

How do you Calculate “Duration On”?
Or were/how exactly do you read that out?

The Flexy only makes requests to actualize the Tag Values each poll cycle time.
If there are Problems with a Tag you can tag a look at the Tag quality or the Status of the PLC/IO Server to check if there are still answered to the polling or not.

In the following there are some examples how to incorporate that in your calculation.

This is a KB Document on Tag quality:

Here is a short forum entry with a Code example:
https://techforum.ewon.biz/thread-1371.html

Alternativly there is also a ‘Status’ that can be added as a Tag:
https://techforum.ewon.biz/thread-876.html
There should be more information on that in your IOServer manual.

I hope this helps a bit to get the information you need.

br
Franziska

Hello Franziska
Thank you for your reply.

The “Duration On” is calculated in a external software that read a database created with the logs imported from the flexy. Our problem is that if any tag is On and there is a power failure in the flexy, the tag will remain On until the flex reboots and read the actual value of the tag. If there is a possibility to set all the tags to 0 in the timestamp that the power failure occured it would solve our problem.
When the flexy reboot it would check the last data logging and create a same timestamp with all the tag values = 0.

If you create a Status Tag, the external software can monitor the Status and use that information.

Alternatively if the Software is not able to use the value from a different tag,
You could try writing a script that monitors the Status tag in the Flexy,
and then set Tags of your choosing (maybe also check the quality of the Tag each) and if the quality is bad set the Value of the Tag to the Value of your choosing.

br
Franziska