Call COM methods using ActiveXComponent

I'm trying to call COM methods using ActiveXComponent in a vision 7.9 project. I downloaded "jacob-1.21.zip" from Releases · freemansoft/jacob-project · GitHub. This includes files "jacob.jar" and "jacob-1.21-x64.dll". I copied the .jar file to "C:\Program Files\Inductive Automation\Ignition\lib\core\common" and the .dll to "C:\Windows\System32". Restarted the gateway and on first line of script

from com.jacob.activeX import ActiveXComponent

ImportError: No module named jacob

Tried copying these files to other locations with no luck (restarting gateway as appropriate). Is there more to importing these third party tools than just copying them to the right location?

Can you look at the logs for the Client or when launching a Designer and see if that JAR is getting downloaded?

I can't remember if it was required that you manually apply pack200 compression to JARs that were destined for the Client or Designer (that's why there is a .pack.gz version of the JARs in those directories).

Also - where are you executing this script from?

I don't see anything indicating that the JAR is being downloaded.
Designer Output console on startup:

INFO [main-Designer-Startup] Downloading... [+0]
INFO [main-Designer-Startup] Cleanup... [+786]
INFO [main-Designer-Startup] Initializing UI... [+786]
INFO [Gateway-Designer-Startup] Starting up polling tag manager, polling rate: 250 ms
INFO [main-Designer-Startup] Starting module: Vision [+1402]
INFO [main-Designer-Startup] Starting module: Reporting [+3306]
INFO [Designer-Designer-Startup] Starting up Reporting Module. Mode: Activated
INFO [main-Designer-Startup] Starting module: Alarm Notification [+3475]
INFO [main-Designer-Startup] Starting module: SFC [+3528]
INFO [main-Designer-Startup] Starting module: OPC-UA [+3611]
INFO [main-Designer-Startup] Starting module: Serial Support Client [+3613]
INFO [main-Designer-Startup] Starting module: SQL Bridge [+3625]
INFO [main-Designer-Startup] Starting module: Symbol Factory [+3783]
INFO [main-Designer-Startup] Initializing Scripting... [+3789]
INFO [main-Designer-Startup] Starting Tag System... [+3820]
INFO [main-Designer-Startup] Initializing UI... [+3834]
INFO [Gateway-SQLTags-TreeLoader-thread-1] Starting tag polling.

The log viewer also shows no info regarding downloading any JAR files. Same for the console and log viewer when launching a client.

I have tried executing this from the designer script console, on a button in the designer, and on a launched client. Same results for each.

I'm about 90% sure this is required in 7.9. OP, try manually running the pack200 executable in your Java install directory to compress the .jar files, in the same place you have the existing files.

1 Like