CANopenDevice_Diag (FB) ¶ FUNCTION_BLOCK CANopenDevice_Diag EXTENDS CANopenDevice IMPLEMENTS DED.IStack, DED.IDevice2, DED.IBus, DED.IReconfigureProvider This function block implements a CANopen Slave stack with CAA Device Diagnosis support. Note Do not instantiate this function block! An implicit instance will be created for each CANopen Slave in the device tree. Properties: ChildNodeCount Connector Enable FirstChildNode Index IsRootNode NextSiblingNode NodeID , inherited from CANopenDevice ObjectDictionary , inherited from CANopenDevice ParentNode SiblingNodeCount State , inherited from CANopenDevice Methods: AddLogMessage , inherited from CANopenDevice CheckCurrentSupportedCommunicationState CheckSupportedCommunicationState GetBusInfo GetBusState GetDeviceInfo GetDeviceState GetQoS PowerDown , inherited from CANopenDevice PowerUp , inherited from CANopenDevice Reset , inherited from CANopenDevice ResetCommunication , inherited from CANopenDevice SetCommunicationState SetNodeID , inherited from CANopenDevice SwitchToOp , inherited from CANopenDevice SwitchToPreop , inherited from CANopenDevice SwitchToStopped , inherited from CANopenDevice Structure: IBus GetBusInfo (Method) GetBusState (Method) GetQoS (Method) IDevice CheckCurrentSupportedCommunicationState (Method) CheckSupportedCommunicationState (Method) GetDeviceInfo (Method) GetDeviceState (Method) SetCommunicationState (Method) INode ChildNodeCount (Property) Connector (Property) Enable (Property) FirstChildNode (Property) Index (Property) IsRootNode (Property) NextSiblingNode (Property) ParentNode (Property) SiblingNodeCount (Property)
IBus ¶ Functions for getting bus information. GetBusInfo (Method) GetBusState (Method) GetQoS (Method)
CANopenDevice_Diag.GetBusInfo (METH) ¶ METHOD GetBusInfo : DED.ERROR Returns information about the associated CANbus. Interpretation of DED.BUS_INFO is as follows: Component Interpretation eType DED.BUS_TYPE.CANOPEN idSystem Network ID idInstance Instance number in I/O configuration (starting by 0) InOut: Scope Name Type Comment Return GetBusInfo DED.ERROR DED.ERROR.NO_ERROR if no error occurred while getting information. Inout buiInfo DED.BUS_INFO Bus information struct
CANopenDevice_Diag.GetBusState (METH) ¶ METHOD GetBusState : DED.BUS_STATE Returns the bus state of the associated CANBus. Following table defines the mapping between CAA Device Diagnosis DED.BUS_STATE and CL2.BUSSTATE . CAA Device Diagnosis CANbus state DED.BUS_STATE.RUNNING CL2.BUSSTATE.ERR_FREE , CL2.BUSSTATE.ACTIVE , CL2.BUSSTATE.WARNING DED.BUS_STATE.ERROR no driver found, CL2.BUSSTATE.BUSOFF , CL2.BUSSTATE.PASSIVE DED.BUS_STATE.UNKNOWN CL2.BUSSTATE.UNKNOWN InOut: Scope Name Type Comment Return GetBusState DED.BUS_STATE current bus state. Output xDiagnosisInfoAvailable BOOL TRUE , if red exclamation mark in device tree eError DED.ERROR DED.ERROR.NO_ERROR if bus state was retrieved wihout error.
CANopenDevice_Diag.GetQoS (METH) ¶ METHOD GetQoS : DED.ERROR Returns quality of service information for the CANbus. Interpretation of DED.QOS_INFO is as follows: Component Interpretation ctError Total sum of TxErrorCounter, RxErrorCounter and LostCounter. usiBusload Current busload in percent (if supported by CAN driver, else always 0) InOut: Scope Name Type Comment Return GetQoS DED.ERROR DED.ERROR.NO_ERROR if no error occurred while getting information. Inout QualityInfo DED.QOS_INFO
IDevice ¶ Functions for getting device information. CheckCurrentSupportedCommunicationState (Method) CheckSupportedCommunicationState (Method) GetDeviceInfo (Method) GetDeviceState (Method) SetCommunicationState (Method)
CANopenDevice_Diag.CheckCurrentSupportedCommunicationState (METH) ¶ METHOD CheckCurrentSupportedCommunicationState : BOOL This method checks if a specific DED.DEVICE_TRANSITION_STATE can be processed in the current state. For more details on interpretation of DED.DEVICE_TRANSITION_STATE for CANopen see CANopenDevice_Diag.SetCommunicationState . Note Use CANopenDevice_Diag.CheckSupportedCommunicationState to check which DED.DEVICE_TRANSITION_STATE is supported in general. InOut: Scope Name Type Comment Return CheckCurrentSupportedCommunicationState BOOL TRUE if node supports the requested DED.DEVICE_TRANSITION_STATE in the current state. Input eRequestedState DED.DEVICE_TRANSITION_STATE The communication state to be checked.
CANopenDevice_Diag.CheckSupportedCommunicationState (METH) ¶ METHOD CheckSupportedCommunicationState : BOOL This method checks if a specific DED.DEVICE_TRANSITION_STATE is supported by the node in general. For more details on interpretation of DED.DEVICE_TRANSITION_STATE for CANopen see CANopenDevice_Diag.SetCommunicationState . Note Use CANopenDevice_Diag.CheckCurrentSupportedCommunicationState to check which DED.DEVICE_TRANSITION_STATE is possible in the current state. InOut: Scope Name Type Comment Return CheckSupportedCommunicationState BOOL TRUE if node supports the requested DED.DEVICE_TRANSITION_STATE in general. Input eRequestedState DED.DEVICE_TRANSITION_STATE The communication state to be checked.
ABORT_CODE (ENUM) ¶ TYPE ABORT_CODE : SDO abort codes as defined by CiA-301 Attributes: qualified_only InOut: Name Initial Comment SUCCESSFUL 16#0 No abort. Operation successful CRC_ERROR 16#5040004 OUT_OF_MEMORY 16#5040005 UNSUPPORTED_ACCESS_TO_OBJECT 16#6010000 READ_NOT_ALLOWED 16#6010001 WRITE_NOT_ALLOWED 16#6010002 NO_SUCH_OBJECT 16#6020000 NOT_MAPPABLE 16#6040041 GENERAL_PARAM_INCOMPATIBILITY 16#6040043 GENERAL_INCOMPATIBILTY 16#6040047 LENGTH_DATA_INVALID 16#6070010 NO_SUCH_SUBINDEX 16#6090011 VALUE_RANGE_EXCEEDED 16#6090030 VALUE_TOO_HIGH 16#6090031 VALUE_TOO_LOW 16#6090032 GENERAL_ERROR 16#8000000 LOCAL_CTRL_ERROR 16#8000021 Data cannot be transferred or stored to the application because of local control. DEVICE_STATE_ERROR 16#8000022 Data cannot be transferred or stored to the application because of the present device state. NO_DATA_AVAILABLE 16#8000024 No data available
CANOPEN_STATE (ENUM) ¶ TYPE CANOPEN_STATE : CANopen states as defined by CiA-301 Attributes: qualified_only InOut: Name Initial Comment POWERDOWN -1 no CANopen services INIT 0 CANopen Service (see CiA-301): Bootup Object STOPPED 16#4 CANopen Service (see CiA-301): NMT OPERATIONAL 16#5 CANopen Service (see CiA-301): PDO (I/Os), SDO, SYNC, TIME, EMCY, NMT PREOPERATIONAL 16#7F CANopen Service (see CiA-301): SDO, SYNC, TIME, EMCY, NMT