DEVICE_STATE (ENUM) ¶ TYPE DEVICE_STATE : Describes the state of the CANopen network layer, as defined in /DS-301/. The states INIT , RESET_COMM , RESET_APP , PRE_OPERATIONAL , STOPPED , OPERATIONAL correspond to the same states in /DS-301/. The state UNKNOWN is used, if the actual state of the device is not known (for example, if no guarding is performed). The state NOT_AVAIL is used, if it is known, that the device is not available (for example, if guarding is performed and the device does not answer). Attributes: qualified_only InOut: Name INIT RESET_COMM RESET_APP PRE_OPERATIONAL STOPPED OPERATIONAL UNKNOWN NOT_AVAIL
SDO_MODE (ENUM) ¶ TYPE SDO_MODE : Defines the different SDO transmission modes. Attributes: qualified_only InOut: Name Initial Comment AUTO ANYNUM_TO_INT(CS.SDO_MODE.AUTO) The client selects the mode automatically EXPEDITED ANYNUM_TO_INT(CS.SDO_MODE.EXPEDITED) The client uses the expedited protocol SEGMENTED ANYNUM_TO_INT(CS.SDO_MODE.SEGMENTED) The client uses segmented transfer protocol BLOCK ANYNUM_TO_INT(CS.SDO_MODE.BLOCK) The client uses block transfer protocol
TRANSITION_STATE (ENUM) ¶ TYPE TRANSITION_STATE : Describes the NMT state transitions for function block GET_STATE . Attributes: qualified_only InOut: Name Initial Comment START_REMOTE_NODE 16#5 Enter DEVICE_STATE.OPERATIONAL STOP_REMOTE_NODE 16#4 Enter DEVICE_STATE.STOPPED ENTER_PRE_OPERATIONAL 16#7F Enter DEVICE_STATE.PRE_OPERATIONAL RESET_NODE 16#6 Reset node RESET_COMMUNICATION 16#7 Reset communication ALL_EXCEPT_NMT_AND_SENDER 16#800 A flag for using in combination with another TRANSITION_STATE (logical OR). Must be used if NMT command should be addressed to all devices ( `` DEVICE``=0) but not to the NMT sender and NMT master (= CANopenManager).
Function Blocks ¶ Network management NMT (FunctionBlock) RECV_EMCY (FunctionBlock) RECV_EMCY_DEV (FunctionBlock) Own node id GET_LOCAL_NODE_ID (FunctionBlock) Query state GET_CANOPEN_KERNEL_STATE (FunctionBlock) GET_STATE (FunctionBlock) 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)
Network management ¶ NMT (FunctionBlock) RECV_EMCY (FunctionBlock) RECV_EMCY_DEV (FunctionBlock)
NMT (FB) ¶ FUNCTION_BLOCK NMT EXTENDS CiA405Base This function block provides NMT services. The NMT request will be sent to the NodeID specified in input DEVICE . If NMT request should be addressed to all devices (including NMT master and sending device) set DEVICE to 0 . If all devices but not NMT master and sending device should be addressed use the additional flag TRANSITION_STATE.ALL_EXCEPT_NMT_AND_SENDER . 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 destination device (local or remote). 0 means all devices. STATE TRANSITION_STATE 0 The NMT transition which should be performed.
RECV_EMCY (FB) ¶ FUNCTION_BLOCK RECV_EMCY EXTENDS CiA405Base Function block checks if an emergency object has been received from any DEVICE . If the function block has finished its action without any error, output CONFIRM is changed to TRUE and ERROR to 0. If DEVICE is 0 all devices are error free. If an EMCY is pending or an EMCY error reset was received output DEVICE contains the NodeID of the corresponding device and ERRORINFO contains the EMCY information. Note An EMCY will be returned as long as it is pending. An EMCY error reset (Variable EMCY_ERROR_CODE of EMCY_ERROR is zero) is returned only once. If an error occurred while checking for an emergency, CONFIRM is set to FALSE and ERROR is set to the corresponding error value. 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 EMCY received: DEVICE contains the NODEID of the sending device; no EMCY received: value is 0 ERRORINFO EMCY_ERROR EMCY information
RECV_EMCY_DEV (FB) ¶ FUNCTION_BLOCK RECV_EMCY_DEV EXTENDS CiA405Base Function block checks if an emergency object has been received from NodeID specified by input DEVICE . If the function block has finished its action without any error, output CONFIRM is changed to TRUE and ERROR to 0. Member EMCY_ERROR_CODE of output ERRORINFO is unequal zero if an EMCY is pending. If EMCY_ERROR_CODE equals zero no EMCY is currently pending. Note A received emergency is not cleared and it is delivered with each call of the function block until the device sends an emergency reset. If an error occurred while checking for an emergency, CONFIRM is set to FALSE and ERROR is set to the corresponding error value. 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 Output ERRORINFO EMCY_ERROR EMCY information; if member EMCY_ERROR_CODE is zero, no EMCY is pending.
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