Skip to content

NI XNET XNET Session SAE J1939 Properties

PALASH KHARE edited this page Feb 23, 2022 · 2 revisions

XNET Session SAE J1939 Properties

SAE J1939:Node Address

Data Type Direction Required? Default
u32 Read/Write No Null (254)

Property Class

XNET Session

Property ID

nxPropSession_J1939Address

Description

Note  This property applies to only the CAN J1939 application protocol. This property changes the node address of a J1939 session by starting an address claiming procedure. Setting the SAE J1939:Node Address property causes NI-XNET to start the interface, but it does not start the session. Any properties that are to be set before the interface starts must be set before you set this property. J1939 traffic is not retained by an input session until nxStart or nxRead are explicitly called.

After setting this property to a valid value (≤ 253), reading the property returns the null address (254) until the address is granted. Poll the property and wait until the address gets to a valid value again before starting to write. Refer to the NI-XNET examples that demonstrate this procedure.

The node address value determines the source address in a transmitting session or a destination address in a receiving session. The source address in the extended frame identifier is overwritten with the node address of the session before transmitting.

In NI-XNET, you can assign the same J1939 node address to multiple sessions running on the same interface (for example, CAN1). Those sessions represent one J1939 node. By assigning different J1939 node addresses to multiple sessions running on the same interface, you also can create multiple nodes on the same interface.

If a J1939 ECU is assigned to multiple sessions, changing the address in one session also changes the address in all other sessions with the same assigned ECU.

For more information, refer to the SAE J1939:ECU property.

SAE J1939:ECU Busy

Data Type Direction Required? Default
bool Read/Write No False

Property Class

XNET Session

Property ID

nxPropSession_J1939ECUBusy

Description

Note  This property applies to only the CAN J1939 application protocol. Busy is a special ECU state defined in the SAE J1939 standard. A busy ECU receives subsequent RTS messages while handling a previous RTS/CTS communication.

If the ECU cannot respond immediately to an RTS request, the ECU may send CTS Hold messages. In this case, the originator receives information about the busy state and waits until the ECU leaves the busy state. (That is, the ECU no longer sends CTS Hold messages and sends the first CTS message with the requested data.)

Use the ECU Busy property to simulate this ECU behavior. If a busy XNET ECU receives a CTS message, it sends CTS Hold messages instead of CTS data messages immediately. Afterward, if clearing the busy property, the XNET ECU resumes handling the transport protocol starting with CTS data messages, as the originator expects.

SAE J1939:ECU

Data Type Direction Required? Default
nxDatabaseRef_t Write Only No Unassigned

Property Class

XNET Session

Property ID

nxPropSession_J1939ECU

Description

Note  This property applies to only the CAN J1939 application protocol. The database from which the ECU reference is passed in this property must be open when this property is called, because database references are valid only when the database is open. This property assigns a database ECU to a J1939 session. Setting this property changes the node address and J1939 64-bit ECU name of the session to the values stored in the database ECU object. Changing the node address starts an address claiming procedure, as described in the SAE J1939:Node Address property.

Changing the node address causes NI-XNET to start the interface; you must set any properties that are to be set before the interface starts before changing the node address. Also, note that setting the node address does not start the session. J1939 traffic is not retained by an input session until nxStart or nxRead are explicitly called.

You can assign the same ECU to multiple sessions running on the same CAN interface (for example, CAN1). All sessions with the same assigned ECU represent one J1939 node.

If multiple sessions have been assigned the same ECU, setting the SAE J1939:Node Address property in one session changes the address in all sessions with the same assigned ECU running on the same CAN interface.

For more information, refer to the SAE J1939:Node Address property.

SAE J1939:NodeName

Data Type Direction Required? Default
u64 Read/Write Yes 0

Property Class

XNET Session

Property ID

nxPropSession_J1939Name

Description

Note  This property applies to only the CAN J1939 application protocol. This property changes the name value of a J1939 session. The name is an unsigned 64-bit integer value. Beside the SAE J1939:Node Address property, the value is specific to the ECU you want to emulate using the session. That means the session can act as if it were the real-world ECU, using the identical address and name value.

The name value is used within the address claiming procedure. If the ECU (session) wants to claim its address, it sends out an address claiming message. That message contains the ECU address and the name value of the current session's ECU. If there is another ECU within the network with an identical address but lower name value, the current session loses its address. In this case, the session cannot send out further messages, and all addressed messages using the previous address of the current session are addressed to another ECU within the network.

The most significant bit (bit 63) in the Node Name defines the ECU's arbitrary address capability (bit 63 = 1 means it is arbitrary address capable). If the node cannot use the assigned address, it automatically tries to claim another random value between 128 and 247 until it is successful.

The name value has multiple bit fields, as described in SAE J1939-81 (Network Management). A single 64-bit value represents the name value within XNET.

For more information, refer to the SAE J1939:Node Address property.

SAE J1939:Maximum Repeat CTS

Data Type Direction Required? Default
u32 Read/Write No 2

Property Class

XNET Session

Property ID

nxPropSession_J1939MaxRepeatCTS

Description

Note  This property applies to only the CAN J1939 application protocol. This property limits the number of requests for retransmission of data packet(s) using the TP.CM_CTS message.

This property is related to handling the transport protocol.

SAE J1939:Number of Packets Received

Data Type Direction Required? Default
u32 Read/Write No 255

Property Class

XNET Session

Property ID

nxPropSession_J1939NumPacketsRecv

Description

Note  This property applies to only the CAN J1939 application protocol. This property changes the maximum number of data packet(s) that can be received in one block at the responder node.

This property is related to handling the transport protocol.

SAE J1939:Number of Packets Response

Data Type Direction Required? Default
u32 Read/Write No 255

Property Class

XNET Session

Property ID

nxPropSession_J1939NumPacketsResp

Description

Note  This property applies to only the CAN J1939 application protocol. This property limits the maximum number of packets in a response. This allows the originator node to limit the number of packets in the TP.CM_CTS message. When the responder complies with this limit, it ensures the sender always can retransmit packets that the responder may not have received.

This property is related to handling the transport protocol.

SAE J1939:Include Destination Address in PGN

Data Type Direction Required? Default
bool Read/Write No False

Property Class

XNET Session

Property ID

nxPropSession_J1939IncludeDestAddrInPGN

Description

Note  This property applies only to the CAN J1939 application protocol. Incoming J1939 frames are matched to an XNET database by the Parameter Group Number (PGN) of the frame. When receiving PDU1 frames, the destination address of the frame (J1939 PS field) is ignored when calculating the PGN, in accordance to the J1939 specification. This causes an XNET session to receive all frames that share the same PGN, making it difficult to distinguish destinations for traffic.

When set to True, this property instructs NI-XNET to include the destination address when extracting the PGN from the frame. This allows the same PGN sent to different destination addresses to be handled by separate input sessions.

This property may be set at any time. When set after session start, it will not affect frames already received.

The SAE J1939:Include Destination Address in PGN property is valid only for input sessions. It is not valid for stream sessions. This property affects all frames in a session.

SAE J1939:Timing:Hold Time Th

Data Type Direction Required? Default
f64 Read/Write No 0.5 s

Property Class

XNET Session

Property ID

nxPropSession_J1939HoldTimeTh

Description

Note  This property applies to only the CAN J1939 application protocol. This property changes the Hold Time Timeout value at the responder node. The value specifies the minimum delay between a TP.CM_CTS hold message and the next TP.CM_CTS message, in seconds.

This property is related to handling the transport protocol.

SAE J1939:Timing:Response Time Tr_SD

Data Type Direction Required? Default
f64 Read/Write No 0 s

Property Class

XNET Session

Property ID

nxPropSession_J1939ResponseTimeTrSD

Description

Note  This property applies to only the CAN J1939 application protocol. This property changes the Device Response Time value for specific destination messages (TP.CM_RTS/CTS messages). The value specifies the minimum delay between receipt of a message and sending a response. This value also specifies a minimum time delay between packets of a multipacket message directed to a specific destination.

According to the J1939 specification, the time between packets of a multipacket message directed to a specific destination may be 0 ms to 200 ms. Increasing the value of nxPropSession_J1939ResponseTimeTrSD can adversely affect performance in handling multipacket messages.

SAE J1939:Timing:Response Time Tr_GD

Data Type Direction Required? Default
f64 Read/Write No 0.05 s

Property Class

XNET Session

Property ID

nxPropSession_J1939ResponseTimeTrGD

Description

Note  This property applies to only the CAN J1939 application protocol. This property changes the Device Response Time for global destination messages (TP.CM_BAM messages). The value is the minimum delay between sending two TP.CM_BAM messages, in seconds. The recommended range is 0.05 s to 0.200 s.

This property is related to handling the transport protocol.

SAE J1939:Timing:Timeout T1

Data Type Direction Required? Default
f64 Read/Write No 0.75 s

Property Class

XNET Session

Property ID

nxPropSession_J1939TimeoutT1

Description

Note  This property applies to only the CAN J1939 application protocol. This property changes the timeout T1 value for the responder node. The value is the maximum gap between two received TP.DT messages in seconds.

This property is related to handling the transport protocol.

SAE J1939:Timing:Timeout T2

Data Type Direction Required? Default
f64 Read/Write No 1.25 s

Property Class

XNET Session

Property ID

nxPropSession_J1939TimeoutT2

Description

Note  This property applies to only the CAN J1939 application protocol. This property changes the timeout T2 value at the responder node. This value is the maximum gap between sending out the TP.CM_CTS message and receiving the next TP.DT message, in seconds.

This property is related to handling the transport protocol.

SAE J1939:Timing:Timeout T3

Data Type Direction Required? Default
f64 Read/Write No 1.25 s

Property Class

XNET Session

Property ID

nxPropSession_J1939TimeoutT3

Description

Note  This property applies to only the CAN J1939 application protocol. This property changes the timeout T3 value at the originator node. This value is the maximum gap between sending out a TP.CM_RTS message or the last TP.DT message and receiving the TP.CM_CTS response, in seconds.

This property is related to handling the transport protocol.

SAE J1939:Timing:Timeout T4

Data Type Direction Required? Default
f64 Read/Write No 1.05 s

Property Class

XNET Session

Property ID

nxPropSession_J1939TimeoutT4

Description

Note  This property applies to only the CAN J1939 application protocol. This property changes the timeout T4 value at the originator node. This value is the maximum gap between the TP.CM_CTS hold message and the next TP.CM_CTS message, in seconds.

This property is related to handling the transport protocol.

Table of Contents

Internal Development

Creating and Setting Up a gRPC Server

Server Security Support

Creating a gRPC Client

gRPC Client Examples

Session Utilities API Reference

Driver Documentation

gRPC API Differences From C API

Sharing Driver Sessions Between Clients

C API Docs
NI-DAQmx
NI-DCPOWER
NI-DIGITAL PATTERN DRIVER
NI-DMM
NI-FGEN
NI-FPGA
NI-RFmx Bluetooth
NI-RFmx NR
NI-RFmx WCDMA
NI-RFmx GSM
NI-RFmx CDMA2k
NI-RFmx Instr
NI-RFmx LTE
NI-RFmx SpecAn
NI-RFmx TD-SCDMA
NI-RFmx WLAN
NI-RFSA
NI-RFSG
NI-SCOPE
NI-SWITCH
NI-TCLK
NI-XNET
Clone this wiki locally