# Event Manager Calls VSTA Macro Twice

**URL:** <https://tech-community.robotics.abb.com/t/event-manager-calls-vsta-macro-twice/3351>\
**Category:** RobotStudio\
**Created:** [February 10, 2010, 6:05am UTC](https://tech-community.robotics.abb.com/t/event-manager-calls-vsta-macro-twice/3351 "2010-02-10T06:05:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![matt.r.murray](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@matt.r.murray](https://tech-community.robotics.abb.com/u/matt.r.murray)\
**Post date:** [February 10, 2010, 6:05am UTC](https://tech-community.robotics.abb.com/t/event-manager-calls-vsta-macro-twice/3351/1 "2010-02-10T06:05:18Z")

</div>

Hello,  
I am developing a simulation of a robot picking products from an external axis and adding them to a pallet. I have created a macro that can import a library file representing the product and attaches it to the external axis.

When I run the macro from RobotStudio → Add-In tab, right-click → Macro\_ImportFile - \> click Run Macro button, it works perfectly and calls the macro only once, and attaches only one product to the external axis. It does this everytime I push the button, no problems.

When I create a station signal Digital1 that calls the VSTA Macro when Digital1 goes high, the Macro is called twice, thus attaching two products to the station. This is the only event in the event manager, and nothing else should be calling the Macro. There is also only one Macro\_ImportFile() call within the VSTA code.

Any ideas anyone?

Thanks,  
Matt.

---

<div class="post-metadata">

**Author:** ![matt.r.murray](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@matt.r.murray](https://tech-community.robotics.abb.com/u/matt.r.murray)\
**Post date:** [February 10, 2010, 7:52am UTC](https://tech-community.robotics.abb.com/t/event-manager-calls-vsta-macro-twice/3351/2 "2010-02-10T07:52:22Z")

</div>

Just to note, this only happens in this particular project station. i.e. When the same macros are called from the event manager in another project, the macros are only called once.

---

<div class="post-metadata">

**Author:** ![Oyvind](https://avatars.discourse-cdn.com/v4/letter/o/e68b1a/32.png) [@Oyvind](https://tech-community.robotics.abb.com/u/Oyvind)\
**Post date:** [February 15, 2010, 8:03am UTC](https://tech-community.robotics.abb.com/t/event-manager-calls-vsta-macro-twice/3351/3 "2010-02-15T08:03:13Z")

</div>

Hi

I had the same problem in one of my stations. It turned out that my VSTA Add-In was loaded twice. It was loaded under “VSTA Station Add-Ins” and “VSTA User Add-Ins”.  
I unloaded it from “VSTA User Add-Ins” (so it was colored gray insted of blue) and it worked fine.

Hope this may help.

---

<div class="post-metadata">

**Author:** ![matt.r.murray](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@matt.r.murray](https://tech-community.robotics.abb.com/u/matt.r.murray)\
**Post date:** [February 17, 2010, 6:05pm UTC](https://tech-community.robotics.abb.com/t/event-manager-calls-vsta-macro-twice/3351/4 "2010-02-17T18:05:41Z")

</div>

Hi Oyvind,

I realised this after a while and noted how it reloads the VSTA Add-Ins every time that the code is recompiled.

Thanks,  
Matt.

---

<div class="post-metadata">

**Author:** ![Oyvind](https://avatars.discourse-cdn.com/v4/letter/o/e68b1a/32.png) [@Oyvind](https://tech-community.robotics.abb.com/u/Oyvind)\
**Post date:** [February 17, 2010, 6:08pm UTC](https://tech-community.robotics.abb.com/t/event-manager-calls-vsta-macro-twice/3351/5 "2010-02-17T18:08:49Z")

</div>

Yes, it does that in my application also. It reloads the VSTA Add-Ins under “Station Add-ins” AND “User Add-ins” every time I compile

Very annoying…

---

<div class="post-metadata">

**Author:** ![Oyvind](https://avatars.discourse-cdn.com/v4/letter/o/e68b1a/32.png) [@Oyvind](https://tech-community.robotics.abb.com/u/Oyvind)\
**Post date:** [February 17, 2010, 6:09pm UTC](https://tech-community.robotics.abb.com/t/event-manager-calls-vsta-macro-twice/3351/6 "2010-02-17T18:09:52Z")

</div>

Maybe we are doing something wrong? Anyone care to comment?

---

<div class="post-metadata">

**Author:** ![matt.r.murray](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@matt.r.murray](https://tech-community.robotics.abb.com/u/matt.r.murray)\
**Post date:** [February 19, 2010, 12:19pm UTC](https://tech-community.robotics.abb.com/t/event-manager-calls-vsta-macro-twice/3351/7 "2010-02-19T12:19:13Z")

</div>

Hi Oyvind,

I created a new Add-In and immediately after saving added this new Add-In to my station. From here it ony appears under the “VSTA Station Add-Ins” and no longer duplicated in the “VSTA User Add-In” lists. From here I copied my code over to the new Add-In. This is worth doing if you have a lot of debugging to do.

Good luck,  
Matt.
