# RAPID - exec style statement

**URL:** <https://tech-community.robotics.abb.com/t/rapid-exec-style-statement/4540>\
**Category:** RobotStudio\
**Created:** [November 22, 2011, 4:44pm UTC](https://tech-community.robotics.abb.com/t/rapid-exec-style-statement/4540 "2011-11-22T16:44:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexsleat](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/alexsleat/32/4401_2.png) [@alexsleat](https://tech-community.robotics.abb.com/u/alexsleat)\
**Post date:** [November 22, 2011, 4:44pm UTC](https://tech-community.robotics.abb.com/t/rapid-exec-style-statement/4540/1 "2011-11-22T16:44:58Z")

</div>

I’m attempting to create a python wrapper which sends RAPID calls from a network connected control PC, without needing to hard-code each RAPID function I thought about using an ‘exec’ style statement to pass a string, which would allow the connect PC to control the arm.

In python, pascal and other languages it’s possible to execute strings as code. I have read through documentation and search the web but I haven’t found anything similar for RAPID. I figured it was worth a post to see if one does actually exist but isn’t documented or if anyone has attempted something similar and what direction they went with it.

Thanks for any input!

Alex

---

<div class="post-metadata">

**Author:** ![osku](https://avatars.discourse-cdn.com/v4/letter/o/dfb087/32.png) [@osku](https://tech-community.robotics.abb.com/u/osku)\
**Post date:** [November 23, 2011, 8:35am UTC](https://tech-community.robotics.abb.com/t/rapid-exec-style-statement/4540/2 "2011-11-23T08:35:22Z")

</div>

Hi

I think there is no feature what you described, but usually there is workarounds 🙂

One easy way could be to hard-code some parameterized Rapid procedures and just pass the needed parameters from PC.

Another way I have used in some cases is to build up a new Rapid module according to strings received from PC. So basically I have created a new Rapid module with Rapid (text file with correct format and .mod extension) and saved it as a file and opened it as a program module. It’s not so fast way, but maybe useful if your cycle time is not so critical.

-Osku

---

<div class="post-metadata">

**Author:** ![alexsleat](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/alexsleat/32/4401_2.png) [@alexsleat](https://tech-community.robotics.abb.com/u/alexsleat)\
**Post date:** [November 27, 2011, 7:07pm UTC](https://tech-community.robotics.abb.com/t/rapid-exec-style-statement/4540/3 "2011-11-27T19:07:44Z")

</div>

Thanks for the reply Osku,

Yeah I thought that was going to be the case, I was just hoping to avoid having to hard-code it. I did consider the other option too but I would prefer the hard-coded option.

Thanks again!

Alex
