Code Generation Option for Non Template Conveyors

Generate POU Instances Option

With the Add Conveyor dialog box, you can create a program and call the conveyor instance and its corresponding task automatically.

Adding a new Non Template conveyor node with code generation:

Step

Action

1

For Node type, select Non Template.

2

For Generate POU instance, select Yes.

Generated POUs

If you select the Generate POU instances option, the three following elements are added to your project:

  • A call program SR_Call_<Conveyor Name> (PRG) is added to your project.
  • A corresponding task TASK_SR_Call_<Conveyor Name> is added to your project.
  • The POU call of the call program SR_Call_<Conveyor Name> (PRG) within the task is added to your project.

After the automatic generation procedure by the system, the project can be built and downloaded to the controller.

NOTE: Once a conveyor node has been added to the Module structure, the node type cannot be modified. For further information about using the code generation option, refer to chapter Call Conveyor in Your Program.

Trigger for Program Call Regeneration

The most efficient way to exchange data with the conveyor is via ModuleInterface.

For details, refer to Data Exchange with ModuleInterface.

Regeneration Trigger

If you added / deleted variables within the ModuleInterface dialog box and then entered the Configuration data object under <Conveyor Name>, the call program SR_Call_<Conveyor Name> (PRG) is regenerated with the modified ModuleInterface variables.

The regeneration procedure implies the following for the program SR_Call_<Conveyor Name> (PRG):

  • Variable declaration is adapted because of adding / deleting variables (1).

  • Call of conveyor is adapted because of adding / deleting variables (2).

Adding User-Specific Code to the SR_Call_<Conveyor Name> Program

Additional user-specific variables

Define additional user-specific variables in the declaration part of the SR_Call <Conveyor Name> program:

Additional user-specific code

Only integrate additional user-specific code in the body of the generated program call at the following positions:

  • Before the generated code part (1) or

  • After the generated code part (2)

Restrictions Regarding Program Call Regeneration

Do not modify the system generated declaration and implementation of the code snippets.

This is essential for program call regeneration of the generated code.

Do not modify this generated variables block.

Do not modify this generated body block (including the two comment lines).