You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Here is the function block for PumpAndValve. This controls a pump and the associated valve. It will start the pump and open (in our case, a 3-way valve) to supply water to both tanks. It also has the ability to override both pump and valve to off or on, and it returns statuses for auto off or on, or manual off or on. The valve also returns if it is exercising. Furthermore, you can set the exercise time and interval for the pump. And you can enable stirring. When stirring, the valve is closed while the pump is on.


Override pump and valve

Override ValueDescription
0Auto
1Manual On
2Manual Off

Pump states

Override Alarm ValueDescription
0Auto Off
1Auto On
2Manual On
3Manual Off

Valve states

Override Alarm ValueDescription
0Auto Off
1Auto On
2Manual On
3Manual Off
4Motion


With everything explained the Inputs and Outputs are the following,

INPUT

  • OverrideValve → INT
  • OverridePump → INT
  • MotionInterval → TIME
  • MotionDuration → TIME
  • Stirring → BOOL

OUTPUT

  • ValveOut → BOOL
  • PumpOut→ BOOL
  • ValveState → INT
  • PumpState→ INT

INTERNAL VARIABLES

  • Valve → VALVE
  • Pump → PUMP
  • TimerMotionInterval → TON
  • TimerMotionDuration - TOF


CODED SOLUTION

Variable Decleration:

CODE:





  • No labels