J1939 Requests (RQST)
Documents how PGN Requests (PGN 0xEA00, RQST) work, and how to respond to one from your
application.
J1939 requests, generally
Any node can ask another node (or the whole bus) to send a specific PGN "now," instead of
waiting for its normal broadcast schedule, by sending an RQST (PGN 0xEA00). The payload is
just the 3-byte PGN being asked for.
Directed request (destination = a specific node's address): only that node is expected to answer. If it doesn't support the requested PGN, it must reply with a NAK (Acknowledgment, PGN 0xE800, control byte 1) naming the PGN, so the requester isn't left waiting.
Global/broadcast request (destination = 0xFF): every node that supports the PGN should answer with it. Nodes that don't support it stay silent — a NAK is only meaningful in response to a request addressed to you specifically; broadcasting "no" to a question nobody asked you individually would just be bus noise.
Address Claim (PGN 0x00EE00) is a special case of this same request mechanism: it's how a node asks "who's out there" (or "re-announce your address"), independent of any application message the requesting node might otherwise be configured to send or receive.
The framework automatically handles all of this on your behalf, including re-broadcasting your device's own address claim if it's requested, and automatically asking other nodes to re-announce their addresses once your device successfully claims its own address at startup — no action is required on your part for either of those.
Responding to a request
Subscribe to the CanMessageRequested notification on your CanServiceClient. Its payload is a
CanMessageData whose Id already encodes:
- The requested PGN (PF/PS or PF/DP as appropriate).
- For a PDU1 PGN (destination-addressable): the destination address set to whoever asked — reply directly to them, not to whatever placeholder destination was in your CAN configuration.
- For a PDU2 PGN (group-extension, always broadcast): no destination address at all — there's nothing to override.
Dlc/Dataare not populated — the notification only tells you what was asked for and who asked, not the answer. Building the answer is your job.
_client.NotificationReceived += (_, notif) =>
{
if (notif.TransportId == CanMessageTypes.Ids.CanMessageRequested)
{
var requested = (CanMessageData)notif.NotificationObject;
// Match on PGN (mask off priority/SA), same as any other received message.
if ((requested.Id & 0x3FFFF00u) == (MyResponsePgn << 8 & 0x3FFFF00u))
{
var response = new CanMessageData
{
Id = requested.Id, // destination address (if any) is already set correctly
Dlc = 8,
Data = BuildMyResponsePayload()
};
_client.SendCanMessages(canPort, response);
}
}
};
Two things to get right:
- Send the response using
requested.Idas your starting point, not a hardcoded id from your own config — for a PDU1 PGN, thatIdalready has the requester's address filled in as the destination. Building your own id from scratch risks replying to the wrong node (or broadcast, when a specific node asked). - You only get this notification if your CAN configuration lists you as a transmitter for that
PGN (
transmitNodesincludes your node id, or255). If it's not listed, the framework sends a NAK on your behalf (for directed requests) or stays silent (for broadcast requests) — you never see the request at all in that case, by design.