BufferSizes (PARAMS) ¶ Library parameters for Tx and RxSRDO buffer sizes. High Limit defines the highest array index. Values will be set by the configurator. InOut: Scope Name Type Initial Comment Constant gc_TXSRDOBUFFER_HIGH_LIMIT BYTE 63 maximal number of TxSRDOs = gc_TXSRDOBUFFER_HIGH_LIMIT + 1 gc_RXSRDOBUFFER_HIGH_LIMIT BYTE 63 maximal number of RxSRDOs = gc_RXSRDOBUFFER_HIGH_LIMIT + 1
Function Blocks ¶ CANRemoteDeviceSafe (FunctionBlock) Cyclic-Methods-state-independent Initialization State-Machine State Transitions States CheckConfiguration CheckConfiguration and Stopped Operational CANopenManagerSIL2 (FunctionBlock)
CANRemoteDeviceSafe (FB) ¶ FUNCTION_BLOCK CANRemoteDeviceSafe This function block implements the logic of a CANopen Safety Remote Device. All instances are managed by the CANopenManagerSIL2 in a simple chained list and called on StartBusCycle. The function block gets its SRDO config in SetupSDROs and has its own pointer to the Safety Exchange. Function block can be enabled/disabled by S_xEnable. When S_xEnable gets TRUE the function block checks every bus cycle all conditions for safe communication: Unsafe stack is in OPERATIONAL state CRCs read back from device are correct Consistency of SRDO configuration data If a configuration error is detected (e.g. CRC mismatch) S_eError changes from NO_ERROR to a corresponding error code. If every condition is fulfilled the function block tries starting safe communication. S_xActive gets TRUE if all SRDOs are sent/received at least one time without any error. When communication error occurs (SCT/SRVT timeout, data mismatch, …), all SRDO communication is stopped: S_xActive = FALSE, S_eError <> NO_ERROR Errors can be acknowledged by a rising edge of S_xErrorAck. Safe communication will be continued. InOut: Scope Name Type Initial Comment Input S_xEnable BOOL TRUE TRUE: SRDO communication enabled; FALSE: SRDO communication stopped S_xErrorAck BOOL FALSE Pending error (S_eError <> NO_ERROR) will be acknowledged on rising edge. Output S_xActive BOOL FALSE TRUE: safe communication active; FALSE: safe communication inactive (in case of error or S_xEnable = FALSE) S_eError CST.ERROR CST.ERROR.NO_ERROR pending error Structure: Cyclic-Methods-state-independent Initialization State-Machine State Transitions States CheckConfiguration CheckConfiguration and Stopped Operational
CANopenDevice.SwitchToStopped (METH) ¶ METHOD SwitchToStopped : BOOL Switches the slave to CANOPEN_STATE.STOPPED . As defined by CiA-301 following services will be performed in this state: NMT State transition is only possible in CANOPEN_STATE.PREOPERATIONAL or CANOPEN_STATE.OPERATIONAL . InOut: Scope Name Type Comment Return SwitchToStopped BOOL TRUE if state transition was possible
CANopenDevice.ObjectDictionary (PROP) ¶ PROPERTY ObjectDictionary : IObjectDictionary Returns the Object Dictionary of a slave. See IObjectDictionary for further information.
ConfigurationParams (PARAMS) ¶ InOut: Scope Name Type Initial Comment Constant gc_udiMaxODCallbacks UDINT 3 Maximal number of callbacks that can registered to the Object Dictionary of a slave. One callback will be always used by the CANopen Slave Stack.
Debugging ¶ CANDiagnosis (FunctionBlock)
CANDiagnosis (FB) ¶ FUNCTION_BLOCK CANDiagnosis This function block helps getting CAN bus diagnostic information for a given CANopenDevice. It is intended for debugging purpose. InOut: Scope Name Type Comment Inout Slave CANopenDevice Slave instance used for retrieving diagnostic information. DiagnosisInfo CANOPEN_DIAGNOSIS_INFO Structure containing the diagnostic information.
Diagnosis ¶ CANopenDevice_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)
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)