RECEIVE(12)(DATA1)(T)
SELECT(1,1)
DEC
*2
END_RECEIVE
Step-by-step explanation
- RECEIVE(12)(DATA1)(T)
- Waits for a CAN frame with ID 0x12.
- The received data will be processed and displayed in the DATA1 field.
- SELECT(1,1)
- Extracts the first byte from the CAN payload.
- DEC
- Converts the hexadecimal value to decimal.
- *2
- Multiplies the decimal value by two.
- END_RECEIVE
- Finishes the transformation and updates the DATA1 field.
Example
Received CAN payload:
10 25 45
Processing:
SELECT(1,1) → 10
DEC → 16
*2 → 32
END_RECEIVE → 32
The DATA1 field will display:
32
RECEIVE(456)(DATA2)(T)
SELECT(2,3)
AND 0FFF
DEC
/10
END_RECEIVE( km/h)
Step-by-step explanation
- RECEIVE(456)(DATA2)(T)
- Waits for a CAN frame with ID 0x456.
- The processed result will be displayed in the DATA2 field.
- SELECT(2,3)
- Extracts bytes 2 and 3 from the received payload.
- AND 0FFF
- Clears the upper four status bits, leaving only the 12-bit value.
- DEC
- Converts the hexadecimal value to decimal.
- /10
- Applies the scaling factor.
- END_RECEIVE( km/h)
- Displays the calculated value followed by the text km/h.
Example
Received CAN frame:
456#80 03 E8 12 45 00 00 00
Processing:
SELECT(2,3) → 03 E8
AND 0FFF → 03 E8
DEC → 1000
/10 → 100
END_RECEIVE → 100 km/h
The DATA2 field will display:
100 km/h