Hi,
I have made a serial-modbus live counter in the macropump code, it reads an external frame counter in an inverter and after a time compare the old and new values, and if equal it triggers an estop and tell modbus com fail, it works, or I believed it did... I have used it for a month and had to extend the time to 1.5 sec. otherwise it would sometime trigger estop in strange situations. this weekend i ran a gcode and had to use "run from here" and when it popup with the preoperational move it triggers my code? If I view the brain where I read the framecounter from, I can see the brain stops reading data when I use "run from here".
So I would like to make a brain that reads the modbus frame value, saves it, a timer and then compare values, and if equal values then trigger an estop. Then it should not trigger when starting "run from here".
I have tried and tried but without luck... Can anybody share a little light on how to make a brain that: read a value, timer, read new value, compare A=B
any help is appreciated.
Regards Morten