# Create a move Node with external digital Input

**URL:** <https://forum.universal-robots.com/t/create-a-move-node-with-external-digital-input/12560>\
**Category:** Java\
**Created:** [February 25, 2021, 10:15am UTC](https://forum.universal-robots.com/t/create-a-move-node-with-external-digital-input/12560 "2021-02-25T10:15:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon92786336](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@anon92786336](https://forum.universal-robots.com/u/anon92786336)\
**Post date:** [February 25, 2021, 10:15am UTC](https://forum.universal-robots.com/t/create-a-move-node-with-external-digital-input/12560/1 "2021-02-25T10:15:48Z")

</div>

Hello

I would like to program a URCap to set move Nodes with an external input (Hardware Button).  
When I click the Button I get an Error. I need Your help to solve this Problem. I used the (com.jbm.urcap.sample.visionTemplate) as tamplate. Enclosed my Java code to create the move Node and a picture of the Alarm.

Thanks in advance.

Timo

 ![ERROR](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/1/1e103375f2b0fb021267112c3e4819c86a74d4b3.jpeg) ![Java Code](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/1/18b6af8a1282479bf3b54c85982dde915da1a3cc.png)

---

<div class="post-metadata">

**Author:** ![anon71220377](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@anon71220377](https://forum.universal-robots.com/u/anon71220377)\
**Post date:** [February 25, 2021, 12:46pm UTC](https://forum.universal-robots.com/t/create-a-move-node-with-external-digital-input/12560/2 "2021-02-25T12:46:36Z")

</div>

As the node insert is from the template, it should be fine.

What is the calinput() method? Does it change the DataModel? What dous Stack Trace write?

If I had to guess, ther is something in calinput(), that changes the DataModel, that isn’t enclosed by an UndoRedoManager.

---

<div class="post-metadata">

**Author:** ![anon92786336](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@anon92786336](https://forum.universal-robots.com/u/anon92786336)\
**Post date:** [February 25, 2021, 2:59pm UTC](https://forum.universal-robots.com/t/create-a-move-node-with-external-digital-input/12560/3 "2021-02-25T14:59:54Z")

</div>

Thanks for help I have found the Error.  
From the method cal input () I get a boolean, when it is true then it creates a Move Node.

But I have now the problem I must do the same for a waypoint.  
When I create a Move Node I can’t create a waypoint below this. The Java Code is the same.

Need I am another root?  
Need I am a return from create a Move Node?

---

<div class="post-metadata">

**Author:** ![anon71220377](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@anon71220377](https://forum.universal-robots.com/u/anon71220377)\
**Post date:** [February 25, 2021, 3:06pm UTC](https://forum.universal-robots.com/t/create-a-move-node-with-external-digital-input/12560/4 "2021-02-25T15:06:02Z")

</div>

The addChild() method adds the node to the program tree and returns with a TreeNode. Using the returned TreeNode, you can insert Waypoints under the Move node.
