# How to get payload in Java

**URL:** <https://forum.universal-robots.com/t/how-to-get-payload-in-java/8169>\
**Category:** URCaps SDK\
**Created:** [July 16, 2020, 7:07am UTC](https://forum.universal-robots.com/t/how-to-get-payload-in-java/8169 "2020-07-16T07:07:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon55960246](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@anon55960246](https://forum.universal-robots.com/u/anon55960246)\
**Post date:** [July 16, 2020, 7:07am UTC](https://forum.universal-robots.com/t/how-to-get-payload-in-java/8169/1 "2020-07-16T07:07:35Z")

</div>

Hello everyone,

Who can tell me how to get payload value in Java with the TCP Configuration under the Installation Tab.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![sko](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/sko/32/573_2.png) [@sko](https://forum.universal-robots.com/u/sko)\
**Post date:** [July 21, 2020, 2:34pm UTC](https://forum.universal-robots.com/t/how-to-get-payload-in-java/8169/2 "2020-07-21T14:34:13Z")

</div>

Hello,

you can try out the following example:

> [@URCap Sample: URScript Communicator examples](https://forum.universal-robots.com/t/sample-urscript-communicator-examples/3093):
>
> URScript Communicator Description of functionality: Allows the developer to: Send URScript to URControl, i.e. by user action (button) Extract a value calculated in URScript into the URCap (or Java in general) What topics are covered: Secondary Client interface, extract data from URScript, secondary program [Find it on Github!](https://github.com/BomMadsen/URCap-ScriptCommunicator) Requirements: URCaps SDK v. 1.3 (due to Swing UI implementation) But \*.communicator classes can run with most version of PolyScope.

This should give the needed function from the available Script Functions of the robot.

---

<div class="post-metadata">

**Author:** ![anon55960246](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@anon55960246](https://forum.universal-robots.com/u/anon55960246)\
**Post date:** [July 23, 2020, 6:00am UTC](https://forum.universal-robots.com/t/how-to-get-payload-in-java/8169/3 "2020-07-23T06:00:07Z")

</div>

Thank you very much.

---

<div class="post-metadata">

**Author:** ![anon55960246](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@anon55960246](https://forum.universal-robots.com/u/anon55960246)\
**Post date:** [July 24, 2020, 8:09am UTC](https://forum.universal-robots.com/t/how-to-get-payload-in-java/8169/4 "2020-07-24T08:09:49Z")

</div>

It works perfectly. Thanks to @sko and @jbm.

---

<div class="post-metadata">

**Author:** ![anon39333270](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@anon39333270](https://forum.universal-robots.com/u/anon39333270)\
**Post date:** [September 11, 2020, 8:35am UTC](https://forum.universal-robots.com/t/how-to-get-payload-in-java/8169/5 "2020-09-11T08:35:56Z")

</div>

Sorry for reopen once more this old question, but I think it should actually be implemented directly into the API for URCap development.  
(Payload and Center of Gravity)

> [@Add/change Payload and Center Of Gravity to allow for per-TCP values](https://forum.universal-robots.com/t/add-change-payload-and-center-of-gravity-to-allow-for-per-tcp-values/8510):
>
> Summary Add a way to associate Payload and Center Of Gravity with a TCP in both Polyscope and URCap API. What is it? Per-TCP Payload and Center Of Gravity settings for easier use where flange-mounted items/tools are changed either manually or dynamically (tool changer). Currently this must be done using Set nodes (can only do payload) or URScript. As this would be saved in the TCP settings, Move nodes, and similar, where you can change the TCP, would check if it has an associated Payload-COG …
