Creating a New Recurring Task
In this section of the lab, you will create a new recurring task that we will then use to schedule the execution of a new program. At this point, you should be online with your controller. Make sure the controller is in Program mode.
1.In Controller Organizer, Right-click on the icon Tasks
and choose New Task.
The New Task dialog box appears.

2.In the field Name, type 'Task2'.
3.In the field Description, type 'This task is similar to an STI in a PLC-5.' ('This task is similar to an STI in a PLC-5')
4.In the field Type (Type), make sure that Periodic is selected.
5.In the field Rate (Proportion), Enter '1000' milliseconds (milliseconds) (1 second); leave the other parameters set to their default values.
6. Click on OK to create the task.
Task2 now appears in Controller Organizer. The Task2 folder icon includes a small clock, indicating that it is a recurring, time-based task.
Creating a New Program
1.In Controller Organizer, Right-click on the icon Task2
and choose New Program.
The New Program dialog box appears.

2.In the field Name, type 'Program2'.
3.In the field Schedule In, make sure that Task2 select it and click on OK.
You have now created a new program under Task2. All routines created and named under this program folder will run every 1000 milliseconds (or once per second).
Note also that under Program2 in Controller Organizer, there is now an object called Program Tags. All program-scoped tags are stored under this name; any tags stored here are accessible to Program2 and all its routines, but not by other programs in the controller.
Creating a New Routine
In this section of the lab, you will create a new routine under the Program2 folder.
1.In Controller Organizer, click on the sign + To expand it, right-click on the item located in front of Task2. Program2 and choose New Routine .
The dialogue "New Routine" appears.

2.In the field Name, type 'Routine2'.
3.In the field Description, type 'This routine will increment a counter each time the routine is executed.' ('This routine will increment a counter each time the routine is executed').
4.In the field Type, make sure that Ladder Diagram is selected.
5.In the field In Program, make sure that Program2 select it and click on OK.
The next thing you need to do is assign a routine to be the MainRoutine for Program2.
6.In Controller Organizer, Right-click on the icon Program2 and choose Properties.
The Program Properties dialog box appears, with the General tab selected.

7. Click on the Configuration tab to display the routines assigned to Program2.

8. In the Main menu (with drop-down menu), choose Routine2 and click OK.
This makes Routine2 the main routine for Program2.
Creating a Selection of Counters
In this section of the lab, you will create a selection of counters that you can then use in the rest of your routines.
1.In Controller Organizer, Double-click the icon Controller Tags
to open Data Monitor.

2. Click on the capo Edit Tags (Edit Caps) at the bottom of the window to open the Tag Editor.

3.Under the column Tag Name (Column Name), Click on the row next to the button
and type 'C5' as the label name.
4. Press the key Capo until your cursor appears in the column Type.
5. Click on the button
, Choose a data type from COUNTER.
6.In the field Dim 0 , Click the up arrow until a value of 10 be shown and click on OK.
7. Press the key Enter to accept the label.
8. Click on the sign + that is in front of the label name C5 to display the selection of 10 counters that you created.
9. Click on the sign + that is in front of the label name C5[0] to display all members in the counter structure (label) associated with counter C5[0].
10. Click on the X which is in the upper right corner of Tag Editor to close the Controller Tags window.
Help us grow
Finally, if you are determined to learn Industrial Automation and advance your professional career, you may be interested in our Premium courses:
– Click to see all our courses at MyAutomationClass.com
- Course: «"Become a PLC expert in 60 days, from basic to pro"»
- Course: «"PID Controllers Master Class – 100% practical"»
- Course: «"How to create SCADA/HMI projects from scratch with InTouch"»
- Course: «"PID Tuning Ultimate: The Definitive Course for Tuning"»
- Course: «"Practical Process Modeling: Definitive Steps to Becoming an Expert"»
- Program: «"The Ultimate Process Control Formula" (All-inclusive: PID Control, Tuning, and Modeling)
- Course: How to Learn Industrial Instrumentation, Easily (Complete)
If you have any questions, contact us via Facebook Messenger
Until next time. COMMENT AND SHARE! I'll be happy to answer your questions.

