Managing PGN in memory

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Managing PGN in memory

mapp Services V5.16

This section explains how to manage the information of a PGN in memory.

Example

PGN CCVS3 has numerical value 64732 (0xFCDC). PGN CCVS3 can return or transmit the following signals:

pgn_ccvs3

These signals have a defined length. For example, signal "CruiseCtrlSpeed" has a length of 16 bits.

A buffer must be provided via input parameter "Data" of function blocks MpJ1939Receive, MpJ1939SpecificRequest and MpJ1939Transmit that can receive and display the values of PGN CCVS3.

To receive PGN CCVS3, a variable would have to be created that can receive the information from the PGN.

It must be known exactly how PGN CCVS3 is structured. Each signal has a start bit and a fixed bit length. This means it is exactly defined from which bit the signal starts and from which bit it ends. The signals of the PGN do not all follow each other directly. Some signals have unused bits in between. For PGN CCVS3, this is what it looks like:

Signal

Start bit

Length [Bit]

Unused bits

AdptiveCruiseCtrlReadinessStatus

0

2

 

CruiseCtrlSystemCmdState

2

3

 

PrdctvCrsCtrlStSpeedOffsetStatus

5

2

1

SrcAddrssOfCntrllngDvcFrDsblngCr

8

8

SrcAddrssOfCntrllngDvcFrPsngCrsC

16

8

 

AEBSReadinessState

24

2

 

DriverCancellationStatus

26

2

4

CruiseCtrlSetSpeed

32

16

CruiseCtrlSpeed

48

16

 

To receive the information, variable "DataBuffer" of data type "BYTE[0..19]" is created, for example.

Variable "DataBuffer" is specified later on input "Data" of function block MpJ1939Receive, for example.

If the value of signal "SrcAddrssOfCntrllngDvcFrPsngCrsC" should now be evaluated, for example, "DataBuffer[2]" must be accessed. If signal "CruiseCtrlSystemCmdState" should be accessed, this can be done by bitwise access. This can be implemented using "DataBuffer[0].2", for example.