— 23 —
By modifying the values in the buffer, the subprogram can modify messages and even create new messages.
Regardless of the actual length of the received message, the subprogram has access to all 229 bytes
of the buffer.
Please note that if a NMEA 2000 fast-packet PGN is not included in the PGNS_TO_ASSEMBLY list, the
program will be called for each CAN message in the sequence, and the byte at offset 4 will be set to 0xFF.
3. Sending a message
To send message stored in the buffer a built-in
send()
function is used:
send(interface_id)
interface_id — interface through which the message is sent, CAN1 or CAN2.
This parameter can be
omitted, in this case the message will be sent through the interface opposed to the one from which
the processed message was received.
In order to avoid embarrassing mistakes with unpredictable consequences, we recommend always to use
the
send()
without a parameter, wherever possible.
Note that the filter subprogram is responsible for forwarding the message being processed. If your
subprogram does not contain a call to
send()
, then the processed message will not be forwarded.
4. Variables, operators, and expressions
There are 26 global variables available to the programmer, with names from A to Z. Variable
name is not case-sensitive. Variables can be one of the following types that are defined implicitly
and automatically converted to the necessary type when operations are performed.
•
INT8 — signed 1-byte integer;
•
UINT8 — unsigned 1-byte integer;
•
INT16 — signed 2-byte integer;
•
UINT16 — unsigned 2-byte integer;
•
INT32 — signed 4-byte integer;
Summary of Contents for YDNB-07N
Page 46: ......