Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: sgsims on August 26, 2016, 09:17:47 AM
-
I seem to recall some rules for placing a CTR instruction inside of a stage. Also is it bad practice to use the timer.done bit on the reset leg of the same timer? I'm doing both of these things inside of a stage and things are not working as I intend.
-
I seem to recall some rules for placing a CTR instruction inside of a stage.
Do you mean TMR? or are you talking about CTRIO instructions?
Also is it bad practice to use the timer.done bit on the reset leg of the same timer?
This is perfectly fine. The other option is to use the RSTT instruction if that is cleaner for you.
-
Sorry I meant CNT
-
From the help topic:
Termination Scan Behavior:
If the Up Counter instruction is contained within a Program, a Task, or a Stage, the Up Counter will automatically be reset during the termination scan of that Program, Task, or Stage.
Refer to the Help topic on Termination Behavior for detailed information on the programming elements that have termination logic.
-
I think my issue had more to do with how to get the Edge Triggered behavior of the CNT Inst to work with my application rather than the fact that is was located in a stage and the .done bit toggling the RST leg of the timer.
I think I should really be looking at using the INC instruction for my application since it is Power flow based. A subtle but important difference that I overlooked.
-
I think my issue had more to do with how to get the Edge Triggered behavior of the CNT Inst to work with my application rather than the fact that is was located in a stage and the .done bit toggling the RST leg of the timer.
I think I should really be looking at using the INC instruction for my application since it is Power flow based. A subtle but important difference that I overlooked.
I frequently use INCs with edge contacts for simple stage or event counting.