Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: PLCwannabe on January 12, 2022, 09:27:26 PM

Title: Stage Programming
Post by: PLCwannabe on January 12, 2022, 09:27:26 PM
I need to set up a program with multiple stages with each new stage needing to calculate with values that were just calculated in the previous stage. Are the results in stages updated immediately, before the next stage starts?
Title: Re: Stage Programming
Post by: franji1 on January 12, 2022, 09:48:16 PM
All logic in an active/enabled stage run every scan until it is disabled, either via JMP, a SGRST.  So if the stage is active, it will continue to be "calculated" just like all logic.

Realize there are instructions like Timers and Out coils that have termination logic, so those timers will reset and out coils will reset when you JMP out of stages that have those in them - but you used the word "calculate" - not OUT coil, so you are fine.
Title: Re: Stage Programming
Post by: ADC Product Engineer on January 13, 2022, 09:48:31 AM
Stages are not subroutines.  They are program segments that are enabled/disabled by a master bit and run inline as they are entered into the program regardless of the bit number.  If the bit, let's say S0 for example, is true then the stage will run.  If it is false the stage will execute termination behavior the first time after the transition and then be inactive until the bit goes true again.