VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get alias list from Custom device

Solved!
Go to solution

Hi all

 

I'm trying to retrieve the list of alias from a Custom device and build a file containing the aliases list and the channel reference. I wanted to do that before the depoyment of my custom device (for example during the initialization phase) . I tryed differents way :

 

1) From the RT Driver, I get the Target Reference, and navigate through thr tree to get the Aliases Section. The problem is it seems you cannot get the aliases section. When i call Get Target Ref, i received the controller reference, then i managed to get the parent (Targets) ... but i cannot get the root node and then get the Aliases Section ...

 

2) After this i wanted to use the Execution API . I opened a connection to the Workspace, call the Vi Get Alias List ... But the problem is when i am in the Initialization phase of my custom device, it is not started yet, therefore it returns an error and cannot deploy

 

3) My last idea was to use the systemDefinitionAPI . But i don't know how to get the system definition file path from the custom device ....

 

I think i run out of idea... if anybody has a suggestion ....

0 Kudos
Message 1 of 8
(8,303 Views)

Hi Kaboom,

In the system definition API there are 3 classes that can be used: Aliases, AliasFolder and Alias to do it. I don't know if they are already wrapped into the LabVIEW tool palette but you can access them from the .NET connectivity. The problem may be licensing because I guess you need a VeriStand development license to access this API (To be confirmed by NI) and it could be an issue in case of a custom device. The better way would be to use the ClientAPI but I wonder if this works because the definition is currently being deployed (not yet deployed) at the moment you need the information.

0 Kudos
Message 2 of 8
(8,292 Views)

Hi Thumble

 

That was my 3rd idea: use the system definition API to get the alias list. The problem is, i don't know how to get the path of the system definition file from the custom device. In order to use this API you have to call a constructor (which use the path of the system definition file).

 

I don't know how to get this information programmatically either from the Main page or from the RT driver code ...

 

So my question is : is it possible to get the Alias list from a custom device ?

0 Kudos
Message 3 of 8
(8,283 Views)

UP

0 Kudos
Message 4 of 8
(8,163 Views)
Solution
Accepted by topic author kabooom

There is a function on the System Definition API you can call directly to translate a custom device reference into the corresponding system definition API node type. From that node type you can navigate to the root and then find all the aliases.

 

The class is called NodeIDUtil. See example below. Note there are also some other functions for translating the item reference into more specific node types, such as a custom device, channels, waveforms, etc. Example saved in 2012.

Jarrod S.
National Instruments
Message 5 of 8
(8,152 Views)

Hi Jarrod !

Thanks for your answer, i tried your solution and it works great.

 

I was trying to use the functions:

- "Item Reference to pointer" : to switch to the .NET API

- "To more specific Class" : to cast the node pointer into a base Node.

 

This return the error 1057. I replaced these 2 function with the "NodeIDUtil"  method and it works fine.

 

Thx

 

Message 6 of 8
(8,138 Views)

HI,

 

Getting the children nodes of Aliases there could be Folder types which are not required.

Any idea which property and/or method to use to determine if a child is a folder or not a channel?

 

thanks,

Glen

0 Kudos
Message 7 of 8
(2,610 Views)

gmr2017_0-1678303146043.png

OK so I figured out how to remove the items that were not Alias channels

How can I convert nodeID to a Channel Ref so that I can pass it down to the Engine

0 Kudos
Message 8 of 8
(2,595 Views)