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

String is not formatted as expected parse node id string #20

Closed
tronghuybku opened this issue Jun 26, 2020 · 11 comments
Closed

String is not formatted as expected parse node id string #20

tronghuybku opened this issue Jun 26, 2020 · 11 comments

Comments

@tronghuybku
Copy link

tronghuybku commented Jun 26, 2020

Hello.I can't read node id. Issue: "String is not formatted as expected parse node id string" in Platform Utils . Can you help me ??

@msalafia
Copy link
Collaborator

msalafia commented Jun 26, 2020

The OPC UA WebPlatform uses a regular expression for NodeId validation expressed in the form - where is the namespace index and is the identifier. The latter can be a number, a string or a guid. The regular expression used is "^(\d+)-(?:(\d+)|(\S+))$" as you can see in this code.
Try to check the validity of this regular expression against your nodeId using online tool for regular expression liike this.
If you don't provide me some examples of strings you are submitting to the platform, i cannot help you.

@tronghuybku
Copy link
Author

Hello! My NodeId ns=2;s=OPC.SimaticNET.TCS

@msalafia
Copy link
Collaborator

If you provide this NodeId in the following format 2-OPC.SimaticNET.TCS it should work.
Look the matching:
image

@tronghuybku
Copy link
Author

i don't understand issue ValueToWriteTypeException: Wrong Type Error: String is not formatted as expected (number-yyy where yyy can be string or number or guid)
WebPlatform.Repository.PlatformUtils.ParsePlatformNodeIdString(string str) in PlatformUtils.cs
But i connect another server is OK and find node id ok

@tronghuybku
Copy link
Author

tronghuybku commented Jun 26, 2020

can i send u Server Url and check it or can you teamview help me because i must fix it

@msalafia
Copy link
Collaborator

Write here the url and i will ckeck but not soon. I am busy at the moment.

@tronghuybku
Copy link
Author

tronghuybku commented Jun 26, 2020

thank you. serverurl: opc.tcp://vietscada.com:4852
you must fix in file Config.xml to connect my server
AutoAcceptUntrustedCertificates: true
RejectSHA1SignedCertificates: false
MinimumCertificateKeySize: 1024

@tronghuybku
Copy link
Author

Hope you can solve issue. this is my Graduate thesis so i must fix it. Thank you very much

@msalafia
Copy link
Collaborator

This issue is due to your Node with NodeId "i=2;s=Server Status" because of the space in "Server Status". Space in Node Ids are not so common and quite error prone. If you cannot change the server NodeId i suggest you to change the regular expression with ^(\d+)-(?:(\d+)|([\S ]+))$. It will work.

@tronghuybku
Copy link
Author

tronghuybku commented Jun 26, 2020

It work with Folder. Thank you very much. But when i find node ID variable issue "Wrong ID: There is no Resource with ID 2-TCS:[SeniorStudentHD.Station 1.101]DP,Pump_3_Runtime" . Hope you hope me. nodeID is : "2-TCS:[SeniorStudentHD.Station 1.101]DP,Pump_3_Runtime"

@msalafia
Copy link
Collaborator

All these issues are due to bad NodeId strings. Unfortunately this time the issue is due to a BadNodeIdUnknown and could be due to the sdk call session.ReadNode(nodeToRead) or even your server sdk that throws an exception because do not works with this cumbersome nodeId. This is not due to a OPC UA WebPlatform bug so i cannot help you.
I am closing the issue.

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

2 participants