lib/C/iec_std_FB_no_ENENO.h
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 12 Oct 2016 17:52:48 +0300
changeset 1024 df3e2792fd58
parent 1011 76175defb87b
permissions -rw-r--r--
make autogenerated functions to be 'static inline' instead of 'inline'

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