Code Generation Option for Non Template Axes

Generate POU Instances Option

With the Add Axis dialog, you can create a program and call the axis instance and its corresponding task automatically.

Step

Action

1

For Node type, select Non  Template.

2

For Generate POU instance, select Yes.

G-SE-0078406.1.gif-high.gif

 

 

Generated POUs

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

oA call program SR_Call_<Axis Name> (PRG) is added to your project.

G-SE-0078447.1.png

oA corresponding task TASK_SR_Call_<Axis Name> is added to your project.

G-SE-0078448.1.png

oThe POU call of the call program SR_Call_<Axis Name> (PRG) within the task is added to your project.

G-SE-0078446.1.png

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

NOTE: Once an axis 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 Axis in Your Program.

Trigger for Program Call Regeneration

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

G-SE-0078436.1.gif-high.gif

 

 

For details, refer to Data Exchange with ModuleInterface.

Regeneration Trigger

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

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

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

oCall of axis is adapted because of adding / deleting variables (2).

G-SE-0078442.1.gif-high.gif

 

 

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

Additional user-specific variables

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

G-SE-0078443.1.png

 

 

Additional user-specific code

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

oBefore the generated code part (1) or

oAfter the generated code part (2)

G-SE-0078440.1.gif-high.gif

 

 

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.

G-SE-0078438.1.png

 

 

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

G-SE-0078439.1.png