Supported platforms: CODESYS 3.5, CODESYS 3.5 SAFETY
This function block is used by all loader function blocks. It handles sending of given file to given SDO index of target node.
The function block can also send a file to given node using Write File To PLC -protocol.
Typically application does not need to use this POU unless custom action sequence is made. Platform specific loader POUs should be used primarily. |
It is possible to load a wrong or corrupted application binary to the target unit. This library does not validate the binary. |
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 absolute path |
i_pSequence |
POINTER TO INT |
|
Action sequence to use |
i_NumberOfSteps |
BYTE |
Number of recipe lines |
|
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: |
|
FUNCTION_BLOCK LoadApplication VAR_INPUT i_Enable: BOOL; (* Triggers download *) i_pDevice: POINTER TO EPEC_CANopen.Device; (* Used CANopen device *) i_NodeID: BYTE; (* Node ID of the control unit *) i_File: STRING(255); (* File name and absolute path *) i_UseBlockTransfer:BOOL; (* Use SDO block download transfer *) END_VAR VAR_OUTPUT o_State: ApplicationState; (* State *) o_AbortCode: DWORD; (* Abort code *) o_Progress: BYTE; (* Progress percent *)
END_VAR VAR Loader:EngineSDO;
END_VAR
|
|
|
|
|
Code: |
|
Loader( i_Enable:=i_Enable, i_pDevice:=i_pDevice, i_NodeID:=i_NodeID, i_File:=i_File, i_pSequence:=ADR(G_ActionSequences.LoadApplicationSequence), i_NumberOfSteps:=G_ActionSequences.LoadApplicationSteps, i_UseBlockTransfer:=i_UseBlockTransfer );
o_State:=Loader.o_State; o_AbortCode:=Loader.o_AbortCode; o_Progress:=Loader.o_Progress;
|
|
|
-
Source file topic100513.htm
Last updated 21-Feb-2025