VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom device delete itself

What is the recommended way for a custom device to delete itself from the system definition?

 

The scenario I'm working with is this: during my custom device initialization, the user selects a configuration file.  If the configuration file is invalid, then I want to give the user the option to pick a new file or cancel the add custom device operation.  In this case, the custom device will need to be able to delete itself if the user so chooses.  I have tried using the Delete Custom Device Item.vi, but this always gives me an error when the input is the custom device root reference.

 

Thanks!

Chris
Project Engineer
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 1 of 3
(5,142 Views)

The error is because the init vi is trying to delete the custom device before the main page has actually been added to the system def tree. The way the engine simulation and sensor simulation custom devices work around this, is instead of the init VI trying to delete the custom device... the init VI just sets a boolean "delete myself" property to true. Then when the main page inits, it checks that property and proceeds to delete itself if true.

 

That said, in my new designs, I put the browse on the main page instead of the init.

Stephen B
0 Kudos
Message 2 of 3
(5,134 Views)

Ah, makes sense.  Order of operations is important . . . 

 

Thanks Stephen!

Chris
Project Engineer
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 3 of 3
(5,125 Views)