* Head of code common to all C targets
* Prototypes of functions provided by generated C softPLC
void config_run__(unsigned long tick);
void config_init__(void);
* Prototypes of functions provided by generated target C code
long long AtomicCompareExchange64(long long*, long long, long long);
void __cleanup_debug(void);
/*void __retrieve_debug(void);*/
void __publish_debug(void);
* Variables used by generated C softPLC and plugins
unsigned long __tick = 0;
* Variable generated by C softPLC and plugins
extern unsigned long greatest_tick_count__;
/* Help to quit cleanly when init fail at a certain level */
static int init_level = 0;
* Prototypes of functions exported by plugins
* Retrieve input variables, run PLC and publish output variables
if (greatest_tick_count__)
__tick %%= greatest_tick_count__;
* Initialize variables according to PLC's default values,
* and then init plugins with that values
int __init(int argc,char **argv)
/* Effective tick time with 1ms default value */
common_ticktime__ = 1000000;
* Calls plugin cleanup proc.
void PLC_GetTime(IEC_TIME *CURRENT_TIME);
void PLC_SetTimer(unsigned long long next, unsigned long long period);