Example Code

Rename CAN and LIN Ports for XNET Interfaces Programmatically

Code and Documents

Attachment

Overview

Demonstrates how to programmatically change the name for CAN and LIN Ports in XNET Interfaces

 

Description

This example uses the System Configuration VIs to discover XNET Interfaces with their corresponding CAN and LIN ports. After this, the user will be able to assign a new port name (alias) for each port.

 

Hardware and Software Requirements

Hardware:

-PXI, PCI, USB or C Series XNET Interface.

-The interface can be connected to the local system or to a remote Real-Time target.

 

Software:

-LabVIEW 2015 or later.

-System Configuration 15.0 or later.

-XNET 15.0 or later: Only needed if the interface is in the local system. If it is in a remote RT system XNET doesn't need to be on the local computer but it does need to be installed on the RT Target.

 

Steps to Implement or Execute Code

 

1. Set the target control to the device that has the XNET Interfaces. If the interface is connected as a local PXI, PCI or cDAQ card, keep it as localhost. If the card is connected in a remote Real-Time system browse to that target.
2. If connecting to a remote RT target, select the proper User Name and Password (if authentication has been set).
3. Run the VI. Available XNET Interfaces will be listed with their corresponding port and existing alias.
4. Enter the new alias and click on Submit Changes.

If the interfaces are not showing up, make sure you can see them first from NI-MAX.

Additional Information or References

This example has been modified from the LabVIEW shipped example Rename Aliases.vi to specifically work with XNET interfaces. The original example works for DAQmx and Visa interfaces.

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors