-
Can you please provide a short example on how to use the
Thanks a lot... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, The For your purpose, the @light_table.trigger
@shc.handler(reset_origin=True)
async def switch_off_light_table(value):
""" Switch off table light after 5s """
if not value:
return
await asyncio.sleep(5)
await light_table.write(False) |
Beta Was this translation helpful? Give feedback.
Hi,
The
TOff
timer is only a delay for changes to off. This means if the value of the inserted subscribable object changes toFalse
, theTOff
's value will change toFalse
5 seconds later, but it will change toTrue
immediately when the value of the inserted object changes toTrue
. This functionality is simliar to the TOFF block in SPS programming languages (e.g. https://infosys.beckhoff.com/english.php?content=../content/1033/tcplclib_tc2_standard/74405003.html&id=).For your purpose, the
TOff
timer is probably not the right tool. Instead, I would use a logic handler function like this: