Accessing a windows DLL from InTouch


Thread Starter

Neil McPhail - BIS

Hi All,

I need to access a DLL that is written in C or C++ from within an InTouch script. Should I anticipate major effort or is this a no-brainer? I am currently assuming that it is indeed possible without taking a PhD course in computer science.

Thanks in advance

Neil McPhail
Systems Engineer
Hatch Africa

Leighton Toews

Intouch Wonderware does not really have a "programming" capacity, it does indeed have a fairly versatile scripting language which allows one to be fairly tricky, however it does not posses the language necessary to make external calls to DLL's. This can be accomplished in a more round about fashion however, depending on what it is you want from the DLL, as it is
relatively easy to establish multiple DDE conversations within Wonderware. This would entail you writing code in either VC or VB in order to access the DLL in question, then conditioning the results of your DLL actions and
passing them to Wonderware via DDE. This will only work in some cases though, such as information passing and such, a clever person might be able to get more out of it, though it really depends on the application. I have
had to perform similar tasks in the past in order to work around bugs in wonderware (surprise surprise). Depending on the version of Wonderware
which you are using you can also implement an ActiveX object, of course this also means writing external code, likely in VC++, but if it is real
functionality you are looking for out of your desire to access a DLL, then this is likely the best solution. You shouldn't require a mere PhD in order to pull this off as long as you wear your blinders so that you don't become thoroughly entangled in the web that is MFC.

Leighton Toews
Automation Technologist
Deltech Industries Inc.

Steve Reichard


It is not very hard if you are comfortable with calling one DLL from another DLL. Wonderware offers a script function toolkit as part of
their Extensibility Toolkit. Basically, their script SDK lets you create your own InTouch script functions, which are really just plain
DLLs with certain functions exported in a certain format. If you're able to modify the DLL that you're calling, you could even combine the
two DLL's into one DLL.

I suggest that you contact Wonderware tech support and try to talk to someone who knows a lot about the Ext. Toolkit.

> I need to access a DLL that is written in C or C++ from within an InTouch
> script.

Steve Reichard
Reichard Software
Tel: (614) 889-8500
Fax: (614) 889-8555
Email: [email protected]
InTouch dose not support API call.

However, it can support ActiveX controls via events and properties.

Ask the programmer who coded the DLL to modify his app into an OCX.(shouldn't be tough)

I've used such scheme to implement advanced control algorithms written in C++ and it works just fine.

Amir Or
Galil Engineering
Process Control & Instrumentation department