#include "beremiz.h"
#ifndef __POUS_H
#define __POUS_H

#include "accessor.h"
#include "iec_std_lib.h"

__DECLARE_ENUMERATED_TYPE(LOGLEVEL,
  LOGLEVEL__CRITICAL,
  LOGLEVEL__WARNING,
  LOGLEVEL__INFO,
  LOGLEVEL__DEBUG
)
// FUNCTION_BLOCK LOGGER
// Data part
typedef struct {
  // FB Interface - IN, OUT, IN_OUT variables
  __DECLARE_VAR(BOOL,EN)
  __DECLARE_VAR(BOOL,ENO)
  __DECLARE_VAR(BOOL,TRIG)
  __DECLARE_VAR(STRING,MSG)
  __DECLARE_VAR(LOGLEVEL,LEVEL)

  // FB private variables - TEMP, private and located variables
  __DECLARE_VAR(BOOL,TRIG0)

} LOGGER;

void LOGGER_init__(LOGGER *data__, BOOL retain);
// Code part
void LOGGER_body__(LOGGER *data__);
// FUNCTION_BLOCK PYTHON_EVAL
// Data part
typedef struct {
  // FB Interface - IN, OUT, IN_OUT variables
  __DECLARE_VAR(BOOL,EN)
  __DECLARE_VAR(BOOL,ENO)
  __DECLARE_VAR(BOOL,TRIG)
  __DECLARE_VAR(STRING,CODE)
  __DECLARE_VAR(BOOL,ACK)
  __DECLARE_VAR(STRING,RESULT)

  // FB private variables - TEMP, private and located variables
  __DECLARE_VAR(DWORD,STATE)
  __DECLARE_VAR(STRING,BUFFER)
  __DECLARE_VAR(STRING,PREBUFFER)
  __DECLARE_VAR(BOOL,TRIGM1)
  __DECLARE_VAR(BOOL,TRIGGED)

} PYTHON_EVAL;

void PYTHON_EVAL_init__(PYTHON_EVAL *data__, BOOL retain);
// Code part
void PYTHON_EVAL_body__(PYTHON_EVAL *data__);
// FUNCTION_BLOCK CSV_READ_BY_STRING
// Data part
typedef struct {
  // FB Interface - IN, OUT, IN_OUT variables
  __DECLARE_VAR(BOOL,EN)
  __DECLARE_VAR(BOOL,ENO)
  __DECLARE_VAR(BOOL,ACK)
  __DECLARE_VAR(STRING,RESULT)
  __DECLARE_VAR(STRING,FILE_NAME)
  __DECLARE_VAR(STRING,ROW)
  __DECLARE_VAR(STRING,COLUMN)

  // FB private variables - TEMP, private and located variables
  __DECLARE_EXTERNAL(BOOL,PYEXT_CSV_UPDATE)
  __DECLARE_VAR(STRING,OLDCODE)
  PYTHON_EVAL PY_EVAL;
  R_TRIG R_TRIG0;
  R_TRIG R_TRIG1;
  SR SR0;
  __DECLARE_VAR(STRING,_TMP_CONCAT7_OUT)
  __DECLARE_VAR(BOOL,_TMP_NE16_OUT)
  __DECLARE_VAR(STRING,_TMP_SEL18_OUT)
  __DECLARE_VAR(BOOL,_TMP_OR15_OUT)
  __DECLARE_VAR(STRING,_TMP_LEFT33_OUT)
  __DECLARE_VAR(BOOL,_TMP_NE34_OUT)
  __DECLARE_VAR(BOOL,_TMP_AND39_OUT)
  R_TRIG R_TRIG2;

} CSV_READ_BY_STRING;

void CSV_READ_BY_STRING_init__(CSV_READ_BY_STRING *data__, BOOL retain);
// Code part
void CSV_READ_BY_STRING_body__(CSV_READ_BY_STRING *data__);
// FUNCTION_BLOCK PYTHON_GEAR
// Data part
typedef struct {
  // FB Interface - IN, OUT, IN_OUT variables
  __DECLARE_VAR(BOOL,EN)
  __DECLARE_VAR(BOOL,ENO)
  __DECLARE_VAR(UINT,N)
  __DECLARE_VAR(BOOL,TRIG)
  __DECLARE_VAR(STRING,CODE)
  __DECLARE_VAR(BOOL,ACK)
  __DECLARE_VAR(STRING,RESULT)

  // FB private variables - TEMP, private and located variables
  PYTHON_EVAL PY_EVAL;
  __DECLARE_VAR(UINT,COUNTER)
  __DECLARE_VAR(UINT,_TMP_ADD10_OUT)
  __DECLARE_VAR(BOOL,_TMP_EQ13_OUT)
  __DECLARE_VAR(UINT,_TMP_SEL15_OUT)
  __DECLARE_VAR(BOOL,_TMP_AND7_OUT)

} PYTHON_GEAR;

void PYTHON_GEAR_init__(PYTHON_GEAR *data__, BOOL retain);
// Code part
void PYTHON_GEAR_body__(PYTHON_GEAR *data__);
// FUNCTION_BLOCK CSV_RELOAD
// Data part
typedef struct {
  // FB Interface - IN, OUT, IN_OUT variables
  __DECLARE_VAR(BOOL,EN)
  __DECLARE_VAR(BOOL,ENO)
  __DECLARE_VAR(BOOL,ACK)
  __DECLARE_VAR(STRING,RESULT)
  __DECLARE_VAR(BOOL,TRIG)

  // FB private variables - TEMP, private and located variables
  __DECLARE_EXTERNAL(BOOL,PYEXT_CSV_UPDATE)
  PYTHON_EVAL PY_EVAL;
  R_TRIG R_TRIG0;
  F_TRIG F_TRIG0;
  __DECLARE_VAR(BOOL,_TMP_OR11_OUT)
  __DECLARE_VAR(BOOL,_TMP_NOT13_OUT)
  __DECLARE_VAR(BOOL,_TMP_MOVE12_ENO)
  __DECLARE_VAR(BOOL,_TMP_MOVE12_OUT)

} CSV_RELOAD;

void CSV_RELOAD_init__(CSV_RELOAD *data__, BOOL retain);
// Code part
void CSV_RELOAD_body__(CSV_RELOAD *data__);
// FUNCTION_BLOCK CSV_READ_BY_INT
// Data part
typedef struct {
  // FB Interface - IN, OUT, IN_OUT variables
  __DECLARE_VAR(BOOL,EN)
  __DECLARE_VAR(BOOL,ENO)
  __DECLARE_VAR(BOOL,ACK)
  __DECLARE_VAR(STRING,RESULT)
  __DECLARE_VAR(STRING,FILE_NAME)
  __DECLARE_VAR(INT,ROW)
  __DECLARE_VAR(INT,COLUMN)

  // FB private variables - TEMP, private and located variables
  __DECLARE_EXTERNAL(BOOL,PYEXT_CSV_UPDATE)
  __DECLARE_VAR(STRING,OLDCODE)
  PYTHON_EVAL PY_EVAL0;
  R_TRIG R_TRIG1;
  R_TRIG R_TRIG2;
  SR SR0;
  __DECLARE_VAR(STRING,_TMP_INT_TO_STRING31_OUT)
  __DECLARE_VAR(STRING,_TMP_INT_TO_STRING2_OUT)
  __DECLARE_VAR(STRING,_TMP_CONCAT7_OUT)
  __DECLARE_VAR(BOOL,_TMP_NE16_OUT)
  __DECLARE_VAR(STRING,_TMP_SEL18_OUT)
  __DECLARE_VAR(BOOL,_TMP_OR15_OUT)
  __DECLARE_VAR(STRING,_TMP_LEFT33_OUT)
  __DECLARE_VAR(BOOL,_TMP_NE34_OUT)
  __DECLARE_VAR(BOOL,_TMP_AND39_OUT)
  R_TRIG R_TRIG3;

} CSV_READ_BY_INT;

void CSV_READ_BY_INT_init__(CSV_READ_BY_INT *data__, BOOL retain);
// Code part
void CSV_READ_BY_INT_body__(CSV_READ_BY_INT *data__);
// FUNCTION_BLOCK PYTHON_POLL
// Data part
typedef struct {
  // FB Interface - IN, OUT, IN_OUT variables
  __DECLARE_VAR(BOOL,EN)
  __DECLARE_VAR(BOOL,ENO)
  __DECLARE_VAR(BOOL,TRIG)
  __DECLARE_VAR(STRING,CODE)
  __DECLARE_VAR(BOOL,ACK)
  __DECLARE_VAR(STRING,RESULT)

  // FB private variables - TEMP, private and located variables
  __DECLARE_VAR(DWORD,STATE)
  __DECLARE_VAR(STRING,BUFFER)
  __DECLARE_VAR(STRING,PREBUFFER)
  __DECLARE_VAR(BOOL,TRIGM1)
  __DECLARE_VAR(BOOL,TRIGGED)

} PYTHON_POLL;

void PYTHON_POLL_init__(PYTHON_POLL *data__, BOOL retain);
// Code part
void PYTHON_POLL_body__(PYTHON_POLL *data__);
// FUNCTION_BLOCK COUNTERST
// Data part
typedef struct {
  // FB Interface - IN, OUT, IN_OUT variables
  __DECLARE_VAR(BOOL,EN)
  __DECLARE_VAR(BOOL,ENO)
  __DECLARE_VAR(BOOL,RESET)
  __DECLARE_VAR(INT,OUT1)
  __DECLARE_VAR(INT,OUT0)

  // FB private variables - TEMP, private and located variables
  __DECLARE_VAR(INT,CNT0)
  __DECLARE_EXTERNAL(INT,RESETCOUNTERVALUE)
  __DECLARE_EXTERNAL(LREAL,OI_SENSOR_COUNTER)
  __DECLARE_EXTERNAL(DINT,VFD_RELAY0)
  __DECLARE_EXTERNAL(DINT,AIR_VALVE_RELAY0)
  __DECLARE_EXTERNAL(LINT,MES5_INT_COUNTER_IN)
  __DECLARE_EXTERNAL(LINT,MES5_INT_COUNTER_OUT)

} COUNTERST;

void COUNTERST_init__(COUNTERST *data__, BOOL retain);
// Code part
void COUNTERST_body__(COUNTERST *data__);
// PROGRAM PLC_PRG
// Data part
typedef struct {
  // PROGRAM Interface - IN, OUT, IN_OUT variables
  __DECLARE_VAR(BOOL,RESET)
  __DECLARE_VAR(INT,CNT0)
  __DECLARE_VAR(INT,CNT1)

  // PROGRAM private variables - TEMP, private and located variables
  COUNTERST COUNTERST0;

} PLC_PRG;

void PLC_PRG_init__(PLC_PRG *data__, BOOL retain);
// Code part
void PLC_PRG_body__(PLC_PRG *data__);
#endif //__POUS_H
