Debugging ¶ CANDiagnosis (FunctionBlock)
CANDiagnosis (FB) ¶ FUNCTION_BLOCK CANDiagnosis This functionblock can be used for debugging purposes. It can be used for getting internal diagnostic information from a given CANopenManager instance. See CANOpenDiagnosisInfo for further information. InOut: Scope Name Type Comment Inout Manager CANopenManager CANopenManager instance DiagnosisInfo CANOpenDiagnosisInfo Diagnostic information for CANopenManager
Device Diagnosis ¶ This folder contains all functionblocks implementing Device Diagnosis functionality. The function blocks will be implicitly instantiated by CODESYS. CANRemoteDevice_Diag (FunctionBlock) 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) CANRemoteModule_Diag (FunctionBlock) IDevice CheckCurrentSupportedCommunicationState (Method) CheckSupportedCommunicationState (Method) GetDeviceInfo (Method) GetDeviceState (Method) INode ChildNodeCount (Property) Connector (Property) Enable (Property) FirstChildNode (Property) Index (Property) IsRootNode (Property) NextSiblingNode (Property) ParentNode (Property) SiblingNodeCount (Property) CANopenManager_Diag (FunctionBlock) 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)
CANRemoteDevice_Diag (FB) ¶ FUNCTION_BLOCK CANRemoteDevice_Diag EXTENDS CANRemoteDevice IMPLEMENTS DED.IDevice2 CANRemoteDevice function block for Device Diagnosis. Note Do not instantiate this function block. It will be instantiated implicitly. Properties: BootupTimeout , inherited from CANRemoteDevice CANopenState , inherited from CANRemoteDevice ChildNodeCount ConfigurationErrors , inherited from CANRemoteDevice Connector Enable ErrorControlActivated , inherited from CANRemoteDevice FirstChildNode GuardTime , inherited from CANRemoteDevice GuardWatchdogTime , inherited from CANRemoteDevice GuardingType , inherited from CANRemoteDevice Index IsRootNode NMTErrorBehaviour , inherited from CANRemoteDevice NextSiblingNode NodeID , inherited from CANRemoteDevice ParentNode SiblingNodeCount pCANopenManager , inherited from CANRemoteDevice Methods: CheckCurrentSupportedCommunicationState CheckSupportedCommunicationState GetDeviceInfo GetDeviceState SetCommunicationState Structure: 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)
IDevice ¶ CheckCurrentSupportedCommunicationState (Method) CheckSupportedCommunicationState (Method) GetDeviceInfo (Method) GetDeviceState (Method) SetCommunicationState (Method)
CANRemoteDevice_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 CANRemoteDevice_Diag.SetCommunicationState . Note Use CANRemoteDevice_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.
CANRemoteDevice_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 CANRemoteDevice_Diag.SetCommunicationState . Note Use CANRemoteDevice_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.
CANRemoteDevice_Diag.GetDeviceInfo (METH) ¶ METHOD GetDeviceInfo : DED.ERROR Returns device information about the CANopen Remote device. Interpretation of DED.DEVICE_INFO is as follows: Component Interpretation eType DED.DEVICE_TYPE.FIELDBUS_SLAVE idSystem Node ID idInstance Instance number in I/O configuration (starting by 0) InOut: Scope Name Type Comment Return GetDeviceInfo DED.ERROR DED.ERROR.NO_ERROR if no error occurred while getting information. Inout deiInfo DED.DEVICE_INFO device information
CANRemoteDevice_Diag.GetDeviceState (METH) ¶ METHOD GetDeviceState : DED.DEVICE_STATE Returns the state of the CANopen Remote device. Following table defines the mapping between CAA Device Diagnosis DED.DEVICE_STATE and DEVICE_STATE . CAA Device Diagnosis CANopen state DED.DEVICE_STATE.UNKNOWN DEVICE_STATE.UNKNOWN DED.DEVICE_STATE.STOPPED DEVICE_STATE.STOPPED DED.DEVICE_STATE.RUNNING DEVICE_STATE.OPERATIONAL DED.DEVICE_STATE.ERROR Bus Error pending DED.DEVICE_STATE.DISABLED Device is disabled in I/O configuration. DED.DEVICE_STATE.NOT_CONFIGURED DEVICE_STATE.PRE_OPERATIONAL and SDO configuration not finished yet DED.DEVICE_STATE.CONFIGURED DEVICE_STATE.PRE_OPERATIONAL and SDO configuration finished DED.DEVICE_STATE.NOT_FOUND DEVICE_STATE.NOT_AVAIL InOut: Scope Name Type Comment Return GetDeviceState DED.DEVICE_STATE current device state Output xDiagnosisInfoAvailable BOOL TRUE , if red exclamation mark in device tree eError DED.ERROR
CANRemoteDevice_Diag.SetCommunicationState (METH) ¶ METHOD SetCommunicationState : DED.ERROR Starts, stops or resets the device. Following table defines the mapping between CAA Device Diagnosis DED.DEVICE_TRANSITION_STATE and CANopen NMT command: CAA Device Diagnosis CANopen NMT command DED.DEVICE_TRANSITION_STATE.START NMT Start DED.DEVICE_TRANSITION_STATE.STOP NMT Stop DED.DEVICE_TRANSITION_STATE.RESET NMT Reset Application Note Use CANRemoteDevice_Diag.CheckCurrentSupportedCommunicationState to check which transitions are possible in the current state! InOut: Scope Name Type Comment Return SetCommunicationState DED.ERROR DED.ERROR.NO_ERROR if device transition was successful. Input eRequestedState DED.DEVICE_TRANSITION_STATE desired transition