Change the VISA Resource Names in a Real-Time Target

Updated Jan 6, 2023

Environment

Hardware

  • NI-9871
  • NI-9870

Driver

  • NI-VISA

I am using serial ports modules such as NI-9871 on a cRIO and I get an arbitrary enumeration of the serial ports. How can I set the enumeration of the ports?

The only way to re-write the configuration file with the VISA resource names enumeration is to reformat the target, install the drivers and then install the modules in the correct slots in the correct order to force the RT to enumerate as the user intends. The operating system will automatically set up the serial port enumeration as you connect the modules and will write its number in an internal configuration file.

Therefore, if you first insert a module of n ports on slot m, the configuration file will write the next n VISA resource names to match the module inserted in that slot. If you insert the same module in a different slot, it will again enumerate the ports with the next n numbers in the configuration file. This is done by the RT OS automatically as soon as it has the VISA drivers installed. 

After formatting a cRIO-9033 and installing the drivers, the OS will detect its 2 serial ports. In NI MAX, you will see its 2 ports enumerated as ASRL1 and ASRL2. Then, if you insert a NI-9871 in slot 4, NI MAX will enumerate its 4 ports as ASRL3, ASRL4, ASRL5, ASRL6.

If you remove the module and insert it in another slot, MAX will read the port visa resource name as ASRL7, ASRL8, ASRL9, ASRL10, even if there is no ports present with VISA resource names from ASRL3 to ASRL6.

See image below:


ASRL1 and ASRL2 will always show because they point to the cRIO's ports.