J1939 Receive

Receive J1939 parameter group messages


Vehicle Network Toolbox: J1939 Communication


The J1939 Receive block receives a J1939 message from the configured CAN device. The J1939 database file defines the nodes and parameter groups. You specify the J1939 database with the J1939 Network Configuration block.


You need a license for both Vehicle Network Toolbox™ and Simulink® software to use this block.

Other Supported Features

The J1939 communication blocks support the use of Simulink Accelerator™ and Rapid Accelerator mode. Using this feature, you can speed up the execution of Simulink models. For more information on this feature, see the Simulink documentation.

The J1939 communication blocks also support code generation with limited deployment capabilities. Code generation requires the Microsoft® C++ compiler.

Block Outputs


Depending on the J1939 parameter group defined in the J1939 database file, the block can have multiple data output signal ports. The block output data type is double.

Msg Status

When Output New Message Received status is checked in the dialog box, this port outputs 1 when a new message is received from the CAN bus; otherwise, outputs 0.


Config name

The name of the J1939 network configuration to associate with. This is used to access the corresponding J1939 database. Only the nodes defined in the model and associated with the specified J1939 network configuration appear in the Node name list. The option shows none if no J1939 network configuration is found.

Node name

The name of the J1939 node. The drop-down list includes all the nodes in the model, both custom nodes and nodes from the database.

Parameter Group

The parameter group number (PGN) and name from the database. The contents of this list vary depending on the parameter groups that the J1939 database file specifies. The default is the first parameter group for the selected node.


If you change any parameter group settings within your J1939 database file, you must then open the J1939 Receive block dialog box and select the same Parameter Group, then click OK or Apply to update the parameter group information in the block.


Signals defined in the parameter group. The Min and Max settings are read from the database, but by default the block does not clip signal values that exceed this range.

Source Address Filter

Filter messages based on source address:

  • Allow only — Lets you specify a single source address of interest.

  • Allow all — Accepts messages from any source address. This is the default.

Destination Address Filter

Filter out message based on destination address:

  • global only — Receive only broadcast messages.

  • node specific only — Receive only messages addressed to this node.

  • global and specific — Receive all broadcast and node-addressed messages. This is the default.

Sample time

Simulation refresh rate. Specify the sampling time of the block during simulation. This value defines the frequency at which the J1939 Receive updates its output ports. If the block is inside a triggered subsystem or inherits a sample time, specify a value of -1. You can also specify a MATLAB® variable for sample time. The default value is 0.01 seconds. For information about simulation sample timing, see What Is Sample Time? (Simulink)

Output New Message Received status

Select this check box to create a Msg Status output port. Its output signal indicates a new incoming message, showing 1 for a new message received, or 0 when there is no new message.

Introduced in R2015b