PIW 256 is the hardware address of the Encoder mounted on the travel drive of a machine.
What are the possible ways to detect if this Encoder is not generating any signals (like a warning display on the HMI that Encoder is not responding to the movement of the machine).
Can we check and compare DB10.DBD26 in OB35?
Or what are the ways, by programming, you can keep a watch on this Encoder's count PIW 256 or DB10.DBD26 and stop the machine if the encoder has stopped working during machine movement?
Do you have another inputs that would indicate movement.
i.e. a proximity switch or something else like a sensor.
Then check each cycle of the machine that the encoder is within a certain range that is appropriate.
i.e. when proxi on PIW is 2000 to 3000 and when other sensor is on PIW is 4000 to 4500 if one of these is wrong then machine alarm and warn PIW not changing.
Assuming that DB10.DBD30 is the speed reference (theorical reference), I compare such reference with the actual value. If the diference is higher than the threshold longer than 100 ms (filter), then I stop the machine and show speed error alarm on the OP.
A Q 3.2 "MACHINE LIFTING
FP M 6.1
R M 6.0 "ENCODER ALARM"
JU P1
P1: A Q 3.2 "MACHINE LIFTING"
JCN P2
L "DATA B".encoder_value "ACTUAL ENCODER VALUE"
L "DATA B".cyclic_check "PREVIOUS STORED ENCODER VALUE "
<>D
JC K1
S M 6.0 "ENCODER ALARM"
BE
K1: L "DATA B".encoder_value "ACTUAL ENCODER VALUE"
T "DATA B".cyclic_check "PREVIOUS STORED ENCODER VALUE "
P2: NOP 0
Please advice if this idea is ok to compare the actual encoder counts with the value stored in OB35 100ms ago?
There will be always a difference, it is almost impossible to get the same number of pulses, that's why is better to compare and introduce a window error