29.01.2025, 07:35
Thank you @admin for your answer.
If I understand correctly, using localbus in a resident script:
(1) If I use, for example, step(10), the resident script waits for a message and,
- if the message arrives before 10 seconds, it calls whatever callbackfunction is defined, and, after that, exit the step(), continues with other instructions and, when it reaches the end of the resident script. it starts the script again
- if the message does not arrive before 10 seconds, after 10 seconds it exit the step(), continues with other instructions and, when it reaches the end of the resident script. it starts the script again
(2) If I use, for example, loop(10), the resident script:
- waits for messages for 10 seconds, and, for each message it receives, it calls whatever callbackfunction is defined
- after 10 seconds it exit the loop(), continues with other instructions and, when it reaches the end of the resident script. it starts the script again
Is this correct ?
The script for the reaload event on the bus is perfect for my need, thank you.
Just one more question: which is the meaning of the timeout I can define when creating the local bus connection ? Has it any relations with the time-out in step() and loop() ?
Thanks again
If I understand correctly, using localbus in a resident script:
(1) If I use, for example, step(10), the resident script waits for a message and,
- if the message arrives before 10 seconds, it calls whatever callbackfunction is defined, and, after that, exit the step(), continues with other instructions and, when it reaches the end of the resident script. it starts the script again
- if the message does not arrive before 10 seconds, after 10 seconds it exit the step(), continues with other instructions and, when it reaches the end of the resident script. it starts the script again
(2) If I use, for example, loop(10), the resident script:
- waits for messages for 10 seconds, and, for each message it receives, it calls whatever callbackfunction is defined
- after 10 seconds it exit the loop(), continues with other instructions and, when it reaches the end of the resident script. it starts the script again
Is this correct ?
The script for the reaload event on the bus is perfect for my need, thank you.
Just one more question: which is the meaning of the timeout I can define when creating the local bus connection ? Has it any relations with the time-out in step() and loop() ?
Thanks again