Hi,
This might be a bit of a novice question but, I want the following to happen;
When I press the start button, a OPC UA tagg should be set to 1 at a certain time of day. This begin 06:00 - 14:00 - 22:00.
And this for the time while the button is pressed.
I took a toggle button (beceause it stays “pressed”) and put following code Event Handler actionPerformed. But if I press the button at for example 09:55, nothing happends at 10:00.
The idea behind is that when I release the toggle button, the script stops.
Ay help is welcome!
Thanks!
Steven
datum = system.date.format(system.date.now(),“yyyy-MM-dd”)
uur = system.date.getHour24(system.date.now())
minuten = system.date.getMinute(system.date.now())
NieuweLes6u = 1
NieuweLes14u = 1
if uur == 6 and minuten == 0 and NieuweLes6u == 1:
system.tag.write(‘PLC_WitMixer/MemoryTags/EenpuntNogNietGelezen’, 1)
NieuweLes6u = 0
if uur == 10 and minuten == 0 and NieuweLes14u == 1:
system.tag.write(‘PLC_WitMixer/MemoryTags/EenpuntNogNietGelezen’, 1)
NieuweLes14u = 0