Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Identification of port / interface through XNET / ECU M&C Toolkit

Solved!
Go to solution

Hi,

 

I am confused about how to properly identify interfaces programatically.  Here is what I have (using LV2018 SP1 / XNET 18.5 / ECUMC 19.1) :

XNET-1.PNG

A PXI rack with one 2-port XNET card.  At the moment these interfaces are named 'CAN1' & 'CAN2'.  Sometimes these names swap over for no apparent reason, which may be why I am having trouble.  

Q1.  I know I can set these XNET interface names in MAX, but can I set them in LabVIEW?

 

Meanwhile, in the project code:

XNET-2.PNG

I get an array of references to the interfaces.  (Names here are read-only.)

XNET-3.PNG

Using those refs I can define various XNET sessions.  All good so far.  

 

XNET-4.PNG

To prepare for XCP comms, I define this string as the CAN_Port_ID.

 

XNET-5.PNG

That string is read, along with the protocol name 'XCP' into the ECU Select VI.  

Q2. Does the String defined above need to correspond with the XNET interface name?  I suspect so.

 

Into the bottom of the MC ECU Select vi is a Ring constant ECUMC interface identity image.png.  

Q3. How does this identity relate to the XNET interface?  Is there some way to programtically determine what the ref should be for a given XNET port?

 

Thanks all!

Ian

0 Kudos
Message 1 of 3
(2,507 Views)
Solution
Accepted by topic author IanDeaville(ZF)

Hi,

you can browse and reconfigure the XNET interface names by using the "System Configuration API" VIs.

Use e.g. "XCP:CAN1@nixnet" as "Protocol and Interface", where "CAN1" is the name of the XNET interface set in MAX.

The "interface" input is used for older NI-CAN hardware only and can be ignored for NI-XNET hardware.

Kay

0 Kudos
Message 2 of 3
(2,438 Views)

Kay,

Thanks for the info.  So my code is now:

XNet10.PNG

...exporting the array of XNET interfaces.  This is picked up here...

xnet11.PNG

...where the String is extracted in the Format To String block.  I would not have got that by myself, I suspect.  So later on...

xnet12.PNG

... we can select the XNET interface without any constant values, and with the old NI-CAN reference disconnected.  This all seems to work fine!

 

I will take a look through the System Configuration VIs later on, but for now this seems to have done the trick.

 

Regards,

Ian

 

0 Kudos
Message 3 of 3
(2,419 Views)