Hallo Zusammen,
bräuchte ein wenig Unterstützung beim Python der while Schleife.
Das ist nur ein Teil vom Script. Das Problem ist er überspringt die "PLC" schleife.
Könnte mir da jemande ein Tipp geben?
Code
# PLC
while True:
if __name__=="__main__":
plc = c.Client()
plc.connect('192.168.0.1',0,1)
WriteMemory(plc,400,0,S7WLReal,displayTempWert2)
if __name__=="__main__":
plc = c.Client()
plc.connect('192.168.0.1',0,1)
WriteMemory(plc,420,0,S7WLReal,displayTempWert1)
# Hauptroutine
while Display_aktiv:
draw.rectangle((1,1,width,height), outline=0, fill=0) #Display leeren
#displayTime = aktuelleZeit("time", "date") # bei Abfrage "date","time" ändert die Reihenfolge der Ausgabe
#draw.text((x, top), displaySensorBezeichnung , font=font, fill=255)
draw.text((x, top+39), displayTempWert2, font=font_c, fill=255)
draw.text((x+145, top+43), '°C', font=font_d, fill=255)
draw.text((x, top+72), displayTempWert1, font=font_c, fill=255)
draw.text((x+153, top+73), '%', font=font_d, fill=255)
#draw.line((x, top+45, x+width, top+45), fill=255)
#draw.text((x, top+50), displayTime, font=font_c, fill=255)
disp.image(image)
disp.display()
Alles anzeigen