CCS Standardfunction   CANBlock [Str]
 

CANBlock [Str]

ID_Send [Hex]

ID_Send_Length [INT]

ID_Read [Hex]

ID_Read_Length [INT]

Mode [Str]

Data [Str]

Period [INT]

Timeout [s]

Interface [Str]

Description of Function

Sends and/or receives messages via a CAN interface. This function may only be invoked once the interface has been initialized by means of the function CANInit. If the function reads a received message, that message is returned and at the same time written to a received messages memory (see also function ComBlock) which can be accessed using the standard functions BlockInt and BlockStr.

Testing Points

None

Parameters

ID_Send

Specifies the identifier for the message to be sent in hexadecimal format. If no message is to be sent, no value should be entered.

ID_Send_Length

Specifies whether the identifier is to be sent using a length of 11 bits or 29 bits. If no message is to be sent, no value should be specified. The following values are allowed:

11

11 bits (default)

29

29 bits (extended)

ID_Read

Specifies the identifier for the message to be read in hexadecimal format. If no message is to be read, no value should be entered.

ID_Read_Length

Specifies whether the message to be read has an 11-bit or a 29-bit identifier. If no message is to be read, no value should be specified. The following values are allowed:

11

11 bits (default)

29

29 bits (extended)

Mode

Specifies whether a message is to be sent and/or received. The following values are allowed:

D

instructs the CAN controller on the testing station to delete the message with the identifier specified by ID_Read . If CANBlock is invoked with this mode before a function call for reading data, it ensures that the read function waits for new data or that expired data is not returned. ( ID_Send , ID_Send_Length and Data do not make sense in this context and remain blank).

E

Echo board function: instructs the CAN controller on the testing station to send data received from the control unit back to the control unit as complementary data. No entry must be made for Data. CANBlock does not return a result; the control unit reaction can be checked by means of the function ComBlock.

Init

Provides the facility to instruct the CAN controller to receive messages with a specified ID. There is no return value. Specification of Period and Timeout makes no sense with this mode and can be omitted. Data and ID_Send, if specified, are sent after initialization of the CAN controller.

L

Read (and control) function: if the parameters ID_Send, ID_Send_Length and Dataspecify a message, it is sent using the identifier specified by ID_Send. A message with the identifier specified by ID_Read is expected in return and read.

In the case of a message that is sent cyclically by the control unit and does not have to be requested by the tester by means of a send message, ID_Send, ID_Send_Length and Data are left blank.

R

A message is read using Remote Frame. The tester sends a message identified as remote frame and containing no data (ID_Send, ID_Send_Length are specified). The control unit incorporates its data in the same message. The tester reads the resulting message.

(ID_Read, ID_Read_Length and Data do not make sense in this context and remain blank).

S

Control function: a message is simply sent using Data Frame; no response is expected.

Data

Specifies the data to be sent in the form of a hexadecimal string. In the case of the read-only function, no entry is made here.

Periode

Specifies whether the message is to be sent once only or cyclically. In the case of read-only or delete functions, this entry is ignored (and may also be blank). The following values are allowed:

0

Send once only (not cyclically)

nn

Send cyclically at an interval of nn ms

-1

Send a cyclic message for the specified identifier.

Timeout

If the interface tester does not receive a response within the period specified here, the test function is aborted and an error message returned (if no response is expected, no timeout should be specified).

Interface

Specifies which CAN interface is to be addressed. The name specified here should be the name used to initialize the interface using the function CANInit.


Example 1: Requesting data using remote frame

CANBlock

610, 11, , , R, , 0 , 1, CAN1


610 = ID_Send

11 = ID_Send_Length 11-bit ID

R= Send Remote Frame

0 = Send once only

1 = Timeout 1s

CAN1= Interface

Example 2: Sending a message cyclically (control function)

CANBlock

3FE, 11, , , S, 00453EFFFF23E9FF, 500, , CAN2

3FE= ID_Send

11 = ID_Send_Length 11-bit ID

S= Control function

00..FF= Sent data ( 8 bytes)

500 = Send cyclically every 500 ms

CAN2= Interface

Example 3: Terminating cyclical message in Example 2

CANBlock

3FE, , , , , , 0, , CAN2

3FE= ID_Send

-1 = End cyclical message transmission

CAN2= Interface

Example 4: Request message from control unit by sending another message

CANBlock

3FE, 11, 01F, 11, L, 00453EFF, 1000, 1, CAN2

3FE= ID_Send

11 = ID_Send_Length 11-bit ID

01F= ID_Read

11 = ID_Send_Length 11-bit ID

L= Read function

00..FF= Sent data ( 4 bytes)

1000 = Send cyclically every 1000 ms

1 = Timeout 1 sec.

CAN2= Interface

Example 5: Delete previously received message from received messages memory

CANBlock

00F, 11, , , D, , , , CAN1


00F= ID_Read

11 = ID_Read_Length 11-bit ID

D= Delete messages with ID = 00F from received messages memory

CAN1= Interface