tests/plc.c
changeset 57 db9cadaab2ea
child 132 39f88c3d803d
equal deleted inserted replaced
56:6e87bbc2abe9 57:db9cadaab2ea
       
     1 #include "iec_std_lib.h"
       
     2 #include <stdio.h>
       
     3 
       
     4 /*
       
     5  * Functions and variables provied by generated C softPLC
       
     6  **/ 
       
     7 void config_run__(int tick);
       
     8 void config_init__(void);
       
     9 
       
    10 /*
       
    11  *  Functions and variables to export to generated C softPLC
       
    12  **/
       
    13  
       
    14 TIME __CURRENT_TIME;
       
    15 
       
    16 #define __LOCATED_VAR(type, name, ...) type name;
       
    17 #include "LOCATED_VARIABLES.h"
       
    18 #undef __LOCATED_VAR
       
    19 
       
    20 static int tick = 0;
       
    21 
       
    22 void run()
       
    23 {
       
    24     printf("Tick %d\n",tick);
       
    25     config_run__(tick++);
       
    26     printf("  Located variables : \n");
       
    27 #define __LOCATED_VAR(type, name,...) __print_##type(name);
       
    28 #include "LOCATED_VARIABLES.h"
       
    29 #undef __LOCATED_VAR
       
    30 }
       
    31