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: 

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,396 Views)
Solution
Accepted by topic author 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,378 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,356 Views)