# How do I write a URCap to write data to UR Controller registers every 8 ms?

**URL:** <https://forum.universal-robots.com/t/how-do-i-write-a-urcap-to-write-data-to-ur-controller-registers-every-8-ms/290>\
**Category:** URCap Development\
**Created:** [October 10, 2016, 3:31pm UTC](https://forum.universal-robots.com/t/how-do-i-write-a-urcap-to-write-data-to-ur-controller-registers-every-8-ms/290 "2016-10-10T15:31:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon29083233](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@anon29083233](https://forum.universal-robots.com/u/anon29083233)\
**Post date:** [October 10, 2016, 3:31pm UTC](https://forum.universal-robots.com/t/how-do-i-write-a-urcap-to-write-data-to-ur-controller-registers-every-8-ms/290/1 "2016-10-10T15:31:47Z")

</div>

I need to write data from an external sensor to UR controller registers every 8 ms using a URCap. I have the MyDaemon URCap running.Where do I put the code to do this? I think that I know how to use UDP to read my data, and to use RTDE to put the data into the UR controller, but WHERE in the daemon do I put this code?

---

<div class="post-metadata">

**Author:** ![jbm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/jbm/32/614_2.png) [@jbm](https://forum.universal-robots.com/u/jbm)\
**Post date:** [October 10, 2016, 9:15pm UTC](https://forum.universal-robots.com/t/how-do-i-write-a-urcap-to-write-data-to-ur-controller-registers-every-8-ms/290/2 "2016-10-10T21:15:17Z")

</div>

@anon29083233

Check out the simple XML-RPC Math under [samples.](http://forum.universal-robots.com/t/urcaps-plugins-samples/93)  
(This shows how to implement an XML-RPC call in a daemon, so this is not what you are aiming to do. )  
However, it also shows how to make a very simple installation node, where you e.g. could use a checkbox to start/stop your daemon.

It shows how to use the `start()` and `stop()` methods to start and stop your daemon from the Java side.  
Then, you would have to write your daemon, that reads some e.g. force data, and writes it to the [RTDE interface](http://https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/)

Is this helpful?

Also check out the MyDaemon sample enclosed in the SDK.
