Server side code on an event:
Srvr = "SIMATIC.S7-1500.OPC-UA.Application:PLC"
Pth = 'nsu=http://www.siemens.com/simatic-s7-opcua;s="BatchDB"."Data"'
DB1_Data = system.opc.readValue(Srvr, Pth)
MyMsg = DB1_Data.getValue()#['VacuumCheckStart(inHg)']
MyFunc.MsgBox(str(MyMsg))
Returns:
{"VacuumCheckStart(inHg)":0.0,"VacuumCheckStart(Time)":[144,1,1,0,0,0,0,2],"VacuumCheckStop(inHg)":0.0,"VacuumCheckStop(Time)":[144,1,1,0,0,0,0,2],"VacuumCheckLoss(inHg)":0.0,"BatchStart(Time)":[144,1,1,0,0,0,0,2],"HeatSetStart(Time)":[144,1,1,0,0,0,0,2],"CoolStart(Time)":[144,1,1,0,0,0,0,2],"BatchStop(Time)":[144,1,1,0,0,0,0,2],"HourlyDataIndex":2,"HourlyTimes(Time)":[144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2,144,1,1,0,0,0,0,2],"OilTempSetpoint(C)":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"OilTemp(C)":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,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0],"BAC UnitTempOut(C)":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"AmbientAirTempInside(C)":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"AmbientAirTempOutside(C)":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]}
What is the syntax for reading the data out of MyMsg?
MyMsg[‘VacuumCheckStart(inHg)’] returns ‘must be an integer’ and
MyMsg[0] returns a {