Tool/software:
I wanted to detect which node is arbitration winner on CAN network. After sending PGN over j1939 I am checking for TxOk bit of
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
I wanted to detect which node is arbitration winner on CAN network. After sending PGN over j1939 I am checking for TxOk bit of
Hi Tejaswinee,
Arbitration is done by the CAN protocol itself and the node ID with the lowest address always has the highest priority to transmit if there are multiple nodes that are attempting to transmit. Just curious why you needed to identify the node that won the arbitration manually. Looks like you will be monitoring the arbitration for the transmitting node as you are looking at TxOk status, right? Since there will be multiple transmitting nodes, how will you be able to detect the transmitting nodes simultaneously? Probably better to monitor this on a receiving node and recording the node ID (which is part of the CAN frame) in the order that is was received. You can use a timer in the CAN ISR (when a message is received) to time the order of frames as they are received.
Regards,
Joseph
hi Joseph,
Thank you for looking into this. We are having application where multiple control units will be communicating on J1939 CAN network and one who will win the arbitration will be the master. and henceforth only master will send the request for data. Once one master is decided others will go in listening mode. My code which will go on control units shall work as,
1. Consider first time transmission of proprietary PGN, No one is master on network yet. Send proprietary PGN and check if transmission is successful, if yes then current node will win the arbitration and is master. current node will claim the bus and announce over network that I am the master over proprietary PGN.
2. Consider someone is already master over network go in listening mode and do not send PGN
Thank You,
Tejaswinee
Hi Tejaswini,
I'm assuming that you are using the CAN-FD module in F28388S device since you are dealing with J1939. We do not have software examples for this application but can provide some suggestions on how this may be carried out. Based from your description, and assuming that each node is also set to receive as well as transmit messages, I would conclude that any node that has not completed frame transmission and has received a CAN frame is not the arbitration winner. The arbitration winner will be the node that has successfully transmitted a frame and has not received any CAN frame at all. Based from these assumptions, you can follow below steps:
Regards,
Joseph