CANopen Test Feature Set Node Layer CAPL Functions
Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE To use the CAPL functions the node layer CANopenTfsNl.dll must be included. You can include the node layer by using the configuration dialog of the node on page Components or via the node attribute NodeLayerModules in the database. ON THIS PAGE:Level 1
Enable the generation of CANopen protocol errors at any point and the exploitation of limit cases. The user is responsible for the communication here and can also write complete tests himself. Of course the mixing of the functions of the individual test levels is also possible. This section contains a brief listing of all Level 1 functions that are made available by the CANopen Test Feature Set node layer.Guarding
- coTfsGuardingRequest: Sends an user-definable guarding request.
Heartbeat
- coTfsHeartbeatProducerCheckIfActive: Returns the current status of the heartbeat producer of the selected node. If this is switched on, the time settings are checked (passive test).
NMT
- coTfsNMTRequest: NMT request
- coTfsNmtGetCurrentState: Returns the current device state.
SDO
- coTfsSDOCalcCrc: Calculates the CRC checksum for a block transfer.
- coTfsSDOGetBlockSize: Returns the block size that is used for a block transfer.
- coTfsSDOBlockInit: Starts a SDO block up/download.
- coTfsSDOBlockEnd: Stops a SDO block up/download.
- coTfsSDOBlockDownloadSegmentRequest: Sends an individual segment of a SDO block download.
- coTfsSDOBlockUploadSegmentResponse: Sends the response to a SDO upload block request.
- coTfsSdoBlockUploadGetCRC: Gets the CRC checksum of last successful SDO block upload.
- coTfsSDOSegmentRequest: Sends an individual data segment of a segmented SDO transfer.
- coTfsSDOChkCrcSupport: Returns the CRC support flag of a SDO init block download response.
- coTfsSDOInit: Starts an expedited/segmented SDO data transfer.
- coTfsSDOGetUploadData: Returns the received SDO data of an expedited/segmented/block upload.
- coTfsSDOGetUploadSize: Returns the size of the received SDO data of an expedited/segmented/block upload.
- coTfsSDOAbort: Sends an individual SDO abort message.
- coTfsSDOInjectRawMsg: Inserts a CAN message to the following command.
- coTfsSDOInjectAbortMsg: Inserts a SDO abort message to the following command.
Level 2
Offer the experienced user the setting of some more complex tests. General data access is possible here. This section contains a brief listing of all Level 2 functions that are made available by the CANopen Test Feature Set node layer.EMCY
- coTfsEmcySendMessage: Sends an emergency message.
- coTfsEmcyResetList: Removes all entries (of a node) from the internally-stored list.
- coTfsEmcyWaitForMessage: Waits for an emergency message of a particular node.
- coTfsEmcyGetErrorCode: Returns received emergency messages (of a node).
Guarding
- coTfsNodeGuarding: Starts a node guarding test.
- coTfsLifeGuarding: Starts a life guarding test.
Heartbeat
- coTfsHeartbeatConsumer: A test is executed for a heartbeat consumer.
- coTfsHeartbeatProducer: The heartbeat producer of a CANopen® device is checked.
Monitoring
- coTfsMonitorActivate: Activates the passive communication monitor.
- coTfsMonitorDeactivate: Deactivates the passive communication monitor.
- coTfsMonitorExcludeNodeId: Excludes a single node-ID from monitoring.
- coTfsMonitorExcludeNodeIdRange: Excludes a range of node-IDs from monitoring.
- coTfsMonitorIncludeNodeId: Includes a single node-ID for monitoring.
- coTfsMonitorIncludeNodeIdRange: Includes a range of node-IDs for monitoring.
- coTfsMonitorSetLssTimeout: Sets the LSS timeout for the passive communication monitor.
- coTfsMonitorSetNmtTimeout: Sets the NMT timeout for the passive communication monitor.
- coTfsMonitorSetSdoTimeout: Sets the SDO timeout for the passive communication monitor.
- coTfsCbGetReferenceTime: Gets the maximum, minimum, and average value of an active monitor.
- coTfsCbGetSettings: Gets parameter of an active monitor.
- coTfsConfigureGenericMonitor: Configures and activates a generic message monitor.
- coTfsDeactivateGenericMonitor: Stops a generic message monitor and evaluate monitoring results.
- coTfsCheckAndCompareGenericMonitorMessage: Checks if the expected message data are received during a generic message monitoring.
- coTfsMonitorGetStatistics: Returns statistics information.
NMT
- coTfsNMTEnterPreOperational: The DUT is set to state “Pre-Operational”.
- coTfsNMTResetCommunication: The DUT is commanded to execute a “Reset Communication”.
- coTfsNMTResetNode: The DUT is commanded to execute a “Reset Node”.
- coTfsNMTStartNode: The DUT is set to state “Operational”.
- coTfsNMTStopNode: The DUT is set to state “Stopped”.
- coTfsNmtWaitForBootupMessage: The DUT waits for a NMT boot-up message.
Object Dictionary
- coTfsODAddEntry: Adds a single object to the internal list of test objects.
- coTfsODAddEntryIndexRange: Adds a list of object entries to the internal list, which only differ in the given index.
- coTfsODAddEntrySubIndexRange: Adds a list of object entries to the internal list, which only differ in the given subindex.
- coTfsODAddOptEntryValueRange: Expands the allowed value range of the last created object entry.
- coTfsODAddOptEntryValue: Expands the allowed value range of the last created object entry with a given value.
- coTfsODChkSingleEntry: Checks a single object dictionary entry of existence and size via a SDO upload.
- coTfsODChkSingleEntryNotExist: Checks if the given object does not exist in the object dictionary.
- coTfsODClearAllEntries: Deletes all objects of the internal test object list.
- coTfsODChkNotExist: Executes an user defined object dictionary test on hidden objects.
- coTfsODChk: Executes an user defined object dictionary test considering access type, data type and default values.
- coTfsODSetErrorHandling: Controls the abort behavior of the test module.
SDO
- coTfsSDOBlockDownload: Executes a complete SDO block download.
- coTfsSDOBlockUpload: Executes a complete SDO block upload.
- coTfsSDOUpload: Executes a SDO upload.
- coTfsSDODownload: Executes a SDO download.
- coTfsSDOUploadAndCompare: Executes a SDO upload. The data received are checked against predefined data.
- coTfsSDODownloadUploadAndCompare: Executes a SDO download, followed by a SDO upload. The data received are checked against predefined data.
- coTfsSDOGetUploadData: Returns the received SDO data of an expedited/segmented/block upload.
- coTfsSDOGetUploadSize: Returns the size of the received SDO data of an expedited/segmented/block upload.
- coTfsSDOAbortTest: Stops a test after a specified number of CAN messages.
- coTfsSdoChkEntryExists: Checks if an object is readable.
SDO Abort
- coTfsSDOWaitForAbortCode: Waits for the occurrence of a SDO abort message from a particular node.
- coTfsSDOWaitForSpecificAbortCode: Wait for specific SDO abort codes.
- coTfsSDOGetAbortCode: Returns the received SDO abort code.
- coTfsSDOAddAccAbortCode: Adds a specific abort code to the internal list of accepted abort codes.
- coTfsSDOAbortCodeOccured: Checks for successful execution of a SDO command with a valid SDO abort code.
- coTfsSdoChkForUnexpectedAbort: Checks for unexpected SDO abort codes.
SYNC
- coTfsSyncProducerDetail: Starts a freely-configurable SYNC producer test. This test requires the existence of the optional sync counter.
TPDO
- coTfsTPDOGetDataBySyncCyclic: Configures a TPDO as cyclic and starts a virtual sync producer. Checks the transmit performance of the test node.
- coTfsTPDOGetDataByEventTimer: Configures the event timer of the TPDO and check the transmit cycle.
- coTfsTPDOGetDataByRTR: Gets the COB-ID and transmit the TPDO data read with a remote frame.
LSS
- coTfsLssSendSwitchStateModeGlobalRequest: Sends a Switch state global LSS mode message.
- coTfsLssWaitForSwitchStateModeGlobalRequest: Waits for a Switch state global LSS mode message.
- coTfsLssSendSwitchStateSelectiveSequence: Sends a Switch state selective messages and waits for the response.
- coTfsLssWaitforSwitchStateSelectiveSequence: Waits for a Switch state selective messages and sends the response.
- coTfsLssSendConfigureNodeIdRequest: Sends a Configure LSS node-ID request and waits for the response.
- coTfsLssSendConfigureNodeIdResponse: Sends the LSS Configure node-ID response.
- coTfsLssSendConfigureBitTimingRequest: Sends a Configure LSS bit timing parameters request and waits for the response.
- coTfsLssWaitForConfigureBitTimingRequest: Waits for Configure LSS bit timing parameters request.
- coTfsLssSendConfigureBitTimingResponse: Sends the Configure LSS bit timing parameters response.
- coTfsLssSendActivateBitTimingRequest: Sends an Activate LSS bit timing parameter request.
- coTfsLssWaitForActivateBitTimingRequest: Waits for an Activate LSS bit timing parameter request.
- coTfsLssSendStoreConfigurationRequest: Sends a LSS Store Configuration request and waits for the response.
- coTfsLssWaitForStoreConfigurationRequest: Waits for the LSS store configuration request and sends the response.
- coTfsLssSendInquireNodeIdRequest: Sends an Inquire node-ID request and waits for the response.
- coTfsLssWaitForInquireNodeIdRequest: Waits for the Inquire node-ID request and sends the response.
- coTfsLssSendInquireVendorIdRequest: Sends an Inquire vendor-ID request and waits for the response.
- coTfsLssWaitForInquireVendorIdRequest: Waits for the Inquire vendor-ID request and sends the response.
- coTfsLssSendInquireProductCodeRequest: Sends an Inquire product code request and waits for the response.
- coTfsLssWaitForInquireProductCodeRequest: Waits for the Inquire product code request and sends the response.
- coTfsLssSendInquireRevisionNoRequest: Sends an Inquire revision number request and waits for the response.
- coTfsLssWaitForInquireRevisionNoRequest: Waits for the Inquire revision number request and sends the response.
- coTfsLssSendInquireSerialNoRequest: Sends an Inquire serial number request and waits for the response.
- coTfsLssWaitForInquireSerialNoRequest: Waits for the Inquire serial number request and sends the response
- coTfsLssSendIdentifyRemoteSlaveSequence: Sends a LSS identify remote slave sequence.
- coTfsLssWaitForIdentifyRemoteSlaveSequence: Waits for a LSS identify remote slave sequence.
- coTfsLssSendIdentifySlaveResponse: Sends an Identify slave protocol response message.
- coTfsLssWaitForIdentifySlaveResponse: Waits for the Identify slave protocol response message.
- coTfsLssSendIdentifyNonConfRemoteSlaveRequest: Sends an Identify non-configured remote slave response.
- coTfsLssWaitForIdentifyNonConfRemoteSlaveRequest: Waits for an Identify non-configured remote slave response.
- coTfsLssSendIdentifyNonConfSlaveResponse: Sends an Identify non-configured remote slave response.
- coTfsLssWaitForIdentifyNonConflaveResponse: Waits for an Identify non-configured slave response.
- coTfsLssSendFastScanRequest: Sends a LSS FastScan protocol request.
- coTfsLssWaitForFastScanRequest: Waits for the FastScan message.
- coTfsLssWaitForMasterRequestMessage: Waits for a configured LSS Master request.
- coTfsLssAddMasterResponseSwitchStateSelective: Adds a LSS Master request wait condition to the internal list.
- coTfsLssAddMasterResponseSwitchStateGlobal: Adds a LSS Master request wait condition to the internal list.
- coTfsLssAddMasterResponseConfigureNodeId: Adds a LSS Master request wait condition to the internal list.
- coTfsLssAddMasterResponseConfigureBitTiming: Adds a LSS Master request wait condition to the internal list.
- coTfsLssAddMasterResponseActivateBitTiming: Adds a LSS Master request wait condition to the internal list.
- coTfsLssAddMasterResponseStoreConfiguration: Adds a LSS Master request wait condition to the internal list.
- coTfsLssAddMasterResponseInquireNodeId: Adds a LSS Master request wait condition to the internal list.
- coTfsLssAddMasterResponseInquireProductCode: Adds a LSS Master request wait condition to the internal list.
- coTfsLssAddMasterResponseInquireRevisionNo: Adds a LSS Master request wait condition to the internal list.
- coTfsLssAddMasterResponseInquireSerialNo: Adds a LSS Master request wait condition to the internal list.
- coTfsLssAddMasterResponseInquireVendorId: Adds a LSS Master request wait condition to the internal list.
- coTfsLssAddMasterResponseIdentifyNonConfRemoteSlv: Adds a LSS Master request wait condition to the internal list.
- coTfsLssAddMasterResponseIdentifyFastscan: Adds a LSS Master request wait condition to the internal list.
- coTfsLssSetMasterResponseIdentifyRemoteSlaveMask: Sets the bitmasks for using the function coTfsLssAddMasterResponseIdentifyNonConfRemoteSlv.
Level 3
Can be implemented very easily and require only a little CANopen knowledge. With these tests, it is possible to check the absolute basic functionality of the DUT in the simplest way. This section contains a brief listing of all Level 3 functions that are made available by the CANopen Test Feature Set node layer.Guarding
- coTfsGuarding: Executes a simple guarding test.
Heartbeat
- coTfsHeartbeat: Executes a complete heartbeat producer and heartbeat consumer test with different time settings.
NMT
- coTfsNMT: Executes a simple NMT test.
Object Dictionary
- coTfsODCheckStdEntries: Checks standard entries of the object dictionary.
SDO
- coTfsSDO: Executes an expedited/segmented/block download/upload test.
SYNC
- coTfsSyncProducer: Starts a SYNC producer test.
Test Control
Make help functionality available to the user in order to describe the desired tests more easily and quickly.- This section offers a brief overview of the additional functions for test control of the CANopen TFS node layer.
- This section offers a brief overview of the additional functions for test control of the CANopen TFS node layer.
Check
- coTfsActivateGuardingReqMonitor: Checks the temporally correct occurrence of guarding RTRs and controls the corresponding callback functions.
- coTfsActivateHeartbeatMonitor: Checks the temporally correct occurrence of the heartbeat producer message and calls the corresponding callback functions.
- coTfsActivateSyncMonitor: Checks the temporally correct occurrence of the SYNC message and calls the corresponding callback functions.
- coTfsActivateSyncPdoMonitor: Checks the temporally correct occurrence of SYNC PDO messages and calls the corresponding callback functions.
- coTfsDeactivateGuardingReqMonitor: Switches off the checking of guarding RTRs.
- coTfsDeactivateHeartbeatMonitor: Switches off the checking of the heartbeat producer.
- coTfsDeactivateSyncMonitor: Switches off the checking of the SYNC messages.
- coTfsDeactivateSyncPdoMonitor: Switches off the checking of the SYNC PDO messages.
Parameter Control
- coTfsGetNodeId: Transfers the internally-stored node-ID.
- coTfsSetNodeId: Sets the internally-stored node-ID.
- coTfsSetSdoCANid: Sets the CAN identifier to be used for the SDO tests.
Test Configurator
- InitializeTestSystem: This function can be used to set common test settings by calling simple test functions as follows.
- The functions coTfsSDOResetAbortList, coTfsSDOResetAccAbortList, coTfsEmcyResetList, and coTfsODClearAllEntries are executed if this function is called.
- The function coTfsNMTRequest is executed only if it is specified via the parameter sendNMTCmd.
- The functions coTfsSetNodeId, coTfsLoadDeviceDescription, coTfsSetTimeoutValue, and coTfsSetReportBehaviour are executed only if the function was not executed before or the respective parameter value has changed.
- SendCANMessage: This function sends a simple CAN frame by using the CAPL function output.
- StartBackgroundBusload: This function starts transmission of messages that produces a specified busload. With the parameter
baudRateandbusTrafficCategorya definite CANoe log file is defined according to CiA® TR308. The message sequences of that file are replayed during measurement. - StopBackgroundBusload: This function calls CAPL function StopReplayFile to stop an active generation of busload that has been started with
StartBackgroundBusload. - TestWaitForTesterConfirmation: This function displays a window that shows the string to the tester. The tester can acknowledge the window with
yesorno. - UserDefinedFunction: This function calls the customizable CAPL test function. The customizable function may be defined in a separated CAPL file and this file can be inserted in the Include program section via the syntax #include.
- WriteTextInReport: This function writes the given text into report.