
adccommunitymod (AutomationDirect) asked a question.
Do-More INIT
Created Date: December 19,2013
Created By: JDemsey
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
I wanted to put the INIT element in a ladder run in a Ladder Program to clean up the Main and do general initialization and math. I ran the INIT with the TS4 contact (fires once per second) but could not set the Vs or the DOs. The INIT worked fine in the Main ladder section. Is the Main the only place it will work?
Created Date: December 19,2013
Created by: Do-more PE
As far as I am aware INIT should work in any Program or Task.
I would imagine that the issue is the ST4. It is not a one shot contact. It has a 1/2 second on and 1/2 second off duration. So while it is on, it will reset the values every time the INIT instruction is processed in the scan.
Created Date: December 19,2013
Created by: franji1
I would recommend putting logic that only needs to run 1 scan once a second inside the predefined SYSTEM TASK $t1Second. If you stuck the INIT in the system task, it would automatically run without the need of an ENTASK instruction in $Main.
User created TASKs require an ENTASK from the "enabling " code block (typically $Main). System Tasks are automatically fired and hence do not need a corresponding ENTASK instruction.
See the attached screen shot for the list of possible System Tasks. To add one to your project, make sure you are in Edit Mode (Ctrl+E), expand the Unused System Tasks group in the Project Browser's Control Logic root node. Right click on the specific one you want to use and select "Use System Task "
Created Date: December 20,2013
Created by: LWgreys
I see what is happening. It's a bug in the editor, if you ask me.
When you select a V from the Element Browser it turns on the Start green indicator on but the End indicator is still RED which is an invalid entry for END.
Work around: after selecting the V location from the Element Browser, select the Start and press Enter Key again to get the End green valid input to turn ON.
OR
just type in the V location directly in to Start and press the Enter key.
Created Date: December 19,2013
Created by: JDemsey
I wanted to put the INIT element in a ladder run in a Ladder Program to clean up the Main and do general initialization and math. I ran the INIT with the TS4 contact (fires once per second) but could not set the Vs or the DOs.
The INIT worked fine in the Main ladder section. Is the Main the only place it will work?