# Read General Purpose Register in URCap

**URL:** <https://forum.universal-robots.com/t/read-general-purpose-register-in-urcap/4027>\
**Category:** Robot Communication\
**Created:** [April 5, 2019, 7:54am UTC](https://forum.universal-robots.com/t/read-general-purpose-register-in-urcap/4027 "2019-04-05T07:54:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.briedenhann](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@chris.briedenhann](https://forum.universal-robots.com/u/chris.briedenhann)\
**Post date:** [April 5, 2019, 7:54am UTC](https://forum.universal-robots.com/t/read-general-purpose-register-in-urcap/4027/1 "2019-04-05T07:54:35Z")

</div>

I am trying to read the General purpose register into a URCap using the getRobotData example, this works but I need to read from  
port 30004, not 30003. as soon as I change the port number and run it in URSim, it freezes.

Is there any example for reading from port 30004 in Java.

Thanks

---

<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:** [April 8, 2019, 6:57am UTC](https://forum.universal-robots.com/t/read-general-purpose-register-in-urcap/4027/2 "2019-04-08T06:57:17Z")

</div>

RTI on 30003 and RTDE on 30004 use different protocols.  
So this example cannot just be changed by port-number.

You should inspect the [RTDE Guide](https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/real-time-data-exchange-rtde-guide-22229/) - particularly the Python example, in order to communicate successfully with RTDE.
