Project level services

Below are the main services to manage the target project.

Opening the target project:

paCreateProject - Create the target project
paCreateProjectFromTemplate - create the target project using a template
paOpenProject - Open the target project for modification

Setting project level information:

paSetProjectComment - Set the description for title bar
paSetOption - Set a project option
paAddLibrary - Add a link to a library

Below are details about these functions:

paCreateProject - Create the target project

OK := paCreateProject ()

Parameters:

OK : BOOL; True if successful

Description:

This function creates the target project as an empty project. The destination folder should not exist yet. This function is typically called in a script that creates the skeleton of a new project.

You should call this function at the beginning of your script before any other declaration or creation function. Your script should terminate if this function returns FALSE.

Example:

    // at the beginning of the script:
    if not paCreateProject () then
        return;
    end_if;
    // ...

other functions

paCreateProjectFromTemplate - Create the target project from a template

OK := paCreateProjectFromTemplate (TEMPLATE)

Parameters:

TEMPLATE : STRING; Name of a template projects
OK : BOOL; True if successful

Description:

This function creates the target project as a copy of a template project. The destination folder should not exist yet. This function is typically called in a script that creates the skeleton of a new project.

Template projects are located under the "TEMPLATE\" folder of the installed Workbench. the "TEMPLATE" parameter specifies only the name of the template project, and does not include its path.

You should call this function at the beginning of your script before any other declaration or creation function. Your script should terminate if this function returns FALSE.

Example:

    // at the beginning of the script:
    if not paCreateProjectFromTemplate ('MyTemplate') then
        return;
    end_if;
    // ...

other functions

paOpenProject - Open the target project for modification

OK := paOpenProject (CREATE)

Parameters:

CREATE : BOOL; if TRUE, creates the project if not existing yet
OK : BOOL; True if successful

Description:

This function opens the target project as an empty project. If the "CREATE" parameter is FALSE, the project must exist. If "CREATE" is TRUE and the project does not exist yet, then it is created.

You should call this function at the beginning of your script before any other declaration or creation function. Your script should terminate if this function returns FALSE.

Example:

    // ensure that the target project already exists
    if not paOpenProject (FALSE) then
        return;
    end_if;
    // ...

other functions

paSetProjectComment - Change the description of the target project

OK := paSetProjectComment (COMM)

Parameters:

COMM : STRING; Project descriptionl
OK : BOOL; True if successful

Description:

This function sets the comment text used for describing the project. This text is displayed in the title bar of the Workbench when the project is open.

Note that in case of a "new project" wizard, a comment text has already been entered by the user.

Example:

    // after opening or creating the target project
    paSetProjectComment ('Project generated by script')

other functions

paSetOption - Set a project option

OK := paSetOption (OPTION, VALUE)

Parameters:

OPTION : STRING; Option namel
VALUE : STRING; Value of the option
OK : BOOL; True if successful

Description:

This function sets an option in the project settings. The following options are available:

name value description

TARGET

T5RTM / T5RTI

Type of target runtime

DEBUG

ON / OFF

Compile in Debug mode

CTSEG

ON / OFF

Complex variables in a separate segments

FBDFLOW

ON / OFF

Color FBD lines during debug

EMBEDSYMBOLS

ON / OFF

Embed all variable symbols

EMBEDSYBCASE

ON / OFF

Keep case of embedded symbols

WARNING

ON / OFF

Display warning messages

SFCSAFE

ON / OFF

Check SFC charts safety

SPCLEAN

ON / OFF

Remove code of uncalled sub-programs

IECCHECK

ON / OFF

Check conformity to IEC standard

SAFEARRAY

ON / OFF

Check array bounds at runtime

LARGEJUMP

ON / OFF

Allow large jump instructions

LOCK

IO / ALL / NONE

Range of lockable variables

PASSWORD

number

Password for connection

other functions

paAddLibrary - Add a link to a library

OK := paAddLibrary (PATH)

Parameters:

PATH : STRING; Full qualified pathname of the library folder
OK : BOOL; True if successful

Description:

This function adds a link to a library for the target project.

other functions