The function block "EbbFlow" controls ebb and flow for an independent plant tank. The function block is made to be controlled from a SCADA system. From SCADA system you have many options. For example, override Ebb Valve and Flow Valve. You can set times to control duration of both Ebb sequence and Flow sequence. Also, you can set times for exercise intervals and duration of this. This to ensure longest possible life of the valves. Further, you can manually activate ebb or flow sequence. So if tank is in ebb for 5 more hours, and you want flow now. Then function will immediately start ebb sequence, and continue normal after this.

If flow mode is active then fill valve will be open until level switch is active or flow time is up. In this sequence drain valve will also be closed. In ebb mode, the ebb valve will be open for a given time (this to ensure valve is not open unnecessarily long). When time "TimeEbbValveOn" is up, then drain valve will close and tank will be empty without water. Flow valve will then be closed. Until ebb time is up, after this it goes back to fill mode again.

Function block gives out which status all valves are in, if level switch is on, how much time is left of current mode (ebb or flow) and which mode is active.


Override ventiler

Override ValueDescription
0Auto
1Manual On
2Manual 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

  • Start → BOOL
  • StartFlow → BOOL
  • StartEbb→ BOOL
  • TimeFlow → TIME
  • TimeEbb→ TIME
  • LevelGuardIn → BOOL
  • TimeEbbValveOn→ TIME
  • OverrideFlowValve → INT
  • OverrideEbbValve → INT
  • MotionInterval→ TIME
  • MotionDuration → TIME

OUTPUT

  • StateEbbValve → INT
  • StateFlowValve→ INT
  • OUT → BOOL
  • LevelGuardOut→ BOOL
  • OutEbbValve → TIME
  • OutFlowValve → TIME
  • TimeRemaining→ TIME
  • ModeEbb → BOOL
  • ModeFlow → BOOL

INTERNAL VARIABLES

  • LevelGuard→ LEVELGUARD
  • EbbDuration→ TON
  • FlowDuration→ TON
  • FlowValve → MOTORVALVE
  • PULSE_1 → PULSETHREESECONDS
  • PULSE_2 → PULSETHREESECONDS
  • PULSE_3 → PULSEFOURSECONDS
  • EbbValveOpen → TOF
  • EbbValve→ MOTORVALVE
  • TimerMotionInt1 → TON
  • TimerMotionDur1 → TOF
  • TimerMotionInt1 → TON
  • TimerMotionDur1 → TOF
  • HighLowSelect → HIGHLOWSELECT


CODED SOLUTION

Variable Decleration:

CODE:





  • No labels