What may be the cause of the following error on python OPC UA server with SCADA client?

299 views Asked by At

Here is the code for setting up OPC UA Server:

import sys
from opcua import ua, Server

server = Server()

server.set_endpoint("opc.tcp://127.0.0.1:4808/")

server.set_server_name("ServerOPC")

uri = "http://server"
idx = server.register_namespace(uri)

objects = server.get_objects_node()

Object_1 =objects.add_object(idx,'MyFirstObject')
Object_2 =objects.add_object(idx,'MySecondObject')
Object_3 =objects.add_object(idx,'MyThirdObject')

Discret_1 = Object_1.add_variable(idx,'Discret_1',[0,0,0,0,0,0,0,0],varianttype=ua.VariantType.Int16)  
Discret_2 = Object_2.add_variable(idx,'Discret_2',[0,0,0,0,0,0,0,0],varianttype=ua.VariantType.Int16)  
Analog_3  = Object_3.add_variable(idx,'Analog_3',[10,20,30,40,50],varianttype=ua.VariantType.Int16)    

Discret_1.set_writable()
Discret_2.set_writable()
Analog_3.set_writable()

server.allow_remote_admin(allow=True)
server.start() 

I can succesfully read and write the variables with UaExpert. But i have it failed with SCADA-client (WinCC). I have connection established and can browse the nodes (variables). The types are compatible. But when I start runtime mode my server gives the following error. enter image description here

Does anyone have an idea how to fix this problem? Thanks in advance!

1

There are 1 answers

0
Victoria On

Finally, i found out that problem was not about the SCADA-client or the server, but about virtual machine. I don't know what exactly it was, but on another VM everything is going well.