NI-XNET Compatibility With CAN Partial Networking

Updated Jul 6, 2023

Reported In

Driver

  • NI-XNET

Issue Details

Does NI offer any alternatives to operate in CAN Partial Network applications? 
How is CAN Partial Networking implemented by NI? 

Solution

This article aims to briefly describe the principles behind CAN partial networking systems and explains how NI hardware can be configured to operate in these systems using the NI-XNET API.
 
To understand partial networking it is required to discuss about the modes of operation of CAN transceivers. In general terms, three modes of operation that impact the power consumption on the system are contemplated: normal mode, standby mode, and sleep mode.

Normal mode is the highest power consumption mode of the transceiver and is where the CAN or CAN FD communication takes place. Standby mode is the transition state between normal and sleep mode, in this state, the transceiver is waiting for the network master to initiate communication, this action will put the transceiver back into normal mode. Sleep mode is the lowest power consumption mode the transceiver can reach, in this state, only the CAN transceiver's low-power receiver is active in the ECU. If a transceiver supports Sleep mode it will not support Standby mode and vice versa.
 
When ECUs are placed into sleep mode, a wakeup pattern or frame starts the wakeup process for every node on the network, the master can control if the ECU will transition from sleep mode to either normal or some additional modes of operation defined in the NI-XNET API.
 
In summary, devices capable to work in CAN Partial Networking applications must be able to go into sleep (or standby) mode and normal mode on command. This can be achieved using the NI-XNET API, specifically the property called Intf.CAN.TcvrStatesince this is a read/write property, it can be used to programmatically configure the CAN transceiver state. This property accepts the following values:
 
image.png


Normal

This state sets the transceiver to normal communication mode. If the transceiver is in the Sleep (or standby) mode, this performs a local wakeup of the transceiver and CAN controller chip.
 

Sleep 

Sets the transceiver and CAN controller chip to Sleep (or standby) mode. Once the transceiver enters this state, it is not possible to resume communications until a local or remote wakeup occurs. A local wakeup occurs when the application sets the transceiver state to either Normal or Single Wire Wakeup. A remote wakeup occurs when a remote node transmits a wakeup frame through the CAN network. If the interface has not been started, setting the transceiver to Sleep mode returns an error.
 

Single Wire Wakeup 

Sets a Single Wire transceiver into the Single Wire Wakeup Transmission mode, which forces the Single Wire transceiver to drive a higher voltage level on the network to wake up all sleeping nodes. Other than this higher voltage, this mode is similar to Normal mode. CAN frames can be received and transmitted normally. If you are not using a Single Wire transceiver, setting this state returns an error. If your current mode is Single Wire High-Speed, setting this mode returns an error.
 

Single Wire High-Speed

Sets a Single Wire transceiver into Single Wire High-Speed Communication mode. This mode has no relationship to High-Speed transceivers and cannot be used in conjunction with Sleep mode. If you are not using a Single Wire transceiver, setting this state returns an error.

Additional Information

The NI-XNET driver includes LabVIEW shipping examples that demonstrate how the sleep and wakeup functions can be implemented to control the state of the transceiver, these example VI's are located under Help >> Find Examples >> Hardware Input and Output >> CAN >> NI-XNET >> Sleep and Wakeup