From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Custom Device Name from within Sub VI

Solved!
Go to solution

Hello All,

 

  I am writing an error handler that creates fault log files for all errors and warnings that are generated within a Custom Device.  One of the pieces of information that I would like to include in the file is the name of the Custom Device that the error handler is embedded in (because I run several custom devices in the same project).  I have been trying various classes of property nodes, and different refnums, but I have not been able to find anything that works.  The closest I have gotten is to get the name of the VI that my error handler is embedded in.  This of course is of very little use because the Custom Device file naming structure is always the same, (the error handler is always in the RT Driver VI).

 

  If anyone has a method to obtain the Custom Device name from within a Sub VI of the Custom Device, your advice would be greatly appreciated. 

 

Thanks much,

 

GSinMN     

0 Kudos
Message 1 of 6
(5,953 Views)

you should be able to pass the item reference (U64) of the custom device into the subVI, and then use NI VeriStand - Get Item Data.vi to get the name of the device

Stephen B
0 Kudos
Message 2 of 6
(5,944 Views)

Hello Stephen,

 

  Thanks for the quick response.  I see the VIs you mentioned, but it is unclear to me how to implement them.  From what I can see, an Item Reference is for anything contained within the custom device, but it can not refer to the custom device itself.  Also, the only options for getting the reference are by already knowing the name of the item, or by the path, both of which would require me to manually enter the name of the item I am trying to obtain automatically.  Not sure how to proceed.  Please advise.  Thanks.

 

GSinMN 

0 Kudos
Message 3 of 6
(5,939 Views)
Solution
Accepted by topic author GSinMN

the device item reference is passed into the custom device. if you wire that into the VI, you will get the name of the custom device

Stephen B
0 Kudos
Message 4 of 6
(5,937 Views)

Hello Stephen,

 

  I understand now.  Sorry for the confusion.  I see now that the item reference you spoke of is already part of the VI, and I just needed to attach to it.  I did not need to obtain the item reference with a separate VI.

 

  I implemented as you recommended, and it worked on the first try. 

 

Thanks for your assistance.

 

GSinMN 

Message 5 of 6
(5,935 Views)

Hello Stephen,

 

  I understand now.  Sorry for the confusion.  I see now that the item reference you spoke of is already part of the VI, and I just needed to attach to it.  I did not need to obtain the item reference with a separate VI.

 

  I implemented as you recommended, and it worked on the first try. 

 

Thanks for your assistance.

 

GSinMN 

0 Kudos
Message 6 of 6
(5,934 Views)