/*2019-05-14T12:01:44-01:00*/

/********************************************************************
 * graf_mdl_prdpos.c
 * 
 * generated by: plcgen 3.0.331
 ********************************************************************/

#include "cb_comp.h"
#include "iec_1131.h"

#include "graf_mdl_prdpos.h"


/**************************** Variables *****************************/

CB_Index graf_mdl_prdpos__num = 0;
CB_Mem_Bool *graf_mdl_prdpos_acq;
CB_Mem_Bool *graf_mdl_prdpos_AU;
CB_Mem_Bool *graf_mdl_prdpos_dprise;
CB_Mem_Bool *graf_mdl_prdpos_dpose;
CB_Mem_Bool *graf_mdl_prdpos_vacuostat;
CB_Mem_Bool *graf_mdl_prdpos_CR_VZS;
CB_Mem_Bool *graf_mdl_prdpos_CR_VZR;
CB_Mem_Bool *graf_mdl_prdpos_def_VZ;
CB_Mem_Bool *graf_mdl_prdpos_VZS;
CB_Mem_Bool *graf_mdl_prdpos_VZR;
CB_Mem_Bool *graf_mdl_prdpos_VTM;
CB_Mem_Bool *graf_mdl_prdpos_VTA;
CB_Mem_Bool *graf_mdl_prdpos_OKprise;
CB_Mem_Bool *graf_mdl_prdpos_OKpose;
CB_Mem_Bool *graf_mdl_prdpos_def_prisepose;
CB_Mem_Int *graf_mdl_prdpos_t1;
CB_Mem_Int *graf_mdl_prdpos_t2;
CB_Mem_Int *graf_mdl_prdpos_TTL;

/**************************** Variables *****************************/

#define acq (graf_mdl_prdpos_acq->CB_current_value)
#define AU (graf_mdl_prdpos_AU->CB_current_value)
#define dprise (graf_mdl_prdpos_dprise->CB_current_value)
#define dpose (graf_mdl_prdpos_dpose->CB_current_value)
#define vacuostat (graf_mdl_prdpos_vacuostat->CB_current_value)
#define CR_VZS (graf_mdl_prdpos_CR_VZS->CB_current_value)
#define CR_VZR (graf_mdl_prdpos_CR_VZR->CB_current_value)
#define def_VZ (graf_mdl_prdpos_def_VZ->CB_current_value)
#define VZS (graf_mdl_prdpos_VZS->CB_current_value)
#define VZR (graf_mdl_prdpos_VZR->CB_current_value)
#define VTM (graf_mdl_prdpos_VTM->CB_current_value)
#define VTA (graf_mdl_prdpos_VTA->CB_current_value)
#define OKprise (graf_mdl_prdpos_OKprise->CB_current_value)
#define OKpose (graf_mdl_prdpos_OKpose->CB_current_value)
#define def_prisepose (graf_mdl_prdpos_def_prisepose->CB_current_value)
#define t1(i) (graf_mdl_prdpos_t1[i+1].CB_current_value)
#define t2 (graf_mdl_prdpos_t2->CB_current_value)
#define TTL(i) (graf_mdl_prdpos_TTL[i+1].CB_current_value)


/************************ Components offsets ************************/


/********************* Initialization function **********************/

int _sfp__graf_mdl_prdpos_init(void)
{
	(self.Int+5+3)->CB_current_value = 100000; /*TTL[2]*/
	self.Int+=9;


	return 0;
}


/************************ Behavior function *************************/

int sfp__graf_mdl_prdpos(void)
{
	if (exec_term_node(self_num)) {

		/*********************** Internals variables ************************/

		graf_mdl_prdpos_t1 = self.Int+0;
		graf_mdl_prdpos_t2 = self.Int+4;
		graf_mdl_prdpos_TTL = self.Int+5;

		/********************* Pre-conditions execution *********************/

		/*no Pre-conditions*/

		/************************ Behavior execution ************************/

		{
			/*pre-SFC*/
			/*post-SFC*/
		}

		CB_post_bool(graf_mdl_prdpos_VZS);
		CB_post_bool(graf_mdl_prdpos_VZR);
		CB_post_bool(graf_mdl_prdpos_VTM);
		CB_post_bool(graf_mdl_prdpos_VTA);
		CB_post_bool(graf_mdl_prdpos_OKprise);
		CB_post_bool(graf_mdl_prdpos_OKpose);
		CB_post_bool(graf_mdl_prdpos_def_prisepose);

		/******************** Post-conditions execution *********************/

		/*no Post-conditions*/
	}

	/*************************** self update ****************************/

	self.Int += 9;

	return 0;
}

