VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to detect the delete channel event in a custom device

Solved!
Go to solution

I am creating a custom device and want to detect when the delete (X) button on the system explorer is pressed.  This is so I can increment or decrement a counter in a folder (where the channel is under).  I didn't see any option in the UserEvent loop option.  How do I detect that a channel is being deleted?, I am sure this is easy, but I can't seem to figure it out.

 

Thanks!

0 Kudos
Message 1 of 3
(5,603 Views)
Solution
Accepted by joshe
Generally I would recommend not doing this... If you can avoid it. For example the parent folder can hopefully just do a get item children -> array size to count the channels rather than store a property that could get out of sync. I always try to design my devices to not store any property values for things I could go get.

that being said... Sometimes you do need this. You want an actionviondelete: https://decibel.ni.com/content/docs/DOC-30447
Stephen B
Message 2 of 3
(5,585 Views)

Thanks for the link and the advice.  I will try to think about the best way to implement this. 

0 Kudos
Message 3 of 3
(5,563 Views)