Jump to content

Connection to DLL (OPC/Automation)


Recommended Posts

Hi I'm trying to connect to dll which I found on below URL:

http://freedownloadscenter.com/Programming...r_Download.html

Code :

$dll = DllOpen("gbda_aut.dll")

$result = DllCall($dll, "str", "GetOPCServers")

msgbox(0, "", $result) ; number of chars returned

DllClose($dll)

And there is no answer - where I make a mistake?

PS. I have got OPC Servers in my computer.

Edited by iforgetmypassword
Link to comment
Share on other sites

i have no idea what OPC is but try this:

$oOpc = ObjCreate("OPC.Automation")
if @error Then Exit -1
$aServers = $oOpc.GetOPCServers()
for $i = 0 to UBound($aServers)
   ConsoleWrite($aServers[$i] & @CRLF)
Next

Dont forget to register the dll before doing that :)

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

Ok, I helps me but not in all problems.

Now I can saw list of OPCServers, even connect to server but I cann't get any Item or any Group.

All metods gives me a error: "The requested action with this object has faild"

For example i would like to see server groups so I write a code:

$oOpc = ObjCreate("OPC.Automation")

$connect = $oOpc.Connect("Matrikon.OPC.Simulation.1")

$time= $oOpc.StartTime

ConsoleWrite($time & CRLF)

$test = $oOpc.OPCServerGroups()

ConsoleWrite($test & CRLF)

Any help?

I can give you a OPC Server of Matrikon if it will help.

Link to comment
Share on other sites

  • 1 year later...
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...