02-02-2016 08:32 PM
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.
Solved! Go to Solution.
02-02-2016 10:01 PM
Are you using Windows or RT, and which resource where you trying to rename?
02-03-2016 01:04 PM
Im using Windows 7.
I have a number of resources I've been trying to rename using the API:
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.
02-04-2016 11:16 AM
Yep, that sounds like a bug for sure. I'll try to pass this info on to the respective group.
02-05-2016 03:24 PM
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.
02-05-2016 04:12 PM - edited 02-05-2016 04:22 PM
"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
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"