Define Parameter Groups
CAPL Functions » J1939 » Define Parameter Groups Valid for: CANoe DE • CANoe4SW DE The key word pg is used to define parameter group object. This object can be used in two ways:- To be sent directly with the
outputfunction. - As a data container to pass data to a function or to receive data from a function.
Variants
There are several ways to create a pg object:Variant 1
In this way you create a pg object where all bits of the CAN ID are set to 1 and DLC is set to 0. This variant is useful if you want to use the pg object as a data container which should receive data of a message. However, payload of this message must not be bigger than 12 byte. If the payload is bigger than 12 bytes then you have to create a sufficiently large pg object right away (see chapter Define the Size of a Parameter Group). It is also possible to send the created pg object from CAPL directly. All parts of the CAN ID must be set here (in CAPL the CAN ID is represented as a 32 bit value). In particular, the three most significant bits of the first most significant byte of the CAN ID must be set to 100b (see also the description of the attribute selector Characteristics).Variant 2
This is how you create a pg object with a specific PGN. Other components of the CAN ID are set to the following values (referring to the example above):- PGN: 0x100 (as defined), 0xxFA02 (as defined)
- SA: 0xFE, 0xFE
- DA / PS: 0xFE, 0x02 (part of PGN)
- PF: 0x1 (part of PGN), 0xFA (part of PGN)
- DA_TP: 0xFE, 0xFF
- Prio: 0, 0
- Characteristics: 0x80, 0x80