LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System Configuration 'Rename Alias' API doesn't update MAX

Solved!
Go to solution

If I run the 'nisyscfg.lvlib:Rename Alias.vi' from the System Configuration API I noticed that the new alias is NOT updated/relfected in MAX in the Devices and Interfaces tree.  

 

I confirmed that the Alias indeed changes via the API because browing a VISA Resource constant does show the new alias name.  I also confirmed that the 'Name' field in MAX is pointing to the same piece of data that the API changes by going to MAX -> Tools -> NI-VISA -> VISA Options -> General Settings -> Aliases; both the API and MAX will change this field.

 

Is this a known bug? Is there a work-around?  Hitting F5/Refresh, restarting MAX and even restarting the Embedded Controller did not fix the issue.


0 Kudos
Message 1 of 6
(4,914 Views)

Are you using Windows or RT, and which resource where you trying to rename?

0 Kudos
Message 2 of 6
(4,886 Views)

Im using Windows 7. 

 

I have a number of resources I've been trying to rename using the API:

  • PXIe-4112
  • PXIe-4139
  • PXIe-5114
  • PXIe-2725
  • PXIe-2727
  • Pickering Mux
  • Pickering Matrix
  • External Power supply on USB Bus

I've been playing around with it some more and the odd thing is that when I use the API to rename all of the NON-NI devices (the Pickering Mux + Matrix and the External PS), their Alias/Name updates immediately in MAX after the API call; no refresh needed.  All of the NI devices remain with their old alias name "PXISlot#" even though I've confirmed that their Alias has indeed changed via the VISA Options -> Aliases screen.


0 Kudos
Message 3 of 6
(4,842 Views)

Yep, that sounds like a bug for sure.  I'll try to pass this info on to the respective group.

0 Kudos
Message 4 of 6
(4,821 Views)
Solution
Accepted by topic author SeanDonner

When you make the call to Find Hardware.vi, I bet you're limiting the search to "ni-visa" in the Experts parameter. When you rename the devices, you're changing the NI-VISA alias alright. What you've done essentially changes the view of VISA but not the rest of the NI architecture. So when you see the device in MAX, the NI products don't actually use VISA as the communication mechanism, even though NI-VISA does see those devices and report on them. Recall that different drivers may have different alias storage locations; for example, IVI is yet another place that you could have a separate name for the resource.

 

To change the alias for all devices that you see in MAX, you can't limit the Experts that participate in the query. The better way would be to create a filter that sets "Is Device" to true and pass that into Find Hardware instead. Then when you call Rename on those resources, it will have the intended effect.

Message 5 of 6
(4,794 Views)

"When you make the call to Find Hardware.vi, I bet you're limiting the search to "ni-visa" in the Experts parameter"

 

Great guess, I was doing exactly that.  I had thought it was necessary* to set "ni-visa" as the expert because the "System Filter" I'm using to pick out the correct device to rename is the devices corresponding NI-VISA Resource String.   Apparently I was wrong and removing the expert input altogther fixed everything right up.

 

(*) I thought it was necessary because a VI I created to enumerate all my devices and write their properties to a file (Slot#, Vendor#, Model#, Resource & Alias) required me to set the expert to "ni-visa" otherwise the Alias property would be blank and the resource string I got was some GUID like string which I didn't want.

 

Thanks!

 

P.S.

For my device enumeration VI I was getting unwanted resources if I used the filters: IsDevice == True && ConnBusType == PXI/PCI.   I was getting things such as the BACKPLANE, the GPIB bus as well an Intel QM87 LPC Controller.  All I want are the physical devices plugged into the chassis so my fix was to query each of the returned resources for their Slot# and throw out ones that are not in the range of 2 --> 18 inclusive.  Is there a cleaner approach to accomplish this?  See 2nd picture below

 

reanameDev.png

 

devEnum.png

 

Sample from the Device Configuration INI file

[Device 2]
Slot Number = "2"
VendorName = "National Instruments"
ProdName = "NI PXIe-4112"
Resource = "PXI18::0::INSTR"
Alias = "PSU"

Message 6 of 6
(4,775 Views)