targets/plc_common_main.c
changeset 366 cd90e4c10261
parent 332 4f0e1d66bba5
child 386 2932b0dd437c
equal deleted inserted replaced
365:a7f58414dea0 366:cd90e4c10261
    15  * */
    15  * */
    16 void __init_debug(void);
    16 void __init_debug(void);
    17 void __cleanup_debug(void);
    17 void __cleanup_debug(void);
    18 /*void __retrieve_debug(void);*/
    18 /*void __retrieve_debug(void);*/
    19 void __publish_debug(void);
    19 void __publish_debug(void);
    20 
       
    21 void __init_python(void);
       
    22 void __cleanup_python(void);
       
    23 void __retrieve_python(void);
       
    24 void __publish_python(void);
       
    25 
    20 
    26 /*
    21 /*
    27  *  Variables used by generated C softPLC and plugins
    22  *  Variables used by generated C softPLC and plugins
    28  **/
    23  **/
    29 IEC_TIME __CURRENT_TIME;
    24 IEC_TIME __CURRENT_TIME;
    45 {
    40 {
    46     __tick++;
    41     __tick++;
    47 
    42 
    48     %(retrieve_calls)s
    43     %(retrieve_calls)s
    49 
    44 
    50     __retrieve_python();
       
    51 
       
    52     /*__retrieve_debug();*/
    45     /*__retrieve_debug();*/
    53 
    46 
    54     config_run__(__tick);
    47     config_run__(__tick);
    55 
       
    56     __publish_python();
       
    57 
    48 
    58     __publish_debug();
    49     __publish_debug();
    59 
    50 
    60     %(publish_calls)s
    51     %(publish_calls)s
    61 
    52 
    69 {
    60 {
    70     int res;
    61     int res;
    71     setlocale(LC_NUMERIC, "C");
    62     setlocale(LC_NUMERIC, "C");
    72     config_init__();
    63     config_init__();
    73     __init_debug();
    64     __init_debug();
    74     __init_python();
       
    75     %(init_calls)s
    65     %(init_calls)s
    76     return 0;
    66     return 0;
    77 }
    67 }
    78 /*
    68 /*
    79  * Calls plugin cleanup proc.
    69  * Calls plugin cleanup proc.
    80  **/
    70  **/
    81 void __cleanup()
    71 void __cleanup()
    82 {
    72 {
    83     %(cleanup_calls)s
    73     %(cleanup_calls)s
    84     __cleanup_debug();
    74     __cleanup_debug();
    85     __cleanup_python();
       
    86 }
    75 }
    87 
    76 
    88 
    77 
    89 void PLC_GetTime(IEC_TIME *CURRENT_TIME);
    78 void PLC_GetTime(IEC_TIME *CURRENT_TIME);
    90 void PLC_SetTimer(long long next, long long period);
    79 void PLC_SetTimer(long long next, long long period);