Address Claiming Procedure
- Updated2023-09-14
- 2 minute(s) read
Address Claiming Procedure
To obtain an address on the network, set the J1939/Node Name and J1939/Node Address properties or set the J1939/ECU property (which is equivalent to setting the other properties using the values in the ECU object in the database). After setting the Node Address (to a value less than 254), XNET sends an address claimed message and waits 300 ms for the response from the network. If no other node is using this address, there is no response to the message; after the timeout, the address is granted to the session and the session can transmit frames on the network.
Setting 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 setting Node Address. Setting the Node Address does not start the session. J1939 traffic is not retained by an input session until Start or Read are explicitly called.
During the claiming procedure, the node address property returns the null address (254), so you can poll this address until it gets a valid value.
If the address cannot be granted to the session (for example, when the name is not arbitrary and another node with higher priority uses the node address), the address is not granted. After timeout, the J1939 CommState indicates the reason for failed address claiming. If the node name is arbitrary address capable, NI-XNET tries to find another address and claim it. This procedure can take some time depending on how fast the other nodes respond to the address claimed message.
NI-XNET examples contain the address claiming procedure, which you can use in your applications.
The frames transmitted during address claiming are not passed to the J1939 input session. To see those frames, open a non-J1939 CAN session, which can be running parallel with a J1939 session on the same interface.