konimarti / opc

OPC DA client in Golang for monitoring and analyzing process data based on Windows COM.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GetOPCServers return empty string array?

giter opened this issue · comments

commented

with code:
`

			object, err := opc.NewAutomationObject()

			if err != nil {
				panic(err)
			}

			fmt.Println(object.GetOPCServers(""))

`
while result is:

2019/06/25 12:57:26 Loaded OPC Automation object with wrapper OPC.Automation.1
[]

but i actually have a local Graybox.Simulator

commented
commented

@konimarti Yes I tried , nothing changed..
image

Maybe it's a 32/64 bit issue with the OPC wrapper. If the OPC server running on your localhost is 32bit and your app is compiled with 64bit then it might not work:
image

Can you try it with opc-cli compiled with $ENV:GOARCH="386"?

commented

Yes with GOARCH=386, and Graybox.Simulator is 386 also.
But kepware "OPC quick connect" can enum this server, see screenshot below:

image

commented

@giter I have the same problem with you,I can not get the server too, have you solved this problem?
looking forward to your reply!

commented

@769139671 没有呀, 不过如果用opcquickclient.exe试过可以连上的话, 说明基本上还是靠谱的。

commented

@769139671 另外,我最近在某一个实际工况下, 有台用win10做的工控机服务器怎么也连不上,包括opcquickclient, 所以猜测可能跟操作系统有关 : )

@769139671 另外,我最近在某一个实际工况下, 有台用win10做的工控机服务器怎么也连不上,包括opcquickclient, 所以猜测可能跟操作系统有关 : )

操作系统Windows 2008 R2 x64
Go 1.13 x86
同样的问题,opcquickclient可以访问远程 Graybox.Simulator,Localhost Graybox.Simulator没有问题。
GOARCH=386,依然还是看不到。
后来选择将Graybox.Simulator 32位 的wapper 注册了就好了