WriteBootProject (FB)

FUNCTION_BLOCK WriteBootProject EXTENDS AC500_StateMachine.AbbETrig

Function block to permanently load a new boot project. The files for the new boot project have to be available e.g. on the memory card or on the user disk. The required files can be generated by using Automation Builder. They are created on exporting the PLC application (“Boot project and firmware (SD card)…”). After triggering this export they are available in the folder “USERDATA\USERPRG” on the memory card. The files have the suffixes .app and .crc. Both files are required. They may be renamed after the export from Automation Builder, but both names have to be kept identical. Important: After successfully executing this function block a reboot of the PLC is required to start using the new boot project.

InOut:

Scope

Name

Type

Initial

Comment

Inherited from

Input

Execute

BOOL

FALSE

A rising edge starts the operation, the output Busy goes to TRUE. In the first cycle all other inputs are read and stored, afterwards they are ignored. A falling edge does not stop the operation. After Done = TRUE or Error = TRUE and Execute = FALSE all outputs will be reset.

AbbETrig

Output

Done

BOOL

FALSE

Operation is completed without error (while outputs Busy and Error are FALSE). This output is TRUE for at least one cycle or until Execute is set to FALSE

AbbETrig

Busy

BOOL

FALSE

Operation is running (while outputs Done and Error are FALSE)

AbbETrig

Error

BOOL

FALSE

Operation is stopped with error (while outputs Busy and Done are FALSE). This output is TRUE for at least one cycle or until Execute is set to FALSE. The output ErrorID gives more details about the error.

AbbETrig

Input

szName

STRING

Name of the boot project without suffix, e.g. if the file names are “MyApplication.app” and “MyApplication.crc”, szName has to be set to “MyApplication”

szPath

STRING(255)

Path to the folder, where the boot application files are stored, e.g. “$$sdcard$$/some/subfolder” for files on the memory card or “$$userdisk$$/some/subfolder” for files on the user disk or “$$flashdisk$$/some/subfolder” for files on the flash disk (PM5670 only)

Output

ErrorID

ERROR_ID

ERROR_ID.NO_ERROR

Error code that describes the occured error