From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

XNET CAN Interface already used?

Solved!
Go to solution

Hello,

 

I am running an XNET Signal single piont out session, it is a normal rest bus simulation with cyclic frames.

Now I have another code module, which uses a Frame Queued Out session on the same CAN interface.

At the initialization of the Frame Queued Out session, I want to know whether the interface is already initialized by another session. If not, I set the baud rate and the termination property for the Frame Queued Out session. Otherwise I let these settings as they are initialized by the other session.

 

If these properties are already set by another session, I get an error, because these can be only written when the interface is stopped.

How to do that?

0 Kudos
Message 1 of 2
(3,270 Views)
Solution
Accepted by topic author Madottati

Try using the XNET Read(CAN Comm State).vi. It will report what the current communication state is. If the interface has not been started it will return "Init". If the interface has been started it will return "Error Active" or "Error Passive".

Jeff L
National Instruments
0 Kudos
Message 2 of 2
(3,262 Views)