Online Forums
Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.
Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.
Do not use the Contact page for technical issues.
- Forum
- Discussions
- QuickOPC-UA in COM
- Reading, Writing, Subscriptions
- VB Script syntax for ASP pages - error '80131600'
VB Script syntax for ASP pages - error '80131600'
I do not have your ASP file, so I cannot know while line is line 18. It would be best if you post the whole file.
Do you have "On Error Resume Next" before the Client.ReadValue?
And, did the script made it to the "response.write "*** Failure: " & Err.Source & ": " & Err.Description" statement or not? If so, what was the output in the response??
Regards
Please Log in or Create an account to join the conversation.
- albi.majun.1960@gmail.com
- Topic Author
- Offline
- Premium Member
- Posts: 13
- Thank you received: 1
let's do in this way, reset the discussion and start again from the scratch:
Currently at customer site is running a VB6 application/service that is doing many jobs (read/write) with OPCLabs COM
One of them is to reads the following informations (Counters value from current production)
The VB6 instructions is simple as you know:
dim client As New WasyUAClient
ServerOPCUA$ = "opc.tcp://192.168.1.50:4840"
Good$ = "ns=2;s=CurrentJobs.CurrentJob1.Counters.Production.Good"
GoodValue$= Client.ReadValue(ServerOPCUA$, Good$)
the value that you could see in the small windows from VB6 application (NodeId_read.jpg)
then value is written in sql database... etc etc
So now I would like to do the same in ASP to show this values on web page on IIS server
But when I try to read the same NodeId (that is a NodeClass = variable)
Response.Write "Test OPC-UA = " & Client.ReadValue("opc.tcp://192.168.1.50:4840", "ns=2;s=CurrentJobs.CurrentJob1.Counters.Production.Good")
If Err.Number <> 0 Then
response.write "*** Failure: " & Err.Source & ": " & Err.Description
response.write"</BR>"
End If
On Error Goto 0
I got the following error
error '80131600'
/CustomerServer/test-UA.asp, line 18
See pictures in attach (NodeId_OPC-UA_browser.png=, Node Id is equal to "ns=2;s=CurrentJobs.CurrentJob1.Counters.Production.Good" and the value has the same readed out by VB6 application:
value = 3790 pcs
I hope to be clear enough
Please let me have your explanation of the missmatch between VB6 and ASP and in which way I can solve it
Be so kind if I am wrong some where, but is seems so simple
If you need version number , etc etc let me know
Best regards
Alberto
Please Log in or Create an account to join the conversation.
I am not sure if I understand your post well. But if I do understand it correctly, then I do not see any problem in the behavior of the UA server or the client.
In one case, you are trying to write into a node that is not writable. And, you get an error that indicates precisely that (BadNotWritable).
In the second case, you are trying to read a value from an OPC UA Object. But Objects do not have a value; only node classes such as Variable do. So, you are getting BadAttributeIdInvalid - precisely what it should do in such case. Perhaps you wanted to choose one of the actual variables *under* the AnalogArray object (on the right pane of the browse windows in your snapshot).
Do you expect some different behavior? If so, why?
Best regards
Please Log in or Create an account to join the conversation.
- albi.majun.1960@gmail.com
- Topic Author
- Offline
- Premium Member
- Posts: 13
- Thank you received: 1
as you suggested I applied err number + err.description management.
Because today the customer is closed and I cannot logon to the remote server, I applied to my local simulation server and to the OPC labs demo server, getting the same error on OPCS Labs demo server
I don't know is is usefull but could be a start to understand a bit more:
In attach you will find the screen of OPC Labs demo server Node Id used to generate error '80131600' (I was lucky to find it) :
Row 67:
Response.Write "Test OPC-UA = " & Client.ReadValue(" opcua.demo-this.com:51211/UA/SampleServer ", "nsu=http://test.org/UA/Data/ ;ns=2;i=11248")
Here the asp code used in my test:
<!--$$Header: $-->
<!-- Copyright (c) CODE Consulting and Development, s.r.o., Plzen. All rights reserved. -->
<%@ LANGUAGE="VBSCRIPT" %>
<html><head><t-itle>Test-UA.asp</title></head>
<body>
<%
' Create EasyOPC-UA component
''''Dim Client As New EasyUAClient
On Error Resume Next
' Instantiate the client object
Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.UA.EasyUAClient")
' Read node value and display it
' server MOLLIFICIO
'Response.Write "Test OPC-UA = " & Client.ReadValue("opc.tcp://192.168.1.50:4840", "ns=2;s=CurrentJobs.CurrentJob1.Part.PartName")
'
Response.write "*** Proxsys simulation server MILNB011 ***"
response.write "</BR>"
Response.Write "job order= " & Client.ReadValue("opc.tcp://MILNB011:53530/OPCUA/SimulationServer", "ns=3;i=1011")
response.write "</BR>"
Response.Write "production counter = " & Client.ReadValue("opc.tcp://MILNB011:53530/OPCUA/SimulationServer", "ns=3;i=1001")
response.write"</BR>"
Response.Write "production counter = " & Client.WriteValue("opc.tcp://MILNB011:53530/OPCUA/SimulationServer", "ns=3;i=1001", "1234")
response.write"</BR>"
If Err.Number <> 0 Then
response.write "*** Failure: " & Err.Source & ": " & Err.Description
response.write"</BR>"
End If
On Error Goto 0
response.write"</BR>"
Response.Write "production counter = " & Client.ReadValue("opc.tcp://MILNB011:53530/OPCUA/SimulationServer", "ns=3;i=1001")
response.write"</BR>"
Response.Write "sinusoid simulation value= " & Client.ReadValue("opc.tcp://MILNB011:53530/OPCUA/SimulationServer", "ns=3;i=1004")
response.write"</BR>"
response.write"</BR>"
'Response.write "*** opc.tcp://opcuaserver.com:48484 ***"
'response.write "</BR>"
'Response.Write "Test OPC-UA server Anagni temperature = " & Client.ReadValue("opc.tcp://opcuaserver.com:48484", "ns=1;s=Countries.IT.Anagni.Temperature")
'Dim value: value = Client.ReadValue("opc.tcp://opcuaserver.com:48484", "ns=1;s=Countries.IT.Anagni.Temperature")
'If Err.Number <> 0 Then
' response.write "*** Failure: " & Err.Source & ": " & Err.Description
' response.write"</BR>"
'End If
'On Error Goto 0
response.write "</BR>"
Response.write "*** http://opcua.demo-this.com:51211/UA/SampleServer ***"
response.write "</BR>"
Response.Write "Test OPC-UA = " & Client.ReadValue("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://opcfoundation.org/UA/Boiler//Instance ;ns=5;i=40")
response.write "</BR>"
Response.Write "Test OPC-UA ServerStatus_CurrentTime = " & Client.ReadValue("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://opcfoundation.org/UA/ ;i=2258")
response.write "</BR>"
Response.Write "Test OPC-UA = " & Client.ReadValue("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://test.org/UA/Data/ ;ns=2;i=11248")
response.write "</BR>"
If Err.Number <> 0 Then
response.write "*** Failure: " & Err.Source & ": " & Err.Description
response.write"</BR>"
End If
On Error Goto 0
%>
</body>
</html>
Thanks and best regards
Alberto
Please Log in or Create an account to join the conversation.
Please try to obtain more detailed error text. In our VBScript examples under WSH, we use following error handling code, you can learn from that:
' Perform the operation
On Error Resume Next
Dim value: value = Client.ReadValue("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://test.org/UA/Data/;i=10853")
If Err.Number <> 0 Then
WScript.Echo "*** Failure: " & Err.Source & ": " & Err.Description
WScript.Quit
End If
On Error Goto 0
Please Log in or Create an account to join the conversation.
- albi.majun.1960@gmail.com
- Topic Author
- Offline
- Premium Member
- Posts: 13
- Thank you received: 1
the idea in background is to realize an asp web page that refresh every minute, showing all the values of the counters of production machines on a monitor
so I started from your sample asp script and did some test, here below the simple code:
<!--$$Header: $-->
<!-- Copyright (c) CODE Consulting and Development, s.r.o., Plzen. All rights reserved. -->
<%@ LANGUAGE="VBSCRIPT" %>
<html><head><t-itle>Test-UA.asp</title></head>
<body>
<%
' Create EasyOPC-UA component
''''Dim Client As New EasyUAClient
' Instantiate the client object
Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.UA.EasyUAClient")
' Read node value and display it
Response.write "*** Proxsys simulation server MILNB011 (my developing laptop) ***"
response.write "</BR>"
Response.Write "job order= " & Client.ReadValue("opc.tcp://MILNB011:53530/OPCUA/SimulationServer", "ns=3;i=1011")
response.write "</BR>"
Response.Write "production counter = " & Client.ReadValue("opc.tcp://MILNB011:53530/OPCUA/SimulationServer", "ns=3;i=1009")
response.write"</BR>"
Response.write "*** http://opcua.demo-this.com:51211/UA/SampleServer ***"
response.write "</BR>"
Response.Write "Test OPC-UA = " & Client.ReadValue("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://test.org/UA/Data/;i=10845")
response.write "</BR>"
Response.Write "Test OPC-UA = " & Client.ReadValue("http://opcua.demo-this.com:51211/UA/SampleServer", "nsu=http://opcfoundation.org/UA/Boiler//Instance ;ns=5;i=40")
response.write "</BR>"
%>
</body>
</html>
But i try with the following row, at customer site server
Response.Write "Test OPC-UA = " & Client.ReadValue("opc.tcp://192.168.1.50:4840", "ns=2;s=CurrentJobs.CurrentJob1.Counters.Production.Good")
error '80131600'
/CustomerServer/test-UA.asp, line 18
where line 18 is exactly the above istruction row
The main difference is that NodeID is in the following format "ns=2;s=CurrentJobs.CurrentJob1.Part.PartName" in the not working row (real environment)
instead of NodeID "ns=3;i=1011" in the working row (simulated environment)
Thanks for any suggestion you could provide.
BR
Alberto
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-UA in COM
- Reading, Writing, Subscriptions
- VB Script syntax for ASP pages - error '80131600'