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.
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.
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.
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.