Posts

Showing posts with the label opc-ua

automatic updating pyqt gui displayed value (opc-ua client)

automatic updating pyqt gui displayed value (opc-ua client) Hello python enthousiasts/pro's, I would like to create an OPC-UA client Graphical User Interface in python using the FreeOpc library, and PyQt & QtDesigner. I am starting with a simple code where two process values are displayed and updated every DeltaT, where DeltaT is a time interval specified by the user. (In the code I provided, the DeltaT is not implemented.) Here is the OPC server code I use: from opcua import Client import time url = "opc.tcp://localhost:4840" client = Client(url) client.connect() print("Client Connected") while True: Temp = client.get_node("ns=2;i=2") Temperature = Temp.get_value() print(Temperature) Press = client.get_node("ns=2;i=3") Pressure = Press.get_value() print(Pressure) TIME = client.get_node("ns=2;i=4") TIME_Value = TIME.get_value() print(TIME_Value) time.sleep(1) Here is the code of the GUI cr...