Program trigger, Timing, and change in state

I need to add the following to my code:

a) In the midst of other steps in my program, I need to add a step that will look for a change in the state of one of my discrete inputs from false to true. When this change is seen…
b) The controller will wait 1 minutes (or other time), then execute a move on my axes.

I found the _SysMS tag that I think I have figured out how to execute a timer. Not elegant, but it works. Not so sure about detecting a change in discrete input state, while staying inside the current program. I know I could use a program trigger, but that would force me to jump to another program, and then I’m not sure how I would recover and get my main program to continue controlling my axes. So I basically need a program trigger within the step of my given program. Any ideas of thoughts on how get there?

Note: I’m trying to get access to an additional discrete in, and if I get that then this becomes much easier, as I can just trigger off of that input alone. Regardless, still would like to know how to execute reading a change within a step… :slight_smile:


You can do this by running programs on multiple tasks.

Since you said that another discrete input would solve your problem, it might be fairly easy to do something like this:

  1. Create a program trigger that runs a program on Task 1 (if your main sequence is running on Task 0)
  2. The program waits 60 seconds and then…
  3. The program sets a variable to signal that it is time to make the move
  4. Either with a program trigger or by checking within the original program you then execute the move

Note: On the RMC75E you can have up to 4 programs running simultaneously. Only 2 are shown by default. You can enable the other 2 tasks by right clicking on Programming and clicking Properties. Set the number of User Tasks to 4

The program will look something like this