Supported platforms: CODESYS 3.5, CODESYS 3.5 SAFETY
This function block loads CODESYS 3.5 application binary to SC52, SL84 and EC44 units.
|
It is possible to load wrong or corrupted application binary to target unit. This library does not validate the binary. |
|
Output o_State should change to Processing when i_Enable is set TRUE. When process is finished (i.e. o_Progress reaches 100%), the o_State output changes back to Idle. |
|
If calling of function block is stopped before o_State changes to Idle, it may lead to missing or faulty target application. |
|
SW protection needs to be unlocked before loading binaries by using UnlockProtectionSSeries (FB) |
|
Control unit reboot is required after SW update. |
Input variable name |
Data type |
Range |
Description |
i_Enable |
BOOL |
|
Action trigger. |
i_pDevice |
POINTER TO EPEC_CANopen.Device |
|
Used CANopen device (e.g. ADR(G_CANopen_CAN1.Device)). |
i_NodeID |
BYTE |
1..127 |
CODESYS (Runtime) Node ID of target unit. |
i_File |
STRING(255) |
File name and path. |
|
i_UseBlockTransfer |
BOOL |
Use SDO block transfer which is faster than normal SDO download. |
Output variable name |
Data type |
Range |
Description |
o_State |
ApplicationState |
|
Process state |
o_AbortCode |
DWORD |
|
CANopen abort code |
o_Progress |
BYTE |
0..100 |
Progress indication value |
Definitions: |
|
VAR loaderSC52App: EPEC_SWD.LoadApplicationSSeries; applicationLoadTrigger: BOOL; codesysNodeID: BYTE := BYTE#127; app_file: STRING(80) := '/opt/user/userapp/example.app'; useBlockTransfer: BOOL := TRUE; loadingstate: EPEC_SWD.ApplicationState; abortCode: DWORD; progress:BYTE; END_VAR |
|
|
Code: |
|
loaderSC52App( i_Enable := applicationLoadTrigger, i_pDevice := ADR(G_CANopen_CAN1.Device), // From code template i_NodeID := codesysNodeID, i_File := app_file, i_UseBlockTransfer := useBlockTransfer, o_State => loadingstate, o_AbortCode => abortCode, o_Progress => progress ); |
EngineSDO (FB)
LoadAllUnits (FB)
Source file topic100509.htm
Last updated 21-Feb-2025