B4R Question Long running sub. Solution seems to work.

tigrot

Well-Known Member
Licensed User
Longtime User
Hi everybody,
I have a long running sub(up to 2 seconds) which generates a report on a SD card. It runs very seldom(3 or 4 times a day), but I cannot stop to handle incoming serial comunications while it runs.
Apart from fancy solutions and multitasking software, I'm thinking to use a short timer to activate the sub every n milliseconds, cutting the sub in small parts with a select case instruction and a counter to activate the single steps in sequence. The program is then able to handle events from serial ports without delays
This is an idea, is there something better?
Regards
Mauro
 
Last edited:
Top