Hello Guest it is April 29, 2024, 01:03:52 PM

Author Topic: Start timer from M function  (Read 348 times)

0 Members and 1 Guest are viewing this topic.

Start timer from M function
« on: February 21, 2023, 07:26:02 PM »
i have several timers on mine mach screen
like run the grease pump,blink output light.... etc
some times i need activate one timer from other timer(like service that need for some second each.. several hours)
this all its work
but when itry to START the scr object from m function its not work
i try also the way to activate any input ....then this input rise event...
this can work but many many bugs because event not always timing as you want
especially when i work with 2 kind of command ,like button and pedal ,so bug become too much


GOOMBA

*
Re: Start timer from M function
« Reply #1 on: February 22, 2023, 08:37:39 AM »
The screen and M codes don't mix well, they don't like to talk.
So you should use the macro to change the value of a register AKA a "Flag"
Then using the PLC script or a timer, you can scan for this flag (change of register value) and trigger the timer via a scripted function in the screen (or a module if you're savvy)
There are lots of ways to do this however you need a way to communicate from a macro, to the screen.
A flag of some nature, an output or register typically. (If you use an output you can use the signal script in the screen.)

You also don't change the state of inputs, you change the state of outputs.
Changing the state of an input.... would make it an output?
I've had this discussion with Brian before as I've attempted to change input states as well and.... let's just say he told me not to do that and laughed at me :)
Send a ticket into support if you need to!