• Not Answered

SFC: Set and Reset a Variable in the same Step.

Dear Engineers,

I want to set a variable on true while the step is active or at first scan, and set it to false on step deactivation.

Which is the best way to achieve that.

Thanks for help.

Have a nice week end!

4 Replies

  • The best way to achieve this behavior is to:

    Use step actions to set the variable to True when the step is active.
    Use transition actions to set the variable to False when the step is deactivated or when the transition occurs.
  • Often in these cases, I end up using a Stored and Time Limited (SL) qualifier to set a parameter, but its dependent on the timing of your steps and transitions.

    SL qualifiers are nice because they're essentially a "set it and forget it" solution because once the time is exceeded the parameter reverts automatically back to false.
  • The step itself has a .ACTIVE parameter to show when the step is active, you could just use that.
  • In reply to KeithStThomas:

    Thank you all for your replies.