J1939 Receive

Receive J1939 parameter group messages

  • Library:
  • Simulink Real-Time / J1939 Communication

    Vehicle Network Toolbox / J1939 Communication

Description

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.

Note

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.

Ports

Output

expand all

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.

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.

Parameters

expand all

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.

Programmatic Use

ConfigName

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.

Programmatic Use

NodeName

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.

Note

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.

Programmatic Use

PGList

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.

Programmatic Use

PGName
MsgLength
SignalInfo
NSignals
StartBits
SignalSizes
ByteOrders
DataTypes
MultiplexTypes
MultiplexValues
Factors
Offsets
Minimums
Maximums
Units
SPN
Comment

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.

Programmatic Use

SrcAddrFilter
SrcAddress

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 node specific — Receive all broadcast and node-addressed messages. This is the default.

Programmatic Use

DestAddrFilter

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)

Programmatic Use

SampleTime

Select this check box to create a Msg Status outputMsg 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.

Programmatic Use

outputNew

Introduced in R2015b