Complete the code to define the OPC UA server endpoint URL.
server.set_endpoint("opc.tcp://[1]:4840")
The server endpoint URL must include the IP address where the OPC UA server listens. Here, '192.168.1.100' is the correct local network IP.
Complete the code to add a variable node to the OPC UA address space.
myvar = server.nodes.objects.add_variable(2, "MyVariable", [1])
The variable node value is set to 42, a simple integer example for OPC UA variable data.
Fix the error in the code to start the OPC UA server.
server.[1]()The correct method to start the OPC UA server is 'start()'. Other options are invalid method names.
Fill both blanks to create a subscription and add a monitored item.
subscription = server.create_subscription([1], handler) handle = subscription.[2](myvar)
The subscription interval is set to 1000 ms, and the method to add a monitored item is 'create_monitored_item'.
Fill all three blanks to define a secure OPC UA client connection.
client = Client("opc.tcp://[1]:4840") client.[2] = "Basic256Sha256" client.[3]()
The client connects to IP '192.168.10.10'. The security policy is set with 'security_policy', and the connection is started with 'connect()'.