This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Script that reads from the bus and write
#1
Hello there,

Could you help me with a script that reads from the bus, every 10 minutes, the value (1 byte,%) of the object 2/3/11 and writes it back to the bus?


Thanks for help!
Reply
#2
Add a resident script with sleep interval 600

value = grp.getvalue('2/3/11')
grp.write('2/3/11', value)
Reply
#3
Resident cannot have a delay larger than 60 seconds. Use a scheduled script instead. If you want to send a read request periodically just set poll interval in object properties.
Reply
#4
(31.08.2021, 16:22)admin Wrote: Resident cannot have a delay larger than 60 seconds. Use a scheduled script instead. If you want to send a read request periodically just set poll interval in object properties.

Sorry, I didn't know.

What about a resident script like this:

value = grp.getvalue('2/3/11')
grp.write('2/3/11', value)
os.sleep(600)

?
Reply
#5
This will work as well
Reply
#6
(31.08.2021, 16:22)admin Wrote: Resident cannot have a delay larger than 60 seconds. Use a scheduled script instead. If you want to send a read request periodically just set poll interval in object properties.

where can i find this?

Is a value regulation.

I need the value to be written periodically, not just after a change, detector does not have the optionĀ  Undecided
Reply
#7
   
But this is only for reading, you still need a script for writing.
Reply


Forum Jump: