/*
  function block
  name: plus1
*/

#include <tasy0def.h>
#include <plus1.h>

typedef
   struct {
	long	out;
   } str_data;

uint16 FBINIT_plus1 (uint16 hinstance)
{
   return (sizeof (str_data));
}

void FBACT_plus1 (uint16 hinstance, str_data *data, str_arg *arg)
{
	data->out = IN+1;
}

#define BOO_VALUE   ((T_BOO *)value)
#define ANA_VALUE   ((T_ANA *)value)
#define REAL_VALUE  ((T_REAL *)value)
#define TMR_VALUE   ((T_TMR *)value)
#define MSG_VALUE   ((T_MSG *)value)

void FBREAD_plus1 (uint16 hinstance, str_data *data,
      uint16 parno, void *value)
{
	*ANA_VALUE = data->out;
}

ABP fbldef_plus1 (char *name, IBP *initproc, RBP *readproc)
 {
   strcpy (name, "PLUS1");
   *initproc = (IBP)FBINIT_plus1;
   *readproc = (RBP)FBREAD_plus1;
   return ((ABP)FBACT_plus1);
}
