runtime/plc_common_main.c
changeset 54 ff82e7088ec5
parent 49 45dc6a944ab6
child 57 3b53f9a509d9
equal deleted inserted replaced
53:805abb954de2 54:ff82e7088ec5
    24  
    24  
    25 IEC_TIME __CURRENT_TIME;
    25 IEC_TIME __CURRENT_TIME;
    26 
    26 
    27 static int tick = 0;
    27 static int tick = 0;
    28 
    28 
       
    29 /*
       
    30  * Prototypes of funcions exported by plugins 
       
    31  **/
    29 %(calls_prototypes)s
    32 %(calls_prototypes)s
    30 
    33 
       
    34 /*
       
    35  * Retrive input variables, run PLC and publish output variables 
       
    36  **/
    31 void __run()
    37 void __run()
    32 {
    38 {
    33     %(retrive_calls)s
    39     %(retrive_calls)s
       
    40     
    34     config_run__(tick++);
    41     config_run__(tick++);
       
    42     
    35     %(publish_calls)s
    43     %(publish_calls)s
    36 }
    44 }
    37 
    45 
       
    46 /*
       
    47  * Initialize variables according to PLC's defalut values,
       
    48  * and then init plugins with that values  
       
    49  **/
    38 void __init()
    50 void __init()
    39 {
    51 {
    40     config_init__();
    52     config_init__();
    41     %(init_calls)s
    53     %(init_calls)s
    42 }
    54 }
    43 
    55 /*
       
    56  * Calls plugin cleanup proc.
       
    57  **/
    44 void __cleanup()
    58 void __cleanup()
    45 {
    59 {
    46     %(cleanup_calls)s
    60     %(cleanup_calls)s
    47 }
    61 }
    48 
    62