Jump to content
Sign in to follow this  
iforgetmypassword

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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Sorry for getting such an old Post to live, but there is no other.

I want to connect to an OPC Server to.

Is there anyone that allready did something like that?

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×
×
  • Create New...