MotoHawk SAEJ1939 Instance Definition

This block defines an instance of the SAEJ1939 protocol.

Block ID

MotoHawk SAEJ1939 Instance Definition

Library

MotoHawk_Protocols_lib

Description

The instance block defines the communication interface handled by the application.

In order for the MotoHawk SAEJ1939 library to be used, the user's Motohawk security token will need to have the proper license added to it. For instructions on how to accomplish this, please see the instructions for adding the MotoHawk SAEJ1939 library license.

A user can check whether their Motohawk security token has the needed product license at the Matlab command line by executing the motohawk_saej1939_check_license command. A returned value of 1 means the MotoHawk SAEJ1939 library is licensed, while a returned value of 0 means it is not.

It is necessary to specify a software message queue (CAN Slot Queue Size) that is appropriate for the baud rate and bus loading. At 100% loading the following table can be used to estimate a good value for the slot queue:

Baud Rate Maximum Messages per second Recommended Queue Size
250kbps 2000 20
500kbps 4000 40
1000kbps 8000 80

These values can be scaled down to match the expected maximum busload. If this queue is not configured properly, received messages will be lost.

As the queue expands, more RAM is consumed so there is a balance between memory consumption and buffered messages.

The NAME parameters and J1939 address claiming are described in SAEJ1939-81. Currently, the Woodward SAEJ1939 Handler only supports single and service addressing.

The "Address Claim Priority" and the "DT Priority" parameters adjust the priority for the Address Claim transmit message and the TP.DT message (see J1939-21 for details).

This block accepts a reference to a MotoHawk UDS protocol handler block. This reference will allow UDS connections through a J1939 instance. UDS frames sent to this J1939 instance will be forwarded to the referenced UDS protocol handler and the claimed J1939 source address used as the lowest byte of the UDS transmit ID in responses. The UDS handler will also transmit its response message to the source address that sent the UDS message.

This block allows an application to choose whether to enforce an exact length of 3 bytes for incoming PGN requests and respond with a negative response or to ignore extra data. Leaving this box unchecked allows for more flexibility. Minimum lengths are always enforced regardless of this setting.

By default, J1939 transmissions and processing of received messages occurs within IDLE time of the application. The priority of J1939 message servicing can be specified via the protocol execution priority definition block. SAEJ1939 must be the protocol selection on this block in order to change the priority of J1939 message servicing.

The broadcast DT message rate and the RTS DT message rate define the rate between multi-packet data transfer messages for this instance in microseconds. The chosen rate is limited to the speed and precision of the operating system execution rate of the task J1939 is configured to execute within. It is recommended that the chosen rates be multiples of the J1939 execution rate in order to have the most accurate possible transmission timing. This rate would be 10ms when not using the protocol execution priority definition block, or when using it and configuring the execution of J1939 to IDLE. When using the protocol execution priority definition block and configuring J1939 for task execution, the J1939 execution rate is defined on the block. In order to achieve an RTS rate of faster than 10ms, it is neccessary to utilize the protocol execution priority definition block. For example, to achieve an RTS rate of 5000us, the protocol execution priority definition block needs to be configured to execute the J1939 protocol at a rate that is a multiple of 5000us (1000us, 2500us, 5000us). Without it, the fastest RTS rate that can be achieved is 10ms.

Block Parameters

Parameter Field Values Comments/Description
Instance Name String Unique name for this instance of the protocol.
CAN Channel Name String CAN resource name that will receive requests and transmit responses.
CAN Slot Queue Size Numeric Specifies the number of messages buffered in the J1939 slot queue.
Constant Source Address and Name Configuration Data Checkbox Specifies whether this instance's source address and name configuration information will be constant, or will change during application runtime. If not checked, a source address and name configuration block must exist in the model and reference this instance in order to claim an address and start communicating on the CAN bus.
Constant Address Numeric The address that will be claimed according to J1939-81.
Address Claim Priority Numeric The priority used in the address claim message.
DT Priority Numeric The priority used in all TP.DT messages (see J1939-21 for more details).
NACK Unsupported Recieved PGNs Checkbox Checking this box will mean that any PGNs directed at this CA that are not present in the application will be responded to with a NACK. Note: For full SAE J1939 compliance, this box should be checked. (see J1939-21 for more details).
Receive Packet Limit Numeric The maximum number of frames that can be cleared to send in response to a RTS message request.
UDS Handler Name Alpha-numeric text, single quote enclosed Reference to MotoHawk UDS protocol handler block. Used for utilizing UDS over J1939 messages.
Enforce Exact PGN Request Length Checkbox Checking this box will mean that the incoming PGN requests may only contain 3 bytes of data, otherwise a negative response will occur. Leaving this box unchecked will mean that incoming PGN requests can have up to 8 bytes of data in the message and unused bytes will be ignored, but a positive response will occur.
Broadcast DT Message Rate Numeric, microseconds The microsecond delay between each broadcast DT message for this J1939 instance.
RTS DT Message Rate Numeric, microseconds The microsecond delay between each RTS DT message for this J1939 instance.
Constant Vehicle System Instance Numeric The vehicle system instance for this SAEJ1939 Handler. This is used during the Address Claiming process as a part of the NAME.
Constant Industry Group Numeric The industry group for this SAEJ1939 Handler. This is used during the Address Claiming process as a part of the NAME.
Constant Vehicle System Numeric The vehicle system for this SAEJ1939 Handler. This is used during the Address Claiming process as a part of the NAME.
Constant Function Numeric The function for this SAEJ1939 Handler. This is used during the Address Claiming process as a part of the NAME.
Constant ECU Instance Numeric The ECU instance for this SAEJ1939 Handler. This is used during the Address Claiming process as a part of the NAME.
Constant Function Instance Numeric The function instance for this SAEJ1939 Handler. This is used during the Address Claiming process as a part of the NAME.
Constant Manufacturer Code Numeric The manufacturer code for this SAEJ1939 Handler. This is used during the Address Claiming process as a part of the NAME.
Constant Identity Number Numeric The identity number for this SAEJ1939 Handler. This is used during the Address Claiming process as a part of the NAME.