Creating a Program Instance by Assigning a Program to a Task
This topic only applies to the non-safety-related controller.
Refer to the topic "Safety PLC Runtime Configuration" for information on the safety-related task/program instance.
Note
In debug mode, the controller Cockpit shows the utilization of each controller core (each represented by one ESM in PLCnext Engineer) besides the total controller utilization. Use this information during commissioning of your application to optimize the distribution of program instances to the available cores. |
- Method 1: by entering an instance name in the table and then selecting the program type.
- Method 2: by dragging & dropping a program type (POU) from the COMPONENTS area into the table.
- In the PLANT (in programming mode), double-click the 'PLCnext' node.
- In the 'Tasks and Events' editor, locate the task to which a program instance is to be added (Cyclic100 (1) in the example below). Already existing program instances (programs that already assigned to the task) are shown as child elements of the task.
Enter a program instance name into the 'Name' field. - Left-click into the 'Program Type' field (Select program type here). The Role Picker appears (2 in the example below). The tree on the left shows the structure of the program POUs as organized in the 'Programs' folder (COMPONENTS area). On the right, the available program POUs are provided for selection.If program POUs are available in any included libraries, these are also provided for selection in the Role Picker. This includes:
- User-defined IEC 61131-3 libraries (which have been exported from another PLCnext Engineer project).
- IEC 61131-3 firmware libraries provided by a device manufacturer.
- PLCnext Technology
component libraries containing non-IEC 61131-3 program POUs.
See also topic "Integrating non-IEC 61131-3 programs into the PLCnext Technology task scheduling".
- Select a folder in the tree on the left and then the program POU on the right by clicking it or pressing the <Enter> key.Use the following keys to navigate in the Role Picker:
Press the shortcut ... ... to ... <Tab>/<Shift> + <Tab> switch between the folders on the left and the entries on the right. <ArrowDown>/<ArrowUp> move the cursor down/up. <Enter>
(focus on the right side)select the currently marked entry, close the selection control and apply the entry to the table field. <ArrowRight>/<ArrowLeft>
(focus on the left side)expand/collapse the currently marked folder on the left.
Method 2:
Drag the program POU from the COMPONENTS area into the 'Tasks and Events' table and drop the selection on an empty table line below the desired task. The new program instance with a default name is automatically added.