Supported platforms: CODESYS 2.3, CODESYS 3.5
FUNCTION block writes SDO indices and PDO mappings TO remote nodes. Block operation starts on rising edge of i_Enable. Boolean variable i_Enable has to be kept TRUE through the whole operation. An instance of NM_ConfigureSlavePDOs is needed for each CANopen slave.
Function sets configuration to slave node with a sequence: SDO, TPDO and last RPDO. When i_Enable rises, whole sequence is reset and all status are cleared on all the configuration arrays (SDO, TPDO and RPDO).
|
Each slave must have it's own instance of this function block. Because of that, all slaves can be configured simultaneously. |
|
This function is for library's internal use only. Function block is called with i_Enable false (reset) from NM_NetworkManager, when slave is "init" state. After that on "preoperational" state it execute configuration sequence with i_Enable true. |
Input variable name |
Data type |
Range |
Description |
i_Enable |
BOOL |
TRUE/FALSE |
Rising edge starts the operation. The operation stops if i_Enable is set to FALSE |
i_NodeID |
BYTE |
1...127 |
Node ID of device to monitor/manage. |
i_pSDOConfigureList |
POINTER TO NM_SlaveODConfiguration |
|
Pointer to the beginning of an array of indices to configure |
i_NumberOfODEntries |
WORD |
0...65535 |
Number of indices to configure. |
i_pTPDOConfigureList |
POINTER TO NM_SlavePDOConfiguration |
|
Pointer to the beginning of an array of TPDOs to configure. |
i_pTPDOMappingList |
POINTER TO DWORD |
|
Pointer to the beginning of an array of TPDO mappings |
i_NumberOfTPDOs |
WORD |
0...65535 |
Number of PDOs to configure. |
i_pRPDOConfigureList |
POINTER TO NM_SlavePDOConfiguration |
|
Pointer to the beginning of an array of RPDOs to configure. |
i_pRPDOMappingList |
POINTER TO DWORD |
|
Pointer to the beginning of an array of RPDO mappings |
i_NumberOfRPDOs |
WORD |
0...65535 |
Number of PDOs to configure. |
i_Channel |
BYTE |
|
Number of CAN bus to monitor/manage. |
i_Retries |
BYTE |
0...254 |
Number of retries in case of SDO timeout |
i_Timeout |
TIME |
|
Timeout time of the SDO transfer |
Input variable name |
Data type |
Range |
Description |
i_Enable |
BOOL |
TRUE/FALSE |
Rising edge starts the operation. The operation stops if i_Enable is set to FALSE |
i_NodeID |
BYTE |
1...127 |
Node ID of device to monitor/manage. |
i_pSDOConfigureList |
POINTER TO NM_SlaveODConfiguration |
|
Pointer to the beginning of an array of indices to configure |
i_NumberOfODEntries |
WORD |
0...65535 |
Number of indices to configure. |
i_pTPDOConfigureList |
POINTER TO NM_SlavePDOConfiguration |
|
Pointer to the beginning of an array of TPDOs to configure. |
i_pTPDOMappingList |
POINTER TO DWORD |
|
Pointer to the beginning of an array of TPDO mappings |
i_NumberOfTPDOs |
WORD |
0...65535 |
Number of PDOs to configure. |
i_pRPDOConfigureList |
POINTER TO NM_SlavePDOConfiguration |
|
Pointer to the beginning of an array of RPDOs to configure. |
i_pRPDOMappingList |
POINTER TO DWORD |
|
Pointer to the beginning of an array of RPDO mappings |
i_NumberOfRPDOs |
WORD |
0...65535 |
Number of PDOs to configure. |
i_CanChannel |
CANVXD_API.ICANVXD |
|
CAN channel interface. |
i_Retries |
BYTE |
0...254 |
Number of retries in case of SDO timeout |
i_Timeout |
TIME |
|
Timeout time of the SDO transfer |
Output variable name |
Data type |
Range |
Description |
o_Configured |
BOOL |
FALSE/TRUE |
TRUE when the operation is finished. Otherwise FALSE |
o_Progress |
WORD |
1..i_NumberOf |
Indicates the array index which is currently being processed. Reaches i_NumberOfEntries when the operation is done |
o_StatusIndex |
INT |
-1..2 |
Status of current SDO transfer: -1=Fault, 0=Not started, 1=Busy, 2=Done |
o_SdoIndexWithFault |
WORD |
|
In case of an error, indicates which array index caused the error |
o_StepWithFault |
BYTE |
|
In case of an error, indicates the step which caused the error: 0 = Disable PDO 1 = Set number of mappings to 0 2 = Write mappings 3 = Set number of mappings 4 = Set transmission type 5 = Set inhibit time (TPDO only) 6 = Set event time (TPDO only) 7 = Set PDO COB-ID |
Source file Topic000643.htm
Last updated 4-Sep-2025