Hello Guest it is April 24, 2024, 01:36:46 AM

Author Topic: Live counter Brain  (Read 686 times)

0 Members and 1 Guest are viewing this topic.

Live counter Brain
« on: January 10, 2022, 01:38:02 PM »
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
Re: Live counter Brain
« Reply #1 on: January 15, 2022, 01:47:45 PM »
Hi,

Got it fixed, keept the macro with a few adjustments, just made a brain timer that the macro reset at a time I want.

Regards Morten