# ProgramNodes can detect when removed or suppressed

**URL:** <https://forum.universal-robots.com/t/programnodes-can-detect-when-removed-or-suppressed/3888>\
**Category:** Product Wishlist\
**Created:** [March 20, 2019, 7:19am UTC](https://forum.universal-robots.com/t/programnodes-can-detect-when-removed-or-suppressed/3888 "2019-03-20T07:19:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon58840761](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@anon58840761](https://forum.universal-robots.com/u/anon58840761)\
**Post date:** [March 20, 2019, 7:19am UTC](https://forum.universal-robots.com/t/programnodes-can-detect-when-removed-or-suppressed/3888/1 "2019-03-20T07:19:09Z")

</div>

As an UR+ developer I would like via the SDK to detect when a user has removed/disabled a programnode from the program tree by either deleting, cut or suppressing the node.  
Since I wan’t to be able to handle global states correctly after the node has disappeared. I find this feature to be quite important since a program node even though deleted aren’t disposed/freed from memory right away.

---

<div class="post-metadata">

**Author:** ![anon57702353](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@anon57702353](https://forum.universal-robots.com/u/anon57702353)\
**Post date:** [April 10, 2019, 9:16am UTC](https://forum.universal-robots.com/t/programnodes-can-detect-when-removed-or-suppressed/3888/2 "2019-04-10T09:16:52Z")

</div>

Is there a workaround for this? Or any plan to implement it?

Federico

---

<div class="post-metadata">

**Author:** ![m.birkholz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/m.birkholz/32/7084_2.png) [@m.birkholz](https://forum.universal-robots.com/u/m.birkholz)\
**Post date:** [April 10, 2019, 10:05am UTC](https://forum.universal-robots.com/t/programnodes-can-detect-when-removed-or-suppressed/3888/3 "2019-04-10T10:05:13Z")

</div>

i absolutely agree this would be a nice feature.  
i’m actually using urcaps capsuled inside a urcap which can manage the deletion of child urcap nodes as a workaround for that but i don’t know if that fits your needs.  
functions like onDelete() or onSupress() inside the Contribution class, triggered just before calling the action would be nice 🙂

---

<div class="post-metadata">

**Author:** ![dmartin](https://avatars.discourse-cdn.com/v4/letter/d/c4cdca/32.png) [@dmartin](https://forum.universal-robots.com/u/dmartin)\
**Post date:** [April 15, 2019, 5:15am UTC](https://forum.universal-robots.com/t/programnodes-can-detect-when-removed-or-suppressed/3888/4 "2019-04-15T05:15:27Z")

</div>

Hi there! I agree with @anon58840761 . I think this, as well as other related node information, should have a easy way to be accessed.  
For the URCap I’ve been develping I needed to know the total count of my nodes that were active (not supressed) in the user program.

These were some of my needs and the things I found out:

- My program needs to know my node count nearly from the beginning of the user code

- My URScript generation Java methods are called when the user press play or when the program is saved

- Installation node is called first, the each ‘active’ (non supressed) node in the order it appears in the tree.

After some researching I ended up with the following workaround:

- In my Installation Node URScript generation Java method: I reset to 0 a Java variable to hold the count, defined in the installNodeContrib class.
- In the URScript generation Java method for each of the nodeContrib I want to count, I increased this var
- Each time this Java var is updated, it is passed via socket to a Python daemon, using JSON in my case
- This daemon sends this count to the user program script code, at runtime. How? I connect python daemon with robot via RTDE. And in the Script generation for my installation node I define and run a thread that continuosly checks this value from RTDE and updates a global variable. This variable I use later in the URScript generated for each node.

Long way… should be an easier one, right?

If you need help with this tell me.

---

<div class="post-metadata">

**Author:** ![anon65872039](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@anon65872039](https://forum.universal-robots.com/u/anon65872039)\
**Post date:** [May 9, 2019, 6:25am UTC](https://forum.universal-robots.com/t/programnodes-can-detect-when-removed-or-suppressed/3888/5 "2019-05-09T06:25:07Z")

</div>

I would like to second this request. The proposal of @dmartin shows how much extra work is needed just to get an actual count of his nodes. We need to figure out which exact nodes are active/passive/deleted for communicating and visualizing correctly with our backend , which is even more work, if at all possible.

Best Thomas

---

<div class="post-metadata">

**Author:** ![anon65613222](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@anon65613222](https://forum.universal-robots.com/u/anon65613222)\
**Post date:** [July 11, 2019, 6:27am UTC](https://forum.universal-robots.com/t/programnodes-can-detect-when-removed-or-suppressed/3888/6 "2019-07-11T06:27:40Z")

</div>

I would also like to second this request.  
I would like to have a thread that runs as long as the node is active, but it just keeps running as it is now.

---

<div class="post-metadata">

**Author:** ![s\_c](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@s\_c](https://forum.universal-robots.com/u/s_c)\
**Post date:** [April 14, 2021, 3:51pm UTC](https://forum.universal-robots.com/t/programnodes-can-detect-when-removed-or-suppressed/3888/7 "2021-04-14T15:51:38Z")

</div>

Hi everyone,  
there’s some news about these issues?
