-
Notifications
You must be signed in to change notification settings - Fork 145
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
Connecting to server with spaces in URL #82
Comments
I think that this is still a problem. Could you post a bit of code to show how you got around this? I'm using the latest binaries, and they still throw an exception when there's a space in the name. |
In fact, the following piece of code does work and it's using the same OPC Foundation DLL's. The OPC Server does have spaces in it's name. So i's not the OPC Foundatrion DLL's. I'm connecting to a DA server, bye the way. Public Sub MyOPC()
|
Unfortunately, I do not have that working code on hand. I'll have to do a lot of digging to find it. I was able to locate another useful snippit though, this is an overload for the I will continue to try and find the connection method I changed to allow spaces in the URL, but no promises. I have since left the role where I did this work and most of the code stayed with my previous employer (except some of the open source work I did, which this may have been in that folder).
|
Now I remember... It isn't a code change that fixed it. I had to bring the project down from github, then manually rebuild it as part of a larger project. This forced it to grab a newer version of the NuGet repositories which allowed it to run with the space character in URLs. All the code I wrote was to add functionality that I required for my specific project, such as username and password login. Sorry I can't offer much more help than that. Try grabbing the repository and building it yourself, bringing the NuGet packages to their latest versions. That worked over a year ago, so things might be different now... |
I found some snippits of old code that may or may not be helpful. Looks like I stored their info as a URI in my own
I had some prep work before connecting
I then had a whole series of functions to check for connection errors and such, but here is the method I used to connect. NOTE: this uses the username and password credential functionality that I added in a fork to the DaClient. Check my public repositories if you are interested in that.
|
Just adding another post to re-iterate what I -believe- was the most important bit of info. Store the URL as a URI object. Then, when creating a This is my best guess at the black magic I performed a few years ago. Like I said, this is old stuff that I only have bits and pieces of laying around. |
You cracked it! Here's what I did: (VB) Dim myurl As New Uri("opcda://localhost/National Instruments.Variable Engine.1") Many thanks. This should be in the documentation. |
I see on the version posted here is GitHub, there is a comment in h-opc/h-opc/Da/DaClient.cs which states
However the constructor:
Is not available when using the package through visual studios NuGet Package Manager.
According to the NuGet package manager I have installed version 0.9.3 In this version, only the System.URI constructor is present. This is the latest version available via NuGet.
I was able to clone the repository, build it, and add it to a project. After this, I was able to build use it as expected. This issue appears to be related to the latest NuGet version not matching the source here on GitHub.
The text was updated successfully, but these errors were encountered: