10-17-2019 09:44 AM
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) :
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:
I get an array of references to the interfaces. (Names here are read-only.)
Using those refs I can define various XNET sessions. All good so far.
To prepare for XCP comms, I define this string as the CAN_Port_ID.
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 .
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
Solved! Go to Solution.
10-22-2019 03:18 PM
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
10-25-2019 02:36 AM
Kay,
Thanks for the info. So my code is now:
...exporting the array of XNET interfaces. This is picked up here...
...where the String is extracted in the Format To String block. I would not have got that by myself, I suspect. So later on...
... 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