FB_GENIbusMagnaPump

FB_GENIbusMagnaPump 1:

This function block represents a universal application for a Grundfos Magna pump. The fundamental operating modes can be set and important parameters read out.

FB_GENIbusMagnaPump 2:

The values shown below in bold and in square brackets represent the class and ID with which the commands are executed or the information is obtained. These values are listed in the Grundfos documentation "Operating the MAGNA3 and MGE model H/I via the GENIpro interface - Edition 01.00.35 - April 2015".

FB_GENIbusMagnaPump 3: Inputs

VAR_INPUT
  bEnable                : BOOL;
  byAddr                 : BYTE;
  tInfoCycle             : TIME;
  lrSetpoint             : LREAL;
  bSetSetpoint           : BOOL;
  eSetOpMode             : E_GENIbusOpMode := eGENIbusOpModeStop;
  bSetOpMode             : BOOL;
  eSetCtrlMode           : E_GENIbusCtrlMode := eGENIbusCtrlModeConstFreq;
  bSetCtrlMode           : BOOL;
  eSetNightReductionMode : E_GENIbusNightReductionMode := eGENIbusNightReductionModeOff;
  bSetNightReductionMode : BOOL;
  eSetKeyMode            : E_GENIbusKeyMode := eGENIbusKeyModeUnlocked;
  bSetKeyMode            : BOOL;
  bResetAlarm            : BOOL;
  bResetCounters         : BOOL;
  eCommandPriority       : E_GENIbusCommandPriority := eGENIbusCommandPriorityMiddle;
END_VAR

Name

Type

Description

bEnable

BOOL

The function block is enabled by setting this input.

byAdress

BYTE

Address of the GENIbus device to be addressed: valid entries: 1 - 200. This corresponds to the setting as is made directly on the GENIbus device. A conversion to the actual address range of 32 - 231, see GENIbus standard, takes place internally in the function block.
A broadcast or collective command to several pumps is also possible. The value at this input must then be 255. The value queries are disabled in the case of the broadcast command.

tInfoCycle

TIME

Specifies the interval at which the value-query commands are to be output. This entry is limited to a minimum of 1 s. Conversely, the entry "0s" is permitted and means that no query takes place. 

lrSetpoint

LREAL

Setpoint entry [5, 1] . The entry is in percent and refers to the specified limits, depending on the method of control. A more precise description is given in the respective documentation from the Grundfos company.

bSetSetpoint

BOOL

A rising edge at this input transmits the set setpoint.

eSetOpMode

E_GENIbusOpMode

This input is used to select one of the following operating modes:
Stop [3, 5]

Start [3, 6]

Minimum curve [3, 25]

Maximum curve [3, 26]

bSetOpMode

BOOL

A rising edge at this input transmits the set operating mode.

eSetCtrlMode

E_GENIbusCtrlMode

This input is used to set one of the following control modes:

Constant frequency [3, 22]

Proportional pressure [3, 23]

Constant pressure [3, 24]

Auto-adapting [3, 52]

bSetCtrlMode

BOOL

A rising edge at this input transmits the set control mode.

eSetNightReductionMode

E_GENIbusNightReductionMode

This input is used to select or deselect the night reduction mode [4, 170]

bSetNightReductionMode

BOOL

A rising edge at this input transmits the set selection.

eSetKeyMode

E_GENIbusKeyMode

Locking of the manual operation on the pump can be selected with the aid of this input. The lock only blocks the parameterization menu, not the keys themselves. [3, 30/31]

bSetKeyMode

BOOL

A rising edge at this input transmits the set selection.

bResetAlarm

BOOL

A rising edge at this input resets the currently pending alarm on the device. [3, 2]

bResetCounters

BOOL

A rising edge at this input resets counters, such as operating hours or energy. [3, 36]

eCommandPriority

E_GENIbusCommandPriority

Priority (high, medium or low) with which the command is processed by the PLC library.

FB_GENIbusMagnaPump 4: Inputs/outputs

VAR_IN_OUT
  stCommandBuffer   : ST_GENIbusCommandBuffer;
END_VAR

Name

Type

Description

stCommandBuffer

ST_GENIbusCommandBuffer

Reference to the structure for communication (buffer) with the FB_GENIbusCommunication() function block

FB_GENIbusMagnaPump 5: Outputs

VAR_OUTPUT
  bBusy                  : BOOL;
  bError                 : BOOL;
  udiErrorId             : UDINT;
  udiErrorArg            : UDINT;
  eActualOpMode          : E_GENIbusActOpMode;
  eActualCtrlMode        : E_GENIbusActCtrlMode;
  bNightReduction        : BOOL;
  bWarning               : BOOL;
  byWarnCode             : BYTE;
  bAlarm                 : BOOL;
  byAlarmCode            : BYTE;
  bKeysLocked            : BOOL;
  stActualSetpoint       : ST_GENIbusMValue;
  stNormalizedSetpoint   : ST_GENIbusMValue;
  stPumpFlow             : ST_GENIbusMValue;
  stPowerConsumption     : ST_GENIbusMValue;
  stRotationalSpeed      : ST_GENIbusMValue;
  stPumpHead             : ST_GENIbusMValue;
  stEngeryConsumption    : ST_GENIbusMValue;
  stOperatingHours       : ST_GENIbusMValue;
  stMediumTemperature    : ST_GENIbusMValue;
END_VAR

Name

Type

Description

bBusy

BOOL

Starting with the edge at bStart, this output remains TRUE until the command has been processed.

bError

BOOL

This output is switched to TRUE as soon as an error occurs during the execution of a command. The command-specific error code is contained in udiErrorId.

udiErrorId

UDINT

Contains the command-specific error code of the most recently executed command (see error codes). It is set back to 0 by the reactivation of the function block via the bStart input.

udiErrorArg

UDINT

If applicable, contains an extended description of the error code.

eActualOpMode

E_GENIbusActOpMode

Currently valid operating mode [2, 81]

eActualCtrlMode

E_GENIbusActCtrlMode

Currently valid control mode [2, 81]

bNightReduction

BOOL

Night reduction is selected. [2, 84]

bWarning

BOOL

A warning message is pending.

byWarnCode

BYTE

Code of the current warning message. [2, 156]

bAlarm

BOOL

An alarm is pending.

byAlarmCode

BYTE

Code of the current alarm. [2, 158]

bKeysLocked

BOOL

Locking of manual operation on the pump is enabled. [4, 170]

stActualSetpoint

ST_GENIbusMValue

Currently set setpoint; the unit displayed depends on the control mode [2, 48]

stNormalizedSetpoint

ST_GENIbusMValue

Current normalized setpoint [2, 49]

stPumpFlow

ST_GENIbusMValue

Flow rate [2, 39]

stPowerConsumption

ST_GENIbusMValue

Power consumption [2, 34]

stRotationalSpeed

ST_GENIbusMValue

Rotational speed [2, 35/36]

stPumpHead

ST_GENIbusMValue

Pump head [2, 37]

stEngeryConsumption

ST_GENIbusMValue

Energy consumption [2, 152/153]

stOperatingHours

ST_GENIbusMValue

Operating hours counter [2, 24/25]

stMediumTemperature

ST_GENIbusMValue

Water (medium) temperature [2, 58]

FB_GENIbusMagnaPump 6:

Since an error may not interrupt the execution of the function block, bError, udiErrorId and udiErrorArg are initially reset in every PLC cycle and then re-evaluated. For the determination of sporadically occurring errors, an error memory must therefore be programmed external to the function block.

Requirements

Development environment

PLC library to include

TwinCAT from v3.1.4020.14

Tc2_GENIbus from v3.3.0.0