From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Get COM (Serial Port) Slot and Port physical location in Chasis

Code and Documents

Attachment

Overview

Get information on COM port by Slot and port in Chassis So you can know which physical output/input you use even if cards was swaped.

Description

VI pull Card information (Resource Name and Slot) using nisyscfg VI's and then it load niserial.dbs in ni-rt\system where you can find Visa Alias and Port by resource name.

Good solution for customer maintenance on-site of PXI system by switching malfunction cards without configuring COM port alias manually in NI-MAX.

The manual process is OK for experienced Technician but the on-site operator would have a problem to set new card COM alias, especially in viable systems.

Was tested only on system with PharLab OS

Steps to Implement or Execute Code

  1. If you already have Project file with Real-Time Target skip to step 4
  2. Create Blank Project
  3. Add Real-Time Target
  4. Add VI Example under Real-Time Target
  5. Run VI or add as SubVI

Requirements

Software

NI LabVIEW 2015

NI Real-Time

Hardware

Real-Time Target (Was tested only on PXI Real-Time Controller)

Realveant Links

Enumeration and Naming of NI-Serial Ports and Other PCI Devices

http://digital.ni.com/public.nsf/allkb/6511208D0D82A8C586256D18005F1545

Problem dwscription

http://forums.ni.com/t5/PXI/Get-information-on-Visa-serial-port-physical-location-slot-in/td-p/33303...


Or Hirshfeld

Application Enginner

SK-Electronika

Israel


SK Electonika Website - http://www.sk-advanced.com/category/electronics-1

Linnked-In Profile: https://www.linkedin.com/in/orhirshfeld

אור הירשפלד
Or Hirshfeld
Application Engineer
Certified LabVIEW Developer
SK- Electronika
+972-545844555
Or.Hirshfeld@SK-Advanced.com
il.linkedin.com/in/orhirshfeld

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

Comments
sreekanthkr
NI Employee (retired)
on

Hello,

 

I have a PXI system with 2 Serial cards. Each of the serial cards has 4 ports. The VISA resource name gets changed everytime i change the hardware slots. Is it possible to configure the port name programatically? 

I use windows 7 64 bit OS. 

Would appreciate any help.

 

Thanks,

Sreekanth

OrHirshfeld-SK
Member
Member
on

I pulled data from 2 different files and than updated one of them

i needed to know on which slot a card is connected and which COM ports are assinged to him

than i can rename the com ports according to what i need

 

it built for NI-RT PXI with Pharlab OS but as far as i know Pharlab is a stripped down Win OS so maybe it's similar

 

I know that in device manager you can manually change the com number so maybe there is way to change it progmatically by modifying Registry or linking to some windows function

 

i would also try to set the com name using NI-MAX

אור הירשפלד
Or Hirshfeld
Application Engineer
Certified LabVIEW Developer
SK- Electronika
+972-545844555
Or.Hirshfeld@SK-Advanced.com
il.linkedin.com/in/orhirshfeld
Contributors