06-11-2013 08:31 AM
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 ....
Solved! Go to Solution.
06-12-2013 01:09 AM
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.
06-12-2013 06:37 AM
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 ?
07-23-2013 01:17 AM
UP
07-23-2013 09:18 AM
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.
07-24-2013 07:08 AM
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
03-08-2023 08:27 AM - edited 03-08-2023 08:27 AM
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
03-08-2023 01:20 PM
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