User`s manual

Dynamic C Users Manual digi.com 59
abort
The abort statement causes the costatement or cofunction to terminate execution. If a costatement is
always_on, the next time the program reaches it, it will restart from the top. If the costatement is not
always_on, it becomes inactive and will not execute again until turned on by some other software.
Figure 5-5 Execution thread with abort statement
A costatement can have as many C statements, including abort, yield, and waitfor statements, as
needed. Costatements can be nested.
5.4 Advanced Costatement Topics
Each costatement has a structure of type CoData. This structure contains state and timing information. It
also contains the address inside the costatement that will execute the next time the program thread reaches
the costatement. A value of zero in the address location indicates the beginning of the costatement.
5.4.1 The CoData Structure
typedef struct {
char CSState;
unsigned int lastlocADDR;
char lastlocCBR;
char ChkSum;
char firsttime;
union{
unsigned long ul;
struct {
unsigned int u1;
unsigned int u2;
} us;
} content;
char ChkSum2;
} CoData;
costate ... {
statement
statement
}
...
abort;
...
statement
statement
statement
costate ... {
statement
statement
}
...
abort;
...
statement
statement
statement
(a) At time of abort (b) Next time