Program structure, Task Scheduler or Sequence

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
User avatar
Jay Dee
Posts: 398
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 121 times
Been thanked: 154 times

Program structure, Task Scheduler or Sequence

Post by Jay Dee »

Hi all,
I'm still playing with my current project and getting to grips with some of the GHOST features....however I need to give my base program a better structure.
Does anyone have a good simple example of a program structure where, I can schedule tasks?
I'm thinking of a some tasks that run for every time, some every other time, some every 5 and others every 10...etc..

This way I can priorities small or high speed task like checking for alarm conditions, scanning for key presses, closed loop monitoring....and run other less critical tasks like diagnostic output to a terminal at a slower rate.

I'm trying to avoid using a timer (unless thats the best solution) as some task may well last longer than the interupt period.
thoughts? J.

chipfryer27
Valued Contributor
Valued Contributor
Posts: 786
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 187 times
Been thanked: 205 times

Re: Program structure, Task Scheduler or Sequence

Post by chipfryer27 »

Hi

Without knowing your application it is difficult to suggest the best approach. However I have leaned towards "state machines" in recent times (thanks Benj). Basically the program loops around a basic task, branching off when a certain condition is reached before either branching further or returning to initial loop.

I probably haven't explained it very well but here is a link to the wiki https://www.matrixtsl.com/wikiv7/index. ... ateMachine

I have used these in applications where a basic housekeeping/supervisory function runs, branching off depending on interrupt / timer / keypress etc and there are many examples in the forum

Hope this may help.

Regards

Post Reply