Dear:

I have the following needs, through system management tools want to do the following:

When operating this machine count the hours within a set time, this time should be 8-hour shift. This we do in a PLC and PLC functions but this has no more available memory and want to take the historian to deliver information THROUGH the ProcessBook. I hope you can help me !!

Assistant picture of what I need and is working on ProcessBook

Best Regards

Ismael

Hi Ismael,

From what I understand, you want to be able to display the time that a machine has been on for the current shift. You should be able to do this by creating 3 performance equations, one to calculate the start of the current shift, a second to calculate how long the machine has been on for the current shift in

seconds, and a third to convert seconds to hh:mm:ss format.Here are the assumptions I have made:

1) You have a tag which has value '1' when the machine is on and '0' when it is off, I will call this tag 'MachineStatus' (you can modify this to have digital state values)

2) Your 8 hour shifts start at 00:00, 08:00 and 16:00 (again you can change these values to suit your needs)

The first performance equation, calculates the start of the current shift is:

StartOfCurrentShift = IF 0<=hour('*')<8 THEN 't' ELSE IF hour('*')< 16 THEN 't+8h' ELSE 'y+16h'

Then we can use the TimeEq() function to calculate the length of time that the machine is on for the current shift.

MachineUpTime_Seconds = TimeEq('MachineStatus', StartOfCurrentShift, '*',1)

Note that TimeEq() will return the time in seconds, so we can use the following PE to convert this to hh:mm:ss format

MachineUpTime_hhmmss = concat(format(int('CDT158_L'/3600),"%2d","I")," h:",format(int('CDT158_L'/60) mod 60,"%02d","I")," m:", format(int('CDT158_L') mod 60,"%002d","I")," s")

You can then display the value of MachineUpTime_hhmmss in processbook to have your counter. Hope that suits your needs!