Own node id ¶ GET_LOCAL_NODE_ID (FunctionBlock)
GET_LOCAL_NODE_ID (FB) ¶ FUNCTION_BLOCK GET_LOCAL_NODE_ID EXTENDS CiA405Base Function block returns the NodeID of the local device (= CANopenManager) InOut: Scope Name Type Initial Comment Inherited from Input NETWORK USINT 1 CAN network number the function block should operate on. Note: It is not the same like the network number in CANBus configurator. The CiA405 NETWORK is calculated by NetID + 1. Example: 1 = CAN0, 2 = CAN1, 3 = CAN2, … CiA405Base ENABLE BOOL FALSE Enables the function block on rising edge. Aborts operation on falling edge. CiA405Base TIMEOUT UDINT 0 Timeout in ms; 0 means no timeout CiA405Base Output CONFIRM BOOL FALSE TRUE : function block finished without error CiA405Base ERROR CANOPEN_KERNEL_ERROR CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_NO_ERROR Error code: see CANOPEN_KERNEL_ERROR for further details CiA405Base DEVICE DEVICE 0 NodeID of local device
Query state ¶ GET_CANOPEN_KERNEL_STATE (FunctionBlock) GET_STATE (FunctionBlock)
GET_CANOPEN_KERNEL_STATE (FB) ¶ FUNCTION_BLOCK GET_CANOPEN_KERNEL_STATE EXTENDS CiA405Base Gets the current state of the CANopen Kernel. As long as CANopen network is running correctly the function block returns CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_NO_ERROR for output STATE . The function block detects bus errors, configuration errors, guarding errors and internal system errors (e.g. out of system memory). InOut: Scope Name Type Initial Comment Inherited from Input NETWORK USINT 1 CAN network number the function block should operate on. Note: It is not the same like the network number in CANBus configurator. The CiA405 NETWORK is calculated by NetID + 1. Example: 1 = CAN0, 2 = CAN1, 3 = CAN2, … CiA405Base ENABLE BOOL FALSE Enables the function block on rising edge. Aborts operation on falling edge. CiA405Base TIMEOUT UDINT 0 Timeout in ms; 0 means no timeout CiA405Base Output CONFIRM BOOL FALSE TRUE : function block finished without error CiA405Base ERROR CANOPEN_KERNEL_ERROR CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_NO_ERROR Error code: see CANOPEN_KERNEL_ERROR for further details CiA405Base STATE CANOPEN_KERNEL_ERROR CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_NO_ERROR Current stack state.
GET_STATE (FB) ¶ FUNCTION_BLOCK GET_STATE EXTENDS CiA405Base Function block returns the CANopen state of device with NodeID DEVICE . The ourput STATE is defined as follows: If guarding/heartbeat is not active for the selected DEVICE : DEVICE_STATE.NOT_AVAIL is returned if DEVICE doesn’t respond in configuration phase. DEVICE_STATE.UNKNOWN is returned in all other cases even if a boot-up message was received. If guarding/heartbeat is not active but at least one cyclic synchronous TPDO is configured for the selected DEVICE : DEVICE_STATE.NOT_AVAIL is returned if DEVICE doesn’t respond in configuration phase. DEVICE_STATE.OPERATIONAL is returned if cyclic synchronous TPDOs are received correctly DEVICE_STATE.UNKNOWN is returned in all other cases. If guarding/heartbeat is active: If there is no guarding/heartbeat error (due to timeout) received NMT state is returned. DEVICE_STATE.NOT_AVAIL is returned if device is not responding or in case of huarding/heartbeat error. InOut: Scope Name Type Initial Comment Inherited from Input NETWORK USINT 1 CAN network number the function block should operate on. Note: It is not the same like the network number in CANBus configurator. The CiA405 NETWORK is calculated by NetID + 1. Example: 1 = CAN0, 2 = CAN1, 3 = CAN2, … CiA405Base ENABLE BOOL FALSE Enables the function block on rising edge. Aborts operation on falling edge. CiA405Base TIMEOUT UDINT 0 Timeout in ms; 0 means no timeout CiA405Base Output CONFIRM BOOL FALSE TRUE : function block finished without error CiA405Base ERROR CANOPEN_KERNEL_ERROR CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_NO_ERROR Error code: see CANOPEN_KERNEL_ERROR for further details CiA405Base Input DEVICE DEVICE 0 NodeID of device; 0 means local device (= CANopenManager) Output STATE DEVICE_STATE 0 contains current NMT state
SDO access ¶ SDO_READ4 (FunctionBlock) SDO_READ_DATA (FunctionBlock) SDO_WRITE4 (FunctionBlock) SDO_WRITE_DATA (FunctionBlock) obsolete (only for compatibility) SDO_READ (FunctionBlock) SDO_WRITE (FunctionBlock)
SDO_READ4 (FB) ¶ FUNCTION_BLOCK SDO_READ4 EXTENDS CiA405Base This function block is used for reading a specific object from object dictionary of a DEVICE . Up to 4 bytes can be read. Data is written to an ARRAY OF BYTE . If more than 4 bytes should be read please use SDO_READ . If object can be read without error CONFIRM becomes TRUE and DATA contains read data in Little Endian byte order. If an error occurs ERROR becomes unequal 0. In case of a SDO abort ERROR is set to CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_OTHER_ERROR and ERRORINFO contains the associated abort code (in Little endian) as defined by CiA 301. InOut: Scope Name Type Initial Comment Inherited from Input NETWORK USINT 1 CAN network number the function block should operate on. Note: It is not the same like the network number in CANBus configurator. The CiA405 NETWORK is calculated by NetID + 1. Example: 1 = CAN0, 2 = CAN1, 3 = CAN2, … CiA405Base ENABLE BOOL FALSE Enables the function block on rising edge. Aborts operation on falling edge. CiA405Base TIMEOUT UDINT 0 Timeout in ms; 0 means no timeout CiA405Base Output CONFIRM BOOL FALSE TRUE : function block finished without error CiA405Base ERROR CANOPEN_KERNEL_ERROR CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_NO_ERROR Error code: see CANOPEN_KERNEL_ERROR for further details CiA405Base Input DEVICE DEVICE NodeID of destination device; 0 means local device (= CANopenManager) CHANNEL USINT 1 SDO channel: 0: use any free channel; 1..n: specific channel INDEX WORD Index of object SUBINDEX BYTE SubIndex of object Output DATA ARRAY [1..4] OF BYTE Array of Byte the data is written to. Data is in CANopen Byte Order (= Little Endian). DATALENGTH USINT Amount of data in bytes written to DATA ERRORINFO SDO_ERROR contains abort code in little endian in case of ERROR is CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_OTHER_ERROR
SDO_READ_DATA (FB) ¶ FUNCTION_BLOCK SDO_READ_DATA EXTENDS CiA405Base This function block is used for reading a specific object from object dictionary of a DEVICE . If object can be read without error CONFIRM becomes TRUE and DATA contains read data in Little Endian byte order. If an error occurs ERROR becomes unequal 0. In case of a SDO abort ERROR is set to CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_OTHER_ERROR and ERRORINFO contains the associated abort code (in Little endian) as defined by CiA 301. InOut: Scope Name Type Initial Comment Inherited from Input NETWORK USINT 1 CAN network number the function block should operate on. Note: It is not the same like the network number in CANBus configurator. The CiA405 NETWORK is calculated by NetID + 1. Example: 1 = CAN0, 2 = CAN1, 3 = CAN2, … CiA405Base ENABLE BOOL FALSE Enables the function block on rising edge. Aborts operation on falling edge. CiA405Base TIMEOUT UDINT 0 Timeout in ms; 0 means no timeout CiA405Base Output CONFIRM BOOL FALSE TRUE : function block finished without error CiA405Base ERROR CANOPEN_KERNEL_ERROR CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_NO_ERROR Error code: see CANOPEN_KERNEL_ERROR for further details CiA405Base Input DEVICE DEVICE NodeID of destination device; 0 means local device (= CANopenManager) CHANNEL USINT 1 SDO channel: 0: use any free channel; 1..n: specific channel INDEX WORD Index of object SUBINDEX BYTE SubIndex of object MODE SDO_MODE SDO_MODE.AUTO specifies the SDO Mode to be used DATA POINTER TO BYTE Pointer to memory the data should be written to. Data is written in CANopen Byte Order (= Little Endian). Inout DATALENGTH UDINT VAR_IN: Number of bytes DATA is pointing to. VAR_OUT: Amount of data bytes written to DATA Output ERRORINFO SDO_ERROR contains abort code in little endian in case of ERROR is CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_OTHER_ERROR
SDO_WRITE4 (FB) ¶ FUNCTION_BLOCK SDO_WRITE4 EXTENDS CiA405Base This function block is used for writing a specific object in object dictionary of a DEVICE . Up to 4 bytes can be written. Data is provided as an ARRAY OF BYTE . If more than 4 bytes should be written please use SDO_WRITE . If DATA was written without error CONFIRM becomes TRUE . DATA has to be in Little Endian byte order. If an error occurs ERROR becomes unequal 0. In case of a SDO abort ERROR is set to CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_OTHER_ERROR and ERRORINFO contains the associated abort code (in Little endian) as defined by CiA 301. InOut: Scope Name Type Initial Comment Inherited from Input NETWORK USINT 1 CAN network number the function block should operate on. Note: It is not the same like the network number in CANBus configurator. The CiA405 NETWORK is calculated by NetID + 1. Example: 1 = CAN0, 2 = CAN1, 3 = CAN2, … CiA405Base ENABLE BOOL FALSE Enables the function block on rising edge. Aborts operation on falling edge. CiA405Base TIMEOUT UDINT 0 Timeout in ms; 0 means no timeout CiA405Base Output CONFIRM BOOL FALSE TRUE : function block finished without error CiA405Base ERROR CANOPEN_KERNEL_ERROR CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_NO_ERROR Error code: see CANOPEN_KERNEL_ERROR for further details CiA405Base Input DEVICE DEVICE NodeID of destination device; 0 means local device (= CANopenManager) CHANNEL USINT 1 SDO channel: 0: use any free channel; 1..n: specific channel INDEX WORD Index of object SUBINDEX BYTE SubIndex of object DATA ARRAY [1..4] OF BYTE data which should be written to the object DATALENGTH USINT Number of bytes to be written to the object Output ERRORINFO SDO_ERROR
SDO_WRITE_DATA (FB) ¶ FUNCTION_BLOCK SDO_WRITE_DATA EXTENDS CiA405Base This function block is used for writing a specific object in object dictionary of a DEVICE . If DATA was written without error CONFIRM becomes TRUE . DATA has to be in Little Endian byte order. If an error occurs ERROR becomes unequal 0. In case of a SDO abort ERROR is set to CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_OTHER_ERROR and ERRORINFO contains the associated abort code (in Little endian) as defined by CiA 301. InOut: Scope Name Type Initial Comment Inherited from Input NETWORK USINT 1 CAN network number the function block should operate on. Note: It is not the same like the network number in CANBus configurator. The CiA405 NETWORK is calculated by NetID + 1. Example: 1 = CAN0, 2 = CAN1, 3 = CAN2, … CiA405Base ENABLE BOOL FALSE Enables the function block on rising edge. Aborts operation on falling edge. CiA405Base TIMEOUT UDINT 0 Timeout in ms; 0 means no timeout CiA405Base Output CONFIRM BOOL FALSE TRUE : function block finished without error CiA405Base ERROR CANOPEN_KERNEL_ERROR CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_NO_ERROR Error code: see CANOPEN_KERNEL_ERROR for further details CiA405Base Input DEVICE DEVICE NodeID of destination device; 0 means local device (= CANopenManager) CHANNEL USINT 1 SDO channel: 0: use any free channel; 1..n: specific channel INDEX WORD Index of object SUBINDEX BYTE SubIndex of object MODE SDO_MODE SDO_MODE.AUTO specifies the SDO Mode to be used DATA POINTER TO BYTE pointer to data which should be written (data has to be in little endian byte order) DATALENGTH UDINT length of data in bytes Output ERRORINFO SDO_ERROR contains abort code in little endian in case of ERROR is CANOPEN_KERNEL_ERROR.CANOPEN_KERNEL_OTHER_ERROR