lib/C/iec_std_FB.h
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 06 May 2016 11:38:35 +0300
changeset 1007 afb3974f8fb3
parent 905 31224f8cac32
child 1011 76175defb87b
permissions -rw-r--r--
fix warning about overflow if matiec is running on 64-bit platform,
but the generated C code will cross-compiled for 32-bit platform

For example:
./build/config.c:29:39: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
unsigned long greatest_tick_count__ = 18446744073709551611UL; /*tick*/
^
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
905
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
     1
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
     2
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
     3
/****
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
     4
 * IEC 61131-3 standard function block library
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
     5
 */
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
     6
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
     7
/* NOTE: The code in this file was generated by iec2c (i.e. matiec C compiler), using as source
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
     8
 *        the *.txt files in the 'lib' directory.
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
     9
 *       The only 'manual' change was to the function prototypes, that were all changed to become 'static'.
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    10
 *         e.g.:   static void R_TRIG_init__(...)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    11
 *                 ^^^^^^
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    12
 * 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    13
 * NOTE: If the structure of the C code generated by iec2c (matiec) should change, then this C 'library'
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    14
 *       file will need to be recompiled. 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    15
 *       The correct way of going about this would be to have this file be automatically generated during
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    16
 *       the build process (i.e. after compiling matiec), but we will leave this for later if it ever
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    17
 *       becomes necessary.
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    18
 */
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    19
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    20
#ifndef _IEC_STD_FB_H
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    21
#define _IEC_STD_FB_H
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    22
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    23
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    24
#include "accessor.h"
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    25
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    26
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    27
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    28
// FUNCTION_BLOCK R_TRIG
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    29
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    30
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    31
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    32
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    33
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    34
  __DECLARE_VAR(BOOL,CLK)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    35
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    36
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    37
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    38
  __DECLARE_VAR(BOOL,M)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    39
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    40
} R_TRIG;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    41
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    42
// FUNCTION_BLOCK F_TRIG
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    43
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    44
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    45
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    46
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    47
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    48
  __DECLARE_VAR(BOOL,CLK)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    49
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    50
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    51
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    52
  __DECLARE_VAR(BOOL,M)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    53
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    54
} F_TRIG;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    55
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    56
// FUNCTION_BLOCK SR
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    57
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    58
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    59
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    60
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    61
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    62
  __DECLARE_VAR(BOOL,S1)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    63
  __DECLARE_VAR(BOOL,R)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    64
  __DECLARE_VAR(BOOL,Q1)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    65
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    66
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    67
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    68
} SR;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    69
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    70
// FUNCTION_BLOCK RS
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    71
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    72
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    73
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    74
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    75
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    76
  __DECLARE_VAR(BOOL,S)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    77
  __DECLARE_VAR(BOOL,R1)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    78
  __DECLARE_VAR(BOOL,Q1)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    79
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    80
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    81
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    82
} RS;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    83
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    84
// FUNCTION_BLOCK CTU
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    85
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    86
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    87
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    88
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    89
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    90
  __DECLARE_VAR(BOOL,CU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    91
  __DECLARE_VAR(BOOL,R)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    92
  __DECLARE_VAR(INT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    93
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    94
  __DECLARE_VAR(INT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    95
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    96
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    97
  R_TRIG CU_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    98
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
    99
} CTU;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   100
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   101
// FUNCTION_BLOCK CTU_DINT
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   102
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   103
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   104
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   105
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   106
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   107
  __DECLARE_VAR(BOOL,CU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   108
  __DECLARE_VAR(BOOL,R)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   109
  __DECLARE_VAR(DINT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   110
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   111
  __DECLARE_VAR(DINT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   112
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   113
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   114
  R_TRIG CU_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   115
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   116
} CTU_DINT;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   117
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   118
// FUNCTION_BLOCK CTU_LINT
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   119
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   120
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   121
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   122
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   123
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   124
  __DECLARE_VAR(BOOL,CU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   125
  __DECLARE_VAR(BOOL,R)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   126
  __DECLARE_VAR(LINT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   127
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   128
  __DECLARE_VAR(LINT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   129
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   130
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   131
  R_TRIG CU_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   132
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   133
} CTU_LINT;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   134
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   135
// FUNCTION_BLOCK CTU_UDINT
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   136
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   137
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   138
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   139
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   140
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   141
  __DECLARE_VAR(BOOL,CU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   142
  __DECLARE_VAR(BOOL,R)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   143
  __DECLARE_VAR(UDINT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   144
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   145
  __DECLARE_VAR(UDINT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   146
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   147
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   148
  R_TRIG CU_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   149
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   150
} CTU_UDINT;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   151
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   152
// FUNCTION_BLOCK CTU_ULINT
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   153
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   154
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   155
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   156
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   157
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   158
  __DECLARE_VAR(BOOL,CU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   159
  __DECLARE_VAR(BOOL,R)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   160
  __DECLARE_VAR(ULINT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   161
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   162
  __DECLARE_VAR(ULINT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   163
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   164
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   165
  R_TRIG CU_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   166
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   167
} CTU_ULINT;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   168
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   169
// FUNCTION_BLOCK CTD
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   170
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   171
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   172
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   173
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   174
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   175
  __DECLARE_VAR(BOOL,CD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   176
  __DECLARE_VAR(BOOL,LD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   177
  __DECLARE_VAR(INT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   178
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   179
  __DECLARE_VAR(INT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   180
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   181
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   182
  R_TRIG CD_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   183
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   184
} CTD;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   185
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   186
// FUNCTION_BLOCK CTD_DINT
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   187
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   188
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   189
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   190
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   191
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   192
  __DECLARE_VAR(BOOL,CD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   193
  __DECLARE_VAR(BOOL,LD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   194
  __DECLARE_VAR(DINT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   195
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   196
  __DECLARE_VAR(DINT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   197
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   198
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   199
  R_TRIG CD_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   200
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   201
} CTD_DINT;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   202
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   203
// FUNCTION_BLOCK CTD_LINT
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   204
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   205
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   206
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   207
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   208
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   209
  __DECLARE_VAR(BOOL,CD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   210
  __DECLARE_VAR(BOOL,LD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   211
  __DECLARE_VAR(LINT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   212
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   213
  __DECLARE_VAR(LINT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   214
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   215
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   216
  R_TRIG CD_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   217
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   218
} CTD_LINT;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   219
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   220
// FUNCTION_BLOCK CTD_UDINT
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   221
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   222
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   223
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   224
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   225
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   226
  __DECLARE_VAR(BOOL,CD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   227
  __DECLARE_VAR(BOOL,LD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   228
  __DECLARE_VAR(UDINT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   229
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   230
  __DECLARE_VAR(UDINT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   231
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   232
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   233
  R_TRIG CD_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   234
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   235
} CTD_UDINT;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   236
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   237
// FUNCTION_BLOCK CTD_ULINT
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   238
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   239
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   240
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   241
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   242
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   243
  __DECLARE_VAR(BOOL,CD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   244
  __DECLARE_VAR(BOOL,LD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   245
  __DECLARE_VAR(ULINT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   246
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   247
  __DECLARE_VAR(ULINT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   248
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   249
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   250
  R_TRIG CD_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   251
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   252
} CTD_ULINT;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   253
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   254
// FUNCTION_BLOCK CTUD
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   255
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   256
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   257
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   258
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   259
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   260
  __DECLARE_VAR(BOOL,CU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   261
  __DECLARE_VAR(BOOL,CD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   262
  __DECLARE_VAR(BOOL,R)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   263
  __DECLARE_VAR(BOOL,LD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   264
  __DECLARE_VAR(INT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   265
  __DECLARE_VAR(BOOL,QU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   266
  __DECLARE_VAR(BOOL,QD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   267
  __DECLARE_VAR(INT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   268
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   269
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   270
  R_TRIG CD_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   271
  R_TRIG CU_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   272
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   273
} CTUD;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   274
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   275
// FUNCTION_BLOCK CTUD_DINT
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   276
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   277
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   278
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   279
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   280
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   281
  __DECLARE_VAR(BOOL,CU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   282
  __DECLARE_VAR(BOOL,CD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   283
  __DECLARE_VAR(BOOL,R)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   284
  __DECLARE_VAR(BOOL,LD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   285
  __DECLARE_VAR(DINT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   286
  __DECLARE_VAR(BOOL,QU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   287
  __DECLARE_VAR(BOOL,QD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   288
  __DECLARE_VAR(DINT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   289
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   290
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   291
  R_TRIG CD_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   292
  R_TRIG CU_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   293
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   294
} CTUD_DINT;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   295
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   296
// FUNCTION_BLOCK CTUD_LINT
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   297
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   298
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   299
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   300
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   301
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   302
  __DECLARE_VAR(BOOL,CU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   303
  __DECLARE_VAR(BOOL,CD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   304
  __DECLARE_VAR(BOOL,R)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   305
  __DECLARE_VAR(BOOL,LD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   306
  __DECLARE_VAR(LINT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   307
  __DECLARE_VAR(BOOL,QU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   308
  __DECLARE_VAR(BOOL,QD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   309
  __DECLARE_VAR(LINT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   310
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   311
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   312
  R_TRIG CD_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   313
  R_TRIG CU_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   314
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   315
} CTUD_LINT;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   316
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   317
// FUNCTION_BLOCK CTUD_UDINT
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   318
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   319
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   320
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   321
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   322
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   323
  __DECLARE_VAR(BOOL,CU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   324
  __DECLARE_VAR(BOOL,CD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   325
  __DECLARE_VAR(BOOL,R)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   326
  __DECLARE_VAR(BOOL,LD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   327
  __DECLARE_VAR(UDINT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   328
  __DECLARE_VAR(BOOL,QU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   329
  __DECLARE_VAR(BOOL,QD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   330
  __DECLARE_VAR(UDINT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   331
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   332
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   333
  R_TRIG CD_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   334
  R_TRIG CU_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   335
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   336
} CTUD_UDINT;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   337
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   338
// FUNCTION_BLOCK CTUD_ULINT
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   339
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   340
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   341
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   342
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   343
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   344
  __DECLARE_VAR(BOOL,CU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   345
  __DECLARE_VAR(BOOL,CD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   346
  __DECLARE_VAR(BOOL,R)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   347
  __DECLARE_VAR(BOOL,LD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   348
  __DECLARE_VAR(ULINT,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   349
  __DECLARE_VAR(BOOL,QU)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   350
  __DECLARE_VAR(BOOL,QD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   351
  __DECLARE_VAR(ULINT,CV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   352
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   353
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   354
  R_TRIG CD_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   355
  R_TRIG CU_T;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   356
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   357
} CTUD_ULINT;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   358
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   359
// FUNCTION_BLOCK TP
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   360
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   361
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   362
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   363
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   364
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   365
  __DECLARE_VAR(BOOL,IN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   366
  __DECLARE_VAR(TIME,PT)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   367
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   368
  __DECLARE_VAR(TIME,ET)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   369
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   370
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   371
  __DECLARE_VAR(SINT,STATE)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   372
  __DECLARE_VAR(BOOL,PREV_IN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   373
  __DECLARE_VAR(TIME,CURRENT_TIME)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   374
  __DECLARE_VAR(TIME,START_TIME)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   375
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   376
} TP;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   377
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   378
// FUNCTION_BLOCK TON
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   379
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   380
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   381
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   382
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   383
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   384
  __DECLARE_VAR(BOOL,IN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   385
  __DECLARE_VAR(TIME,PT)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   386
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   387
  __DECLARE_VAR(TIME,ET)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   388
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   389
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   390
  __DECLARE_VAR(SINT,STATE)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   391
  __DECLARE_VAR(BOOL,PREV_IN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   392
  __DECLARE_VAR(TIME,CURRENT_TIME)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   393
  __DECLARE_VAR(TIME,START_TIME)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   394
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   395
} TON;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   396
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   397
// FUNCTION_BLOCK TOF
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   398
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   399
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   400
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   401
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   402
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   403
  __DECLARE_VAR(BOOL,IN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   404
  __DECLARE_VAR(TIME,PT)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   405
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   406
  __DECLARE_VAR(TIME,ET)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   407
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   408
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   409
  __DECLARE_VAR(SINT,STATE)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   410
  __DECLARE_VAR(BOOL,PREV_IN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   411
  __DECLARE_VAR(TIME,CURRENT_TIME)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   412
  __DECLARE_VAR(TIME,START_TIME)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   413
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   414
} TOF;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   415
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   416
// FUNCTION_BLOCK DERIVATIVE
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   417
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   418
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   419
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   420
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   421
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   422
  __DECLARE_VAR(BOOL,RUN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   423
  __DECLARE_VAR(REAL,XIN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   424
  __DECLARE_VAR(TIME,CYCLE)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   425
  __DECLARE_VAR(REAL,XOUT)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   426
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   427
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   428
  __DECLARE_VAR(REAL,X1)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   429
  __DECLARE_VAR(REAL,X2)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   430
  __DECLARE_VAR(REAL,X3)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   431
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   432
} DERIVATIVE;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   433
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   434
// FUNCTION_BLOCK HYSTERESIS
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   435
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   436
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   437
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   438
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   439
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   440
  __DECLARE_VAR(REAL,XIN1)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   441
  __DECLARE_VAR(REAL,XIN2)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   442
  __DECLARE_VAR(REAL,EPS)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   443
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   444
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   445
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   446
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   447
} HYSTERESIS;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   448
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   449
// FUNCTION_BLOCK INTEGRAL
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   450
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   451
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   452
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   453
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   454
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   455
  __DECLARE_VAR(BOOL,RUN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   456
  __DECLARE_VAR(BOOL,R1)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   457
  __DECLARE_VAR(REAL,XIN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   458
  __DECLARE_VAR(REAL,X0)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   459
  __DECLARE_VAR(TIME,CYCLE)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   460
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   461
  __DECLARE_VAR(REAL,XOUT)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   462
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   463
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   464
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   465
} INTEGRAL;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   466
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   467
// FUNCTION_BLOCK PID
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   468
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   469
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   470
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   471
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   472
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   473
  __DECLARE_VAR(BOOL,AUTO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   474
  __DECLARE_VAR(REAL,PV)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   475
  __DECLARE_VAR(REAL,SP)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   476
  __DECLARE_VAR(REAL,X0)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   477
  __DECLARE_VAR(REAL,KP)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   478
  __DECLARE_VAR(REAL,TR)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   479
  __DECLARE_VAR(REAL,TD)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   480
  __DECLARE_VAR(TIME,CYCLE)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   481
  __DECLARE_VAR(REAL,XOUT)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   482
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   483
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   484
  __DECLARE_VAR(REAL,ERROR)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   485
  INTEGRAL ITERM;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   486
  DERIVATIVE DTERM;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   487
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   488
} PID;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   489
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   490
// FUNCTION_BLOCK RAMP
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   491
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   492
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   493
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   494
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   495
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   496
  __DECLARE_VAR(BOOL,RUN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   497
  __DECLARE_VAR(REAL,X0)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   498
  __DECLARE_VAR(REAL,X1)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   499
  __DECLARE_VAR(TIME,TR)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   500
  __DECLARE_VAR(TIME,CYCLE)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   501
  __DECLARE_VAR(BOOL,BUSY)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   502
  __DECLARE_VAR(REAL,XOUT)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   503
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   504
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   505
  __DECLARE_VAR(REAL,XI)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   506
  __DECLARE_VAR(TIME,T)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   507
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   508
} RAMP;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   509
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   510
// FUNCTION_BLOCK RTC
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   511
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   512
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   513
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   514
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   515
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   516
  __DECLARE_VAR(BOOL,IN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   517
  __DECLARE_VAR(DT,PDT)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   518
  __DECLARE_VAR(BOOL,Q)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   519
  __DECLARE_VAR(DT,CDT)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   520
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   521
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   522
  __DECLARE_VAR(BOOL,PREV_IN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   523
  __DECLARE_VAR(TIME,OFFSET)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   524
  __DECLARE_VAR(DT,CURRENT_TIME)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   525
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   526
} RTC;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   527
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   528
// FUNCTION_BLOCK SEMA
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   529
// Data part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   530
typedef struct {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   531
  // FB Interface - IN, OUT, IN_OUT variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   532
  __DECLARE_VAR(BOOL,EN)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   533
  __DECLARE_VAR(BOOL,ENO)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   534
  __DECLARE_VAR(BOOL,CLAIM)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   535
  __DECLARE_VAR(BOOL,RELEASE)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   536
  __DECLARE_VAR(BOOL,BUSY)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   537
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   538
  // FB private variables - TEMP, private and located variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   539
  __DECLARE_VAR(BOOL,Q_INTERNAL)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   540
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   541
} SEMA;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   542
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   543
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   544
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   545
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   546
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   547
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   548
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   549
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   550
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   551
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   552
static void R_TRIG_init__(R_TRIG *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   553
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   554
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   555
  __INIT_VAR(data__->CLK,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   556
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   557
  __INIT_VAR(data__->M,__BOOL_LITERAL(FALSE),1)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   558
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   559
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   560
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   561
static void R_TRIG_body__(R_TRIG *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   562
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   563
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   564
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   565
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   566
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   567
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   568
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   569
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   570
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   571
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   572
  __SET_VAR(data__->,Q,,(__GET_VAR(data__->CLK,) && !(__GET_VAR(data__->M,))));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   573
  __SET_VAR(data__->,M,,__GET_VAR(data__->CLK,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   574
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   575
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   576
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   577
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   578
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   579
} // R_TRIG_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   580
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   581
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   582
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   583
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   584
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   585
static void F_TRIG_init__(F_TRIG *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   586
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   587
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   588
  __INIT_VAR(data__->CLK,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   589
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   590
  __INIT_VAR(data__->M,__BOOL_LITERAL(FALSE),1)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   591
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   592
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   593
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   594
static void F_TRIG_body__(F_TRIG *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   595
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   596
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   597
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   598
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   599
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   600
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   601
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   602
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   603
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   604
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   605
  __SET_VAR(data__->,Q,,(!(__GET_VAR(data__->CLK,)) && !(__GET_VAR(data__->M,))));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   606
  __SET_VAR(data__->,M,,!(__GET_VAR(data__->CLK,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   607
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   608
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   609
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   610
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   611
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   612
} // F_TRIG_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   613
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   614
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   615
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   616
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   617
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   618
static void SR_init__(SR *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   619
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   620
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   621
  __INIT_VAR(data__->S1,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   622
  __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   623
  __INIT_VAR(data__->Q1,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   624
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   625
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   626
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   627
static void SR_body__(SR *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   628
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   629
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   630
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   631
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   632
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   633
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   634
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   635
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   636
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   637
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   638
  __SET_VAR(data__->,Q1,,(__GET_VAR(data__->S1,) || (!(__GET_VAR(data__->R,)) && __GET_VAR(data__->Q1,))));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   639
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   640
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   641
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   642
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   643
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   644
} // SR_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   645
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   646
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   647
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   648
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   649
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   650
static void RS_init__(RS *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   651
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   652
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   653
  __INIT_VAR(data__->S,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   654
  __INIT_VAR(data__->R1,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   655
  __INIT_VAR(data__->Q1,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   656
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   657
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   658
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   659
static void RS_body__(RS *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   660
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   661
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   662
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   663
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   664
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   665
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   666
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   667
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   668
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   669
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   670
  __SET_VAR(data__->,Q1,,(!(__GET_VAR(data__->R1,)) && (__GET_VAR(data__->S,) || __GET_VAR(data__->Q1,))));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   671
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   672
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   673
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   674
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   675
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   676
} // RS_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   677
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   678
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   679
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   680
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   681
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   682
static void CTU_init__(CTU *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   683
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   684
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   685
  __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   686
  __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   687
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   688
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   689
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   690
  R_TRIG_init__(&data__->CU_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   691
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   692
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   693
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   694
static void CTU_body__(CTU *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   695
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   696
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   697
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   698
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   699
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   700
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   701
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   702
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   703
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   704
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   705
  __SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   706
  R_TRIG_body__(&data__->CU_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   707
  if (__GET_VAR(data__->R,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   708
    __SET_VAR(data__->,CV,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   709
  } else if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   710
    __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   711
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   712
  __SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   713
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   714
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   715
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   716
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   717
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   718
} // CTU_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   719
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   720
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   721
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   722
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   723
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   724
static void CTU_DINT_init__(CTU_DINT *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   725
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   726
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   727
  __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   728
  __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   729
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   730
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   731
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   732
  R_TRIG_init__(&data__->CU_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   733
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   734
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   735
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   736
static void CTU_DINT_body__(CTU_DINT *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   737
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   738
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   739
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   740
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   741
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   742
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   743
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   744
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   745
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   746
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   747
  __SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   748
  R_TRIG_body__(&data__->CU_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   749
  if (__GET_VAR(data__->R,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   750
    __SET_VAR(data__->,CV,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   751
  } else if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   752
    __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   753
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   754
  __SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   755
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   756
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   757
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   758
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   759
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   760
} // CTU_DINT_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   761
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   762
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   763
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   764
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   765
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   766
static void CTU_LINT_init__(CTU_LINT *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   767
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   768
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   769
  __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   770
  __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   771
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   772
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   773
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   774
  R_TRIG_init__(&data__->CU_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   775
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   776
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   777
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   778
static void CTU_LINT_body__(CTU_LINT *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   779
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   780
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   781
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   782
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   783
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   784
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   785
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   786
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   787
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   788
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   789
  __SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   790
  R_TRIG_body__(&data__->CU_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   791
  if (__GET_VAR(data__->R,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   792
    __SET_VAR(data__->,CV,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   793
  } else if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   794
    __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   795
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   796
  __SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   797
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   798
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   799
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   800
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   801
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   802
} // CTU_LINT_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   803
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   804
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   805
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   806
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   807
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   808
static void CTU_UDINT_init__(CTU_UDINT *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   809
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   810
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   811
  __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   812
  __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   813
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   814
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   815
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   816
  R_TRIG_init__(&data__->CU_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   817
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   818
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   819
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   820
static void CTU_UDINT_body__(CTU_UDINT *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   821
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   822
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   823
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   824
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   825
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   826
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   827
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   828
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   829
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   830
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   831
  __SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   832
  R_TRIG_body__(&data__->CU_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   833
  if (__GET_VAR(data__->R,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   834
    __SET_VAR(data__->,CV,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   835
  } else if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   836
    __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   837
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   838
  __SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   839
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   840
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   841
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   842
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   843
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   844
} // CTU_UDINT_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   845
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   846
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   847
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   848
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   849
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   850
static void CTU_ULINT_init__(CTU_ULINT *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   851
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   852
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   853
  __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   854
  __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   855
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   856
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   857
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   858
  R_TRIG_init__(&data__->CU_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   859
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   860
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   861
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   862
static void CTU_ULINT_body__(CTU_ULINT *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   863
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   864
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   865
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   866
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   867
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   868
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   869
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   870
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   871
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   872
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   873
  __SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   874
  R_TRIG_body__(&data__->CU_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   875
  if (__GET_VAR(data__->R,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   876
    __SET_VAR(data__->,CV,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   877
  } else if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   878
    __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   879
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   880
  __SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   881
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   882
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   883
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   884
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   885
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   886
} // CTU_ULINT_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   887
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   888
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   889
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   890
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   891
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   892
static void CTD_init__(CTD *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   893
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   894
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   895
  __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   896
  __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   897
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   898
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   899
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   900
  R_TRIG_init__(&data__->CD_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   901
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   902
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   903
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   904
static void CTD_body__(CTD *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   905
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   906
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   907
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   908
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   909
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   910
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   911
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   912
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   913
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   914
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   915
  __SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   916
  R_TRIG_body__(&data__->CD_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   917
  if (__GET_VAR(data__->LD,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   918
    __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   919
  } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   920
    __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   921
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   922
  __SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) <= 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   923
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   924
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   925
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   926
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   927
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   928
} // CTD_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   929
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   930
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   931
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   932
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   933
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   934
static void CTD_DINT_init__(CTD_DINT *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   935
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   936
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   937
  __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   938
  __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   939
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   940
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   941
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   942
  R_TRIG_init__(&data__->CD_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   943
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   944
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   945
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   946
static void CTD_DINT_body__(CTD_DINT *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   947
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   948
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   949
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   950
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   951
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   952
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   953
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   954
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   955
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   956
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   957
  __SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   958
  R_TRIG_body__(&data__->CD_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   959
  if (__GET_VAR(data__->LD,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   960
    __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   961
  } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   962
    __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   963
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   964
  __SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) <= 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   965
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   966
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   967
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   968
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   969
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   970
} // CTD_DINT_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   971
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   972
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   973
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   974
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   975
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   976
static void CTD_LINT_init__(CTD_LINT *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   977
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   978
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   979
  __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   980
  __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   981
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   982
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   983
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   984
  R_TRIG_init__(&data__->CD_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   985
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   986
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   987
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   988
static void CTD_LINT_body__(CTD_LINT *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   989
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   990
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   991
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   992
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   993
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   994
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   995
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   996
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   997
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   998
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
   999
  __SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1000
  R_TRIG_body__(&data__->CD_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1001
  if (__GET_VAR(data__->LD,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1002
    __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1003
  } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1004
    __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1005
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1006
  __SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) <= 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1007
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1008
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1009
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1010
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1011
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1012
} // CTD_LINT_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1013
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1014
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1015
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1016
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1017
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1018
static void CTD_UDINT_init__(CTD_UDINT *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1019
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1020
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1021
  __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1022
  __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1023
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1024
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1025
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1026
  R_TRIG_init__(&data__->CD_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1027
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1028
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1029
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1030
static void CTD_UDINT_body__(CTD_UDINT *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1031
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1032
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1033
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1034
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1035
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1036
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1037
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1038
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1039
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1040
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1041
  __SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1042
  R_TRIG_body__(&data__->CD_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1043
  if (__GET_VAR(data__->LD,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1044
    __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1045
  } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1046
    __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1047
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1048
  __SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) <= 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1049
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1050
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1051
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1052
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1053
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1054
} // CTD_UDINT_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1055
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1056
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1057
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1058
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1059
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1060
static void CTD_ULINT_init__(CTD_ULINT *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1061
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1062
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1063
  __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1064
  __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1065
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1066
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1067
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1068
  R_TRIG_init__(&data__->CD_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1069
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1070
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1071
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1072
static void CTD_ULINT_body__(CTD_ULINT *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1073
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1074
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1075
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1076
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1077
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1078
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1079
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1080
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1081
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1082
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1083
  __SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1084
  R_TRIG_body__(&data__->CD_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1085
  if (__GET_VAR(data__->LD,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1086
    __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1087
  } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1088
    __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1089
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1090
  __SET_VAR(data__->,Q,,(__GET_VAR(data__->CV,) <= 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1091
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1092
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1093
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1094
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1095
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1096
} // CTD_ULINT_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1097
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1098
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1099
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1100
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1101
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1102
static void CTUD_init__(CTUD *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1103
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1104
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1105
  __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1106
  __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1107
  __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1108
  __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1109
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1110
  __INIT_VAR(data__->QU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1111
  __INIT_VAR(data__->QD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1112
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1113
  R_TRIG_init__(&data__->CD_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1114
  R_TRIG_init__(&data__->CU_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1115
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1116
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1117
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1118
static void CTUD_body__(CTUD *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1119
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1120
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1121
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1122
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1123
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1124
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1125
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1126
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1127
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1128
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1129
  __SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1130
  R_TRIG_body__(&data__->CD_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1131
  __SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1132
  R_TRIG_body__(&data__->CU_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1133
  if (__GET_VAR(data__->R,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1134
    __SET_VAR(data__->,CV,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1135
  } else if (__GET_VAR(data__->LD,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1136
    __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1137
  } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1138
    if (!((__GET_VAR(data__->CU_T.Q,) && __GET_VAR(data__->CD_T.Q,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1139
      if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1140
        __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1141
      } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1142
        __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1143
      };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1144
    };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1145
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1146
  __SET_VAR(data__->,QU,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1147
  __SET_VAR(data__->,QD,,(__GET_VAR(data__->CV,) <= 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1148
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1149
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1150
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1151
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1152
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1153
} // CTUD_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1154
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1155
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1156
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1157
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1158
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1159
static void CTUD_DINT_init__(CTUD_DINT *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1160
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1161
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1162
  __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1163
  __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1164
  __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1165
  __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1166
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1167
  __INIT_VAR(data__->QU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1168
  __INIT_VAR(data__->QD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1169
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1170
  R_TRIG_init__(&data__->CD_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1171
  R_TRIG_init__(&data__->CU_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1172
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1173
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1174
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1175
static void CTUD_DINT_body__(CTUD_DINT *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1176
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1177
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1178
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1179
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1180
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1181
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1182
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1183
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1184
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1185
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1186
  __SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1187
  R_TRIG_body__(&data__->CD_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1188
  __SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1189
  R_TRIG_body__(&data__->CU_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1190
  if (__GET_VAR(data__->R,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1191
    __SET_VAR(data__->,CV,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1192
  } else if (__GET_VAR(data__->LD,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1193
    __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1194
  } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1195
    if (!((__GET_VAR(data__->CU_T.Q,) && __GET_VAR(data__->CD_T.Q,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1196
      if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1197
        __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1198
      } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1199
        __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1200
      };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1201
    };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1202
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1203
  __SET_VAR(data__->,QU,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1204
  __SET_VAR(data__->,QD,,(__GET_VAR(data__->CV,) <= 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1205
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1206
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1207
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1208
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1209
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1210
} // CTUD_DINT_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1211
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1212
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1213
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1214
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1215
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1216
static void CTUD_LINT_init__(CTUD_LINT *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1217
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1218
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1219
  __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1220
  __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1221
  __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1222
  __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1223
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1224
  __INIT_VAR(data__->QU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1225
  __INIT_VAR(data__->QD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1226
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1227
  R_TRIG_init__(&data__->CD_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1228
  R_TRIG_init__(&data__->CU_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1229
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1230
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1231
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1232
static void CTUD_LINT_body__(CTUD_LINT *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1233
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1234
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1235
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1236
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1237
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1238
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1239
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1240
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1241
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1242
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1243
  __SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1244
  R_TRIG_body__(&data__->CD_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1245
  __SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1246
  R_TRIG_body__(&data__->CU_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1247
  if (__GET_VAR(data__->R,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1248
    __SET_VAR(data__->,CV,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1249
  } else if (__GET_VAR(data__->LD,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1250
    __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1251
  } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1252
    if (!((__GET_VAR(data__->CU_T.Q,) && __GET_VAR(data__->CD_T.Q,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1253
      if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1254
        __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1255
      } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1256
        __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1257
      };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1258
    };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1259
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1260
  __SET_VAR(data__->,QU,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1261
  __SET_VAR(data__->,QD,,(__GET_VAR(data__->CV,) <= 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1262
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1263
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1264
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1265
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1266
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1267
} // CTUD_LINT_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1268
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1269
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1270
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1271
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1272
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1273
static void CTUD_UDINT_init__(CTUD_UDINT *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1274
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1275
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1276
  __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1277
  __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1278
  __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1279
  __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1280
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1281
  __INIT_VAR(data__->QU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1282
  __INIT_VAR(data__->QD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1283
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1284
  R_TRIG_init__(&data__->CD_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1285
  R_TRIG_init__(&data__->CU_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1286
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1287
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1288
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1289
static void CTUD_UDINT_body__(CTUD_UDINT *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1290
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1291
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1292
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1293
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1294
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1295
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1296
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1297
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1298
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1299
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1300
  __SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1301
  R_TRIG_body__(&data__->CD_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1302
  __SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1303
  R_TRIG_body__(&data__->CU_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1304
  if (__GET_VAR(data__->R,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1305
    __SET_VAR(data__->,CV,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1306
  } else if (__GET_VAR(data__->LD,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1307
    __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1308
  } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1309
    if (!((__GET_VAR(data__->CU_T.Q,) && __GET_VAR(data__->CD_T.Q,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1310
      if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1311
        __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1312
      } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1313
        __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1314
      };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1315
    };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1316
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1317
  __SET_VAR(data__->,QU,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1318
  __SET_VAR(data__->,QD,,(__GET_VAR(data__->CV,) <= 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1319
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1320
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1321
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1322
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1323
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1324
} // CTUD_UDINT_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1325
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1326
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1327
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1328
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1329
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1330
static void CTUD_ULINT_init__(CTUD_ULINT *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1331
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1332
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1333
  __INIT_VAR(data__->CU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1334
  __INIT_VAR(data__->CD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1335
  __INIT_VAR(data__->R,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1336
  __INIT_VAR(data__->LD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1337
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1338
  __INIT_VAR(data__->QU,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1339
  __INIT_VAR(data__->QD,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1340
  __INIT_VAR(data__->CV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1341
  R_TRIG_init__(&data__->CD_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1342
  R_TRIG_init__(&data__->CU_T,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1343
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1344
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1345
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1346
static void CTUD_ULINT_body__(CTUD_ULINT *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1347
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1348
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1349
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1350
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1351
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1352
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1353
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1354
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1355
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1356
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1357
  __SET_VAR(data__->CD_T.,CLK,,__GET_VAR(data__->CD,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1358
  R_TRIG_body__(&data__->CD_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1359
  __SET_VAR(data__->CU_T.,CLK,,__GET_VAR(data__->CU,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1360
  R_TRIG_body__(&data__->CU_T);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1361
  if (__GET_VAR(data__->R,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1362
    __SET_VAR(data__->,CV,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1363
  } else if (__GET_VAR(data__->LD,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1364
    __SET_VAR(data__->,CV,,__GET_VAR(data__->PV,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1365
  } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1366
    if (!((__GET_VAR(data__->CU_T.Q,) && __GET_VAR(data__->CD_T.Q,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1367
      if ((__GET_VAR(data__->CU_T.Q,) && (__GET_VAR(data__->CV,) < __GET_VAR(data__->PV,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1368
        __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) + 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1369
      } else if ((__GET_VAR(data__->CD_T.Q,) && (__GET_VAR(data__->CV,) > 0))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1370
        __SET_VAR(data__->,CV,,(__GET_VAR(data__->CV,) - 1));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1371
      };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1372
    };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1373
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1374
  __SET_VAR(data__->,QU,,(__GET_VAR(data__->CV,) >= __GET_VAR(data__->PV,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1375
  __SET_VAR(data__->,QD,,(__GET_VAR(data__->CV,) <= 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1376
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1377
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1378
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1379
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1380
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1381
} // CTUD_ULINT_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1382
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1383
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1384
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1385
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1386
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1387
static void TP_init__(TP *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1388
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1389
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1390
  __INIT_VAR(data__->IN,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1391
  __INIT_VAR(data__->PT,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1392
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1393
  __INIT_VAR(data__->ET,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1394
  __INIT_VAR(data__->STATE,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1395
  __INIT_VAR(data__->PREV_IN,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1396
  __INIT_VAR(data__->CURRENT_TIME,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1397
  __INIT_VAR(data__->START_TIME,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1398
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1399
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1400
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1401
static void TP_body__(TP *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1402
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1403
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1404
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1405
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1406
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1407
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1408
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1409
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1410
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1411
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1412
  #define GetFbVar(var,...) __GET_VAR(data__->var,__VA_ARGS__)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1413
  #define SetFbVar(var,val,...) __SET_VAR(data__->,var,__VA_ARGS__,val)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1414
__SET_VAR(data__->,CURRENT_TIME,,__CURRENT_TIME)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1415
  #undef GetFbVar
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1416
  #undef SetFbVar
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1417
;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1418
  if ((((__GET_VAR(data__->STATE,) == 0) && !(__GET_VAR(data__->PREV_IN,))) && __GET_VAR(data__->IN,))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1419
    __SET_VAR(data__->,STATE,,1);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1420
    __SET_VAR(data__->,Q,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1421
    __SET_VAR(data__->,START_TIME,,__GET_VAR(data__->CURRENT_TIME,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1422
  } else if ((__GET_VAR(data__->STATE,) == 1)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1423
    if (LE_TIME(__BOOL_LITERAL(TRUE), NULL, 2, __time_add(__GET_VAR(data__->START_TIME,), __GET_VAR(data__->PT,)), __GET_VAR(data__->CURRENT_TIME,))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1424
      __SET_VAR(data__->,STATE,,2);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1425
      __SET_VAR(data__->,Q,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1426
      __SET_VAR(data__->,ET,,__GET_VAR(data__->PT,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1427
    } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1428
      __SET_VAR(data__->,ET,,__time_sub(__GET_VAR(data__->CURRENT_TIME,), __GET_VAR(data__->START_TIME,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1429
    };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1430
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1431
  if (((__GET_VAR(data__->STATE,) == 2) && !(__GET_VAR(data__->IN,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1432
    __SET_VAR(data__->,ET,,__time_to_timespec(1, 0, 0, 0, 0, 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1433
    __SET_VAR(data__->,STATE,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1434
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1435
  __SET_VAR(data__->,PREV_IN,,__GET_VAR(data__->IN,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1436
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1437
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1438
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1439
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1440
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1441
} // TP_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1442
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1443
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1444
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1445
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1446
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1447
static void TON_init__(TON *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1448
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1449
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1450
  __INIT_VAR(data__->IN,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1451
  __INIT_VAR(data__->PT,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1452
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1453
  __INIT_VAR(data__->ET,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1454
  __INIT_VAR(data__->STATE,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1455
  __INIT_VAR(data__->PREV_IN,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1456
  __INIT_VAR(data__->CURRENT_TIME,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1457
  __INIT_VAR(data__->START_TIME,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1458
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1459
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1460
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1461
static void TON_body__(TON *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1462
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1463
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1464
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1465
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1466
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1467
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1468
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1469
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1470
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1471
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1472
  #define GetFbVar(var,...) __GET_VAR(data__->var,__VA_ARGS__)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1473
  #define SetFbVar(var,val,...) __SET_VAR(data__->,var,__VA_ARGS__,val)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1474
__SET_VAR(data__->,CURRENT_TIME,,__CURRENT_TIME)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1475
  #undef GetFbVar
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1476
  #undef SetFbVar
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1477
;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1478
  if ((((__GET_VAR(data__->STATE,) == 0) && !(__GET_VAR(data__->PREV_IN,))) && __GET_VAR(data__->IN,))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1479
    __SET_VAR(data__->,STATE,,1);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1480
    __SET_VAR(data__->,Q,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1481
    __SET_VAR(data__->,START_TIME,,__GET_VAR(data__->CURRENT_TIME,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1482
  } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1483
    if (!(__GET_VAR(data__->IN,))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1484
      __SET_VAR(data__->,ET,,__time_to_timespec(1, 0, 0, 0, 0, 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1485
      __SET_VAR(data__->,Q,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1486
      __SET_VAR(data__->,STATE,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1487
    } else if ((__GET_VAR(data__->STATE,) == 1)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1488
      if (LE_TIME(__BOOL_LITERAL(TRUE), NULL, 2, __time_add(__GET_VAR(data__->START_TIME,), __GET_VAR(data__->PT,)), __GET_VAR(data__->CURRENT_TIME,))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1489
        __SET_VAR(data__->,STATE,,2);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1490
        __SET_VAR(data__->,Q,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1491
        __SET_VAR(data__->,ET,,__GET_VAR(data__->PT,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1492
      } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1493
        __SET_VAR(data__->,ET,,__time_sub(__GET_VAR(data__->CURRENT_TIME,), __GET_VAR(data__->START_TIME,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1494
      };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1495
    };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1496
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1497
  __SET_VAR(data__->,PREV_IN,,__GET_VAR(data__->IN,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1498
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1499
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1500
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1501
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1502
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1503
} // TON_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1504
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1505
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1506
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1507
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1508
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1509
static void TOF_init__(TOF *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1510
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1511
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1512
  __INIT_VAR(data__->IN,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1513
  __INIT_VAR(data__->PT,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1514
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1515
  __INIT_VAR(data__->ET,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1516
  __INIT_VAR(data__->STATE,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1517
  __INIT_VAR(data__->PREV_IN,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1518
  __INIT_VAR(data__->CURRENT_TIME,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1519
  __INIT_VAR(data__->START_TIME,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1520
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1521
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1522
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1523
static void TOF_body__(TOF *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1524
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1525
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1526
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1527
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1528
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1529
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1530
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1531
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1532
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1533
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1534
  #define GetFbVar(var,...) __GET_VAR(data__->var,__VA_ARGS__)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1535
  #define SetFbVar(var,val,...) __SET_VAR(data__->,var,__VA_ARGS__,val)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1536
__SET_VAR(data__->,CURRENT_TIME,,__CURRENT_TIME)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1537
  #undef GetFbVar
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1538
  #undef SetFbVar
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1539
;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1540
  if ((((__GET_VAR(data__->STATE,) == 0) && __GET_VAR(data__->PREV_IN,)) && !(__GET_VAR(data__->IN,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1541
    __SET_VAR(data__->,STATE,,1);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1542
    __SET_VAR(data__->,START_TIME,,__GET_VAR(data__->CURRENT_TIME,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1543
  } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1544
    if (__GET_VAR(data__->IN,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1545
      __SET_VAR(data__->,ET,,__time_to_timespec(1, 0, 0, 0, 0, 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1546
      __SET_VAR(data__->,STATE,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1547
    } else if ((__GET_VAR(data__->STATE,) == 1)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1548
      if (LE_TIME(__BOOL_LITERAL(TRUE), NULL, 2, __time_add(__GET_VAR(data__->START_TIME,), __GET_VAR(data__->PT,)), __GET_VAR(data__->CURRENT_TIME,))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1549
        __SET_VAR(data__->,STATE,,2);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1550
        __SET_VAR(data__->,ET,,__GET_VAR(data__->PT,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1551
      } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1552
        __SET_VAR(data__->,ET,,__time_sub(__GET_VAR(data__->CURRENT_TIME,), __GET_VAR(data__->START_TIME,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1553
      };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1554
    };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1555
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1556
  __SET_VAR(data__->,Q,,(__GET_VAR(data__->IN,) || (__GET_VAR(data__->STATE,) == 1)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1557
  __SET_VAR(data__->,PREV_IN,,__GET_VAR(data__->IN,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1558
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1559
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1560
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1561
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1562
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1563
} // TOF_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1564
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1565
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1566
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1567
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1568
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1569
static void DERIVATIVE_init__(DERIVATIVE *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1570
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1571
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1572
  __INIT_VAR(data__->RUN,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1573
  __INIT_VAR(data__->XIN,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1574
  __INIT_VAR(data__->CYCLE,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1575
  __INIT_VAR(data__->XOUT,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1576
  __INIT_VAR(data__->X1,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1577
  __INIT_VAR(data__->X2,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1578
  __INIT_VAR(data__->X3,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1579
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1580
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1581
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1582
static void DERIVATIVE_body__(DERIVATIVE *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1583
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1584
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1585
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1586
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1587
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1588
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1589
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1590
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1591
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1592
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1593
  if (__GET_VAR(data__->RUN,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1594
    __SET_VAR(data__->,XOUT,,((((3.0 * (__GET_VAR(data__->XIN,) - __GET_VAR(data__->X3,))) + __GET_VAR(data__->X1,)) - __GET_VAR(data__->X2,)) / (10.0 * TIME_TO_REAL((BOOL)__BOOL_LITERAL(TRUE),
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1595
      NULL,
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1596
      (TIME)__GET_VAR(data__->CYCLE,)))));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1597
    __SET_VAR(data__->,X3,,__GET_VAR(data__->X2,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1598
    __SET_VAR(data__->,X2,,__GET_VAR(data__->X1,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1599
    __SET_VAR(data__->,X1,,__GET_VAR(data__->XIN,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1600
  } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1601
    __SET_VAR(data__->,XOUT,,0.0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1602
    __SET_VAR(data__->,X1,,__GET_VAR(data__->XIN,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1603
    __SET_VAR(data__->,X2,,__GET_VAR(data__->XIN,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1604
    __SET_VAR(data__->,X3,,__GET_VAR(data__->XIN,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1605
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1606
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1607
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1608
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1609
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1610
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1611
} // DERIVATIVE_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1612
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1613
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1614
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1615
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1616
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1617
static void HYSTERESIS_init__(HYSTERESIS *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1618
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1619
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1620
  __INIT_VAR(data__->XIN1,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1621
  __INIT_VAR(data__->XIN2,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1622
  __INIT_VAR(data__->EPS,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1623
  __INIT_VAR(data__->Q,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1624
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1625
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1626
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1627
static void HYSTERESIS_body__(HYSTERESIS *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1628
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1629
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1630
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1631
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1632
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1633
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1634
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1635
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1636
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1637
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1638
  if (__GET_VAR(data__->Q,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1639
    if ((__GET_VAR(data__->XIN1,) < (__GET_VAR(data__->XIN2,) - __GET_VAR(data__->EPS,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1640
      __SET_VAR(data__->,Q,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1641
    };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1642
  } else if ((__GET_VAR(data__->XIN1,) > (__GET_VAR(data__->XIN2,) + __GET_VAR(data__->EPS,)))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1643
    __SET_VAR(data__->,Q,,1);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1644
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1645
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1646
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1647
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1648
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1649
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1650
} // HYSTERESIS_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1651
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1652
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1653
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1654
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1655
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1656
static void INTEGRAL_init__(INTEGRAL *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1657
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1658
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1659
  __INIT_VAR(data__->RUN,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1660
  __INIT_VAR(data__->R1,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1661
  __INIT_VAR(data__->XIN,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1662
  __INIT_VAR(data__->X0,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1663
  __INIT_VAR(data__->CYCLE,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1664
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1665
  __INIT_VAR(data__->XOUT,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1666
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1667
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1668
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1669
static void INTEGRAL_body__(INTEGRAL *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1670
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1671
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1672
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1673
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1674
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1675
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1676
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1677
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1678
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1679
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1680
  __SET_VAR(data__->,Q,,!(__GET_VAR(data__->R1,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1681
  if (__GET_VAR(data__->R1,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1682
    __SET_VAR(data__->,XOUT,,__GET_VAR(data__->X0,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1683
  } else if (__GET_VAR(data__->RUN,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1684
    __SET_VAR(data__->,XOUT,,(__GET_VAR(data__->XOUT,) + (__GET_VAR(data__->XIN,) * TIME_TO_REAL((BOOL)__BOOL_LITERAL(TRUE),
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1685
      NULL,
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1686
      (TIME)__GET_VAR(data__->CYCLE,)))));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1687
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1688
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1689
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1690
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1691
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1692
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1693
} // INTEGRAL_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1694
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1695
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1696
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1697
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1698
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1699
static void PID_init__(PID *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1700
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1701
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1702
  __INIT_VAR(data__->AUTO,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1703
  __INIT_VAR(data__->PV,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1704
  __INIT_VAR(data__->SP,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1705
  __INIT_VAR(data__->X0,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1706
  __INIT_VAR(data__->KP,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1707
  __INIT_VAR(data__->TR,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1708
  __INIT_VAR(data__->TD,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1709
  __INIT_VAR(data__->CYCLE,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1710
  __INIT_VAR(data__->XOUT,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1711
  __INIT_VAR(data__->ERROR,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1712
  INTEGRAL_init__(&data__->ITERM,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1713
  DERIVATIVE_init__(&data__->DTERM,retain);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1714
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1715
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1716
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1717
static void PID_body__(PID *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1718
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1719
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1720
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1721
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1722
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1723
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1724
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1725
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1726
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1727
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1728
  __SET_VAR(data__->,ERROR,,(__GET_VAR(data__->PV,) - __GET_VAR(data__->SP,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1729
  __SET_VAR(data__->ITERM.,RUN,,__GET_VAR(data__->AUTO,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1730
  __SET_VAR(data__->ITERM.,R1,,!(__GET_VAR(data__->AUTO,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1731
  __SET_VAR(data__->ITERM.,XIN,,__GET_VAR(data__->ERROR,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1732
  __SET_VAR(data__->ITERM.,X0,,(__GET_VAR(data__->TR,) * (__GET_VAR(data__->X0,) - __GET_VAR(data__->ERROR,))));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1733
  __SET_VAR(data__->ITERM.,CYCLE,,__GET_VAR(data__->CYCLE,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1734
  INTEGRAL_body__(&data__->ITERM);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1735
  __SET_VAR(data__->DTERM.,RUN,,__GET_VAR(data__->AUTO,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1736
  __SET_VAR(data__->DTERM.,XIN,,__GET_VAR(data__->ERROR,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1737
  __SET_VAR(data__->DTERM.,CYCLE,,__GET_VAR(data__->CYCLE,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1738
  DERIVATIVE_body__(&data__->DTERM);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1739
  __SET_VAR(data__->,XOUT,,(__GET_VAR(data__->KP,) * ((__GET_VAR(data__->ERROR,) + (__GET_VAR(data__->ITERM.XOUT,) / __GET_VAR(data__->TR,))) + (__GET_VAR(data__->DTERM.XOUT,) * __GET_VAR(data__->TD,)))));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1740
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1741
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1742
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1743
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1744
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1745
} // PID_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1746
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1747
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1748
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1749
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1750
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1751
static void RAMP_init__(RAMP *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1752
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1753
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1754
  __INIT_VAR(data__->RUN,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1755
  __INIT_VAR(data__->X0,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1756
  __INIT_VAR(data__->X1,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1757
  __INIT_VAR(data__->TR,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1758
  __INIT_VAR(data__->CYCLE,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1759
  __INIT_VAR(data__->BUSY,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1760
  __INIT_VAR(data__->XOUT,0.0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1761
  __INIT_VAR(data__->XI,0,retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1762
  __INIT_VAR(data__->T,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1763
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1764
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1765
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1766
static void RAMP_body__(RAMP *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1767
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1768
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1769
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1770
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1771
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1772
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1773
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1774
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1775
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1776
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1777
  __SET_VAR(data__->,BUSY,,__GET_VAR(data__->RUN,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1778
  if (__GET_VAR(data__->RUN,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1779
    if (GE_TIME(__BOOL_LITERAL(TRUE), NULL, 2, __GET_VAR(data__->T,), __GET_VAR(data__->TR,))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1780
      __SET_VAR(data__->,BUSY,,0);
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1781
      __SET_VAR(data__->,XOUT,,__GET_VAR(data__->X1,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1782
    } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1783
      __SET_VAR(data__->,XOUT,,(__GET_VAR(data__->XI,) + (((__GET_VAR(data__->X1,) - __GET_VAR(data__->XI,)) * TIME_TO_REAL((BOOL)__BOOL_LITERAL(TRUE),
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1784
        NULL,
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1785
        (TIME)__GET_VAR(data__->T,))) / TIME_TO_REAL((BOOL)__BOOL_LITERAL(TRUE),
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1786
        NULL,
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1787
        (TIME)__GET_VAR(data__->TR,)))));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1788
      __SET_VAR(data__->,T,,__time_add(__GET_VAR(data__->T,), __GET_VAR(data__->CYCLE,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1789
    };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1790
  } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1791
    __SET_VAR(data__->,XOUT,,__GET_VAR(data__->X0,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1792
    __SET_VAR(data__->,XI,,__GET_VAR(data__->X0,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1793
    __SET_VAR(data__->,T,,__time_to_timespec(1, 0, 0, 0, 0, 0));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1794
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1795
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1796
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1797
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1798
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1799
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1800
} // RAMP_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1801
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1802
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1803
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1804
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1805
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1806
static void RTC_init__(RTC *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1807
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1808
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1809
  __INIT_VAR(data__->IN,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1810
  __INIT_VAR(data__->PDT,__dt_to_timespec(0, 0, 0, 1, 1, 1970),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1811
  __INIT_VAR(data__->Q,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1812
  __INIT_VAR(data__->CDT,__dt_to_timespec(0, 0, 0, 1, 1, 1970),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1813
  __INIT_VAR(data__->PREV_IN,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1814
  __INIT_VAR(data__->OFFSET,__time_to_timespec(1, 0, 0, 0, 0, 0),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1815
  __INIT_VAR(data__->CURRENT_TIME,__dt_to_timespec(0, 0, 0, 1, 1, 1970),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1816
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1817
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1818
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1819
static void RTC_body__(RTC *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1820
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1821
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1822
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1823
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1824
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1825
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1826
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1827
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1828
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1829
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1830
  #define GetFbVar(var,...) __GET_VAR(data__->var,__VA_ARGS__)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1831
  #define SetFbVar(var,val,...) __SET_VAR(data__->,var,__VA_ARGS__,val)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1832
__SET_VAR(data__->,CURRENT_TIME,,__CURRENT_TIME)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1833
  #undef GetFbVar
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1834
  #undef SetFbVar
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1835
;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1836
  if (__GET_VAR(data__->IN,)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1837
    if (!(__GET_VAR(data__->PREV_IN,))) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1838
      __SET_VAR(data__->,OFFSET,,__time_sub(__GET_VAR(data__->PDT,), __GET_VAR(data__->CURRENT_TIME,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1839
    };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1840
    __SET_VAR(data__->,CDT,,__time_add(__GET_VAR(data__->CURRENT_TIME,), __GET_VAR(data__->OFFSET,)));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1841
  } else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1842
    __SET_VAR(data__->,CDT,,__GET_VAR(data__->CURRENT_TIME,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1843
  };
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1844
  __SET_VAR(data__->,Q,,__GET_VAR(data__->IN,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1845
  __SET_VAR(data__->,PREV_IN,,__GET_VAR(data__->IN,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1846
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1847
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1848
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1849
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1850
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1851
} // RTC_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1852
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1853
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1854
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1855
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1856
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1857
static void SEMA_init__(SEMA *data__, BOOL retain) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1858
  __INIT_VAR(data__->EN,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1859
  __INIT_VAR(data__->ENO,__BOOL_LITERAL(TRUE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1860
  __INIT_VAR(data__->CLAIM,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1861
  __INIT_VAR(data__->RELEASE,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1862
  __INIT_VAR(data__->BUSY,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1863
  __INIT_VAR(data__->Q_INTERNAL,__BOOL_LITERAL(FALSE),retain)
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1864
}
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1865
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1866
// Code part
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1867
static void SEMA_body__(SEMA *data__) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1868
  // Control execution
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1869
  if (!__GET_VAR(data__->EN)) {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1870
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(FALSE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1871
    return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1872
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1873
  else {
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1874
    __SET_VAR(data__->,ENO,,__BOOL_LITERAL(TRUE));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1875
  }
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1876
  // Initialise TEMP variables
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1877
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1878
  __SET_VAR(data__->,Q_INTERNAL,,(__GET_VAR(data__->CLAIM,) || (__GET_VAR(data__->Q_INTERNAL,) && !(__GET_VAR(data__->RELEASE,)))));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1879
  __SET_VAR(data__->,BUSY,,__GET_VAR(data__->Q_INTERNAL,));
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1880
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1881
  goto __end;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1882
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1883
__end:
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1884
  return;
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1885
} // SEMA_body__() 
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1886
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1887
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1888
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1889
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1890
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1891
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1892
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1893
31224f8cac32 Move standard FBs to a pre-converted C file, insted of converting them every time along with the IEC source.
mjsousa
parents:
diff changeset
  1894
#endif //_IEC_STD_FB_H