Templates of programs

Your scripts can contain template documents to be copied in the target project. You can include in your script project templates of POUs (programs, sub-programs  or UDFBs) to be copied in the target project.

Use the following functions in your script to copy a template of POU:

paTplCopySource - Copy the source code
paTplCopyVars - Copy local variables
paTplCopyDefinitions - Copy local definitions
paTplCopyAll - Copy all components of a POU template

You also can define some variable keywords to be replaced when copying templates of POUs.

Below is detialed information about these functions:

paTplCopySource - Copy the source code of a POU template

OK := paTplCopySource (DSTPROG, TEMPLATE)

Parameters:

DSTPROG : STRING; Name of the destination program in the target project (must exist)
TEMPLATE : STRING; Name of the template program in the automation script project
OK TRUE if successful

Description:

This function copies the source code of the specified template from the automation script project to the destination project. The destination program must be declared in the target project

other functions

paTplCopyVars - Copy local variables of a POU template

OK := paTplCopyVars (DSTPROG, TEMPLATE)

Parameters:

DSTPROG : STRING; Name of the destination program in the target project (must exist)
TEMPLATE : STRING; Name of the template program in the automation script project
OK TRUE if successful

Description:

This function copies all local variables of the specified template from the automation script project to the destination project. The destination program must be declared in the target project

other functions

paTplCopyDefinitions - Copy local defiitions of a POU template

OK := paTplCopyDefinitions (DSTPROG, TEMPLATE)

Parameters:

DSTPROG : STRING; Name of the destination program in the target project (must exist)
TEMPLATE : STRING; Name of the template program in the automation script project
OK TRUE if successful

Description:

This function copies all local definitions of the specified template from the automation script project to the destination project. The destination program must be declared in the target project

other functions

paTplCopyAll - Copy a POU template

OK := paTplCopyAll (DSTPROG, TEMPLATE)

Parameters:

DSTPROG : STRING; Name of the destination program in the target project (must exist)
TEMPLATE : STRING; Name of the template program in the automation script project
OK TRUE if successful

Description:

This function copies the specified template from the automation script project to the destination project. The copy includes source code, local variables and local definitions. The destination program must be declared in the target project

other functions