Motor Run Time
Hi All,
i need to count the run time of a motor (digital input from the contactor).
whenever this input (motor) is ON, it should count the duration in a real-time manner in HH:MM:SS format.
This must be retentive. Even if PLC is powered ON/OFF, or the motor is turned ON/OFF, the actual run time should not reset. It will reset only through another digital input (pushbutton).
Awaiting ideas for the same.😊
Comments
In continuation to the above query: PLC is AXC F 2152
In a POU instance executed in a cyclic task, get the millisecond count (e.g. using this advice) and calculate the difference from the millisecond count that was read on the last cycle (the delta).
If the "Run" input is on, add the delta to the count variable (probably a retentive unsigned integer).
If the "Reset" input is on, reset the count.
Convert the count value (milliseconds) to whatever time format you need.
When we use counter we will use CV of counter and move to a retain variable. In case Power supply of PLC is off and ON then CV of counter is reset to zero automatically So this case we can not apply when we reset power of PLC. Did you have another method?
Hi k.sophearak@ats.com.kh,
instead of moving the value of CV to a retain variable you add the value to a retain variable:
MotorruntimeRetain := Motorruntimeretain + CV;
So it doesn't matter if CV is set to 0.
BR
DivisionByZero