Raptor-Dev-J1939-Transport-Protocol

From NewEagleWiki
Jump to navigation Jump to search

New Eagle > Products Wiki > Raptor Platform > Raptor-Dev > Raptor-Dev J1939 Library > Raptor-Dev J1939 Transport Protocol

Raptor™ J1939 Transport Protocol

The transport protocol blocks make up the fundamental components of the J1939 library. These blocks interface with the Raptor CAN blocks and allow transmitting and receiving multi-frame PGNs. These blocks include a trigger mechanism to support the request of PGNs. If a PGN trigger for the requested PGN does not exist, or is unavailable, the request will be automatically NACKed. They can be used to interface new PGN messages with the J1939 transport protocol.

Blocks

Block Description Appearance
PGN ID

This block assembles a source address, destination address, priority and PGN into a J1939 message id.

PGN ID block
PGN ID block
Source Address

Outputs the current source address.

Source Address block
Source Address block
Parse CAN ID

This block outputs the destination and source address of a message.

Parse CAN ID block
Parse CAN ID block
PGN Enable

This block is used to get the enable status of a PGN. This block will include a Raptor Adjustment and Measurement in the model which can be used to control and view the enable/disable state of a PGN. This block should only be used once in a model for a given PGN and J1939 bus.

PGN Enable block
PGN Enable block
PGN Enable - No Cal

This block is similar to the raptor_j1939_pgn_get_enable_block except it does not include a Raptor Adjustment or Measurement to display the state of the enable state. This block also allows the reading of the master enable state. Use this block to get the enable status of a PGN if a raptor_j1939_pgn_get_enable or raptor_j1939_pgn_trigger block already exists in the model for the given PGN and J1939 bus.

PGN Enable - No Cal block
PGN Enable - No Cal block
PGN Request Slot

This block outputs the source and destination address of the PGN request message. Use this block inside the function call subsystem executed by a PGN trigger to determine the source of the request. The output of this block is only valid in the above mentioned function call subsystem.

PGN Request Slot block
PGN Request Slot block
PGN Set Enable

This block is used to set the enable status of a PGN. This can be used to disable a PGN from transmitting. This will also disable the request trigger and send the appropriate NACK when the PGN is requested. The Master Enable can be used to disable all communication while maintaining individual PGN enable/disable states when re-enabled.

PGN Set Enable block
PGN Set Enable block
PGN Trigger

The PGN trigger block is used to trigger a message to be sent when it is requested. This block will execute the function connected to it's output when a Request message is received for the specified PGN and the PGN is enabled. If the controller has not successfully acquired an address this output will not be executed. This block includes a Raptor Adjustment and Measurement to show the enable state of the PGN and allow it to be disabled. Only one PGN trigger block can be included in the model for any given PGN and J1939 bus.

PGN Trigger block
PGN Trigger block
PGN Trigger - No Cal

The PGN trigger no cal block is similar to the raptor_j1939_pgn_trigger block except it does not place a Raptor calibration or probe in the model.

PGN Trigger - No Cal block
PGN Trigger - No Cal block
Tx ACK/NACK

This block is used to send an ACK or NACK message.

Tx ACK/NACK block
Tx ACK/NACK block
Request Response Address

This block outputs the source and destination addresses that should be used for the response to a PGN request. Use this block inside the function call subsystem of a PGN trigger to drive the source and destination ports of a J1939 message transmission.

Request Response Address block
Request Response Address block
Transport Protocol

The transport protocol block is similar to the Raptor CAN Definition block. This block will include the Raptor J1939 protocol stack in your model. This is necessary to facilitate all J1939 communication. The J1939 bus name defined in this block will be used in all other Raptor J1939 blocks to link the block to a specific J1939 bus. Multiple transport protocol blocks can be included on the model to facilitate J1939 communication on multiple CAN buses or on a single CAN bus with multiple addresses. The transport protocol block must be inside a periodically triggered subsystem. It is recommended that the block be inside a subsystem executing at the Foreground loop rate in order to best maintain the timings required for J1939.

Transport Protocol block
Transport Protocol block
TP Receive

This block is similar to the Raptor Read CAN Raw block; however it is designed to work for J1939 communication. This block is used to receive the raw bytes of a PGN. This block supports both multi-frame and single frame J1939 formats. If the PGN being received is always sent as a single frame message, it may be better to use the New Eagle Network Toolbox to receive the message do to the additional memory requirements of this block to support multi-frame messages.

TP Receive block
TP Receive block
TP Rx Trigger

This block is similar to the MotoHawk CAN Receive Slot Trigger; however it is designed to work for J1939 communication. It will execute its function call output whenever the transport protocol receives a message with the specified PGN.

TP Rx Trigger block
TP Rx Trigger block