Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I encountered a problem when remotely connecting to OPCServer #12

Open
lishuaia opened this issue Aug 22, 2024 · 27 comments
Open

I encountered a problem when remotely connecting to OPCServer #12

lishuaia opened this issue Aug 22, 2024 · 27 comments

Comments

@lishuaia
Copy link

I encountered a problem when remotely connecting to OPCServer;
MatrikonOPC can connect remotely, but cannot connect using your library,serverlist report errors:server list EnumClassesOfCategories: Access is denied.Could you please help me answer this question? Thank you

The following image shows MatrikonOPC connected to a remote OPCServer
1724319808877

The following image shows the error message of the server list
Uploading 1724319939918.jpg…

@lishuaia
Copy link
Author

The image of the code was not uploaded successfully. This is the running result image of the code
1724319939918

@huskar-t
Copy link
Owner

@lishuaia Is there a problem connecting to localhost to execute GetOPCServer?

@huskar-t
Copy link
Owner

@lishuaia Can you test using this version?
github.com/huskar-t/opcda v0.3.1-0.20240822113317-9cd33d1b0b09

@lishuaia
Copy link
Author

lishuaia commented Aug 22, 2024 via email

@huskar-t
Copy link
Owner

localhost no problem, The remote connection is down发自我的 iPhone在 2024年8月22日,19:51,Xuefeng Tan @.> 写道: @lishuaia Can you test using this version? github.com/huskar-t/opcda v0.3.1-0.20240822113317-9cd33d1b0b09 —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.>

@lishuaia Is there still a problem with using this version, and are there any error messages?

@lishuaia
Copy link
Author

@lishuaia Can you test using this version? github.com/huskar-t/opcda v0.3.1-0.20240822113317-9cd33d1b0b09

I couldn't find the code for this version? The tag on GitHub only has code for version v0.3.0

@huskar-t
Copy link
Owner

@lishuaia modify go.mod file
image

@lishuaia
Copy link
Author

v0.3.1-0.20240822113317-9cd33d1b0b09

我测试了下,还是报错:Access is denied

@huskar-t
Copy link
Owner

@lishuaia
Could you confirm which line in the opcda library returns the error?

@lishuaia
Copy link
Author

@huskar-t
The specific error is in the enum ClassesOfCategories method of IOPCServerList.go
1724642417050

@huskar-t
Copy link
Owner

@lishuaia It seems that you didn't replace the version I gave.
check your go.mod file and check if there is a method called getServersFromReg in opcserver.go

@lishuaia
Copy link
Author

@huskar-t
This is the code I downloaded locally. There is a getServersFromReg method in opcserver. go
1724644583676

@huskar-t
Copy link
Owner

@lishuaia That's strange. In the GetOPCServers method, if the call to EnumClassesOfCategories fails, it will try to get it from the registry.Are you sure the error returned is caused by EnumClassesOfCategories?

@lishuaia
Copy link
Author

@huskar-t
Yes, I added printing in the code. The following image shows the printed code and the running result
1724658198796
1724658171578

@huskar-t
Copy link
Owner

@huskar-t Yes, I added printing in the code. The following image shows the printed code and the running result 1724658198796 1724658171578

From the screenshot, the error occurs in getServersFromReg

@huskar-t
Copy link
Owner

@lishuaia 加我 qq 吧,有时间我帮你远程看一下

@lishuaia
Copy link
Author

@huskar-t 加您了,我的QQ名称是迁就,麻烦通过下

@giter
Copy link

giter commented Oct 26, 2024

+1 for the same problem. I'm sure that the connection is successful when using opc-quick-client or konimarti/opc

@huskar-t
Copy link
Owner

@giter Can you try 0.3.3 and provide the call stack?

@giter
Copy link

giter commented Oct 30, 2024

@huskar-t get clsid: getClsIDFromReg: Access is denied.

`
host := "LACLIENT2"
progID := "ArchestrA.FSGateway.3"

    server, err := opcda.Connect(progID, host)
    if err != nil {
        panic(err)
    }
`

@huskar-t
Copy link
Owner

@giter Looks like there is a problem with the dcom configuration, please check the permissions and dcom configuration.
https://www.bilibili.com/video/BV1ZT4y1M75y

@giter
Copy link

giter commented Oct 30, 2024

I'm sure that the connection is successful when using opc-quick-client or konimarti/opc

@huskar-t
Copy link
Owner

@giter Describe your environment and setup

@huskar-t
Copy link
Owner

huskar-t commented Nov 1, 2024

@giter What opc da server are you using?

@huskar-t
Copy link
Owner

huskar-t commented Nov 4, 2024

@giter Try compiling the program into 32-bit.
GOARCH=386

@giter
Copy link

giter commented Nov 10, 2024

build example/browse with GOARCH=386 and run it remote , result:

snapte

@huskar-t
Copy link
Owner

@giter Can you try running in administrator account?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants