Skip to main content

coTfsTPDOGetDataBySyncCyclic (Level 2)

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE

Function Syntax

long coTfsTPDOGetDataBySyncCyclic( dword index, dword outLength[], byte outValueBuf[], dword valueBufSize );

Description

This function tries to extract TPDO data using synchronous cyclic method of the test node. Test sequence
  • The transmission type of the TPDO is checked, the values 1..240 (synchronous) are accepted. If another value is read, 1 is set.
  • It is checked if the TPDO is active.
  • The test module must be in state operational, this is checked with heartbeat and guarding functions. If a heartbeat producer is active, it is overwritten and deactivated.
  • The test module works as a sync producer.
  • The test module waits for the TPDO data.
  • After receiving the data, the event timer is set back to 0.
  • If necessary, the original transmission type is set.
Test result The test was successful if all parts of the tests are executed successfully. If that’s the case, the TPDO data are written in outLength[] and outValueBuf[]. Otherwise the data are set invalid. Syntax special The parameters outLength[] and outValueBuf[] can be omitted both.

Parameters

  • index: Index of TPDO.
  • outLength[]: Size of the TPDO in bytes.
  • outValueBuf[]: Data of the TPDO, the array size should be 8 bytes.
  • valueBufSize: Size of data buffer.

Return Values

Error code

Example

dword outLength[1];
byte outValueBuf[8];

if (coTfsTPDOGetDataBySyncCyclic( 0x1800, outLength, outValueBuf, 8 )!= 1) {
  write("could not retrieve data ");
}