FB_GENIbusMagnaPump
This function block represents a universal application for a Grundfos Magna pump. The fundamental operating modes can be set and important parameters read out.
![]() | The values shown in bold lettering inside square brackets represent the class and ID with which the commands are executed, or the information acquired. 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”. |
VAR_INPUT
bEnable : BOOL;
byAddr : BYTE := 0;
tInfoCycle : TIME := t#5s;
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;
bSetKeyMode : BOOL;
bResetAlarm : BOOL;
bResetCounters : BOOL;
eCommandPriority : E_GENIbusCommandPriority := eGENIbusCommandPriorityMiddle;
bEnable: The function block is activated by setting this input.
byAdress : 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. Conversion to the actual address range 32 – 231 (see GENIbus standard), takes place internally in the function block.
A broadcast (collective) command to several pumps is also possible. The value at this input must then be 255. The value queries are deactivated in the case of the broadcast command.
tInfoCycle: 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: 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: A rising edge at this input transmits the set setpoint.
eSetOpMode: This input is used to set one of the following operating modes:
- Stop [3, 5]
- Start [3, 6]
- Minimum curve [3, 25]
- Maximum curve [3, 26]
bSetOpMode: A rising edge at this input transmits the set operating mode.
eSetCtrlMode: 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: A rising edge at this input transmits the set control mode.
eSetNightReductionMode: This input is used to select or deselect the night setback mode. [4, 170]
bSetNightReductionMode: A rising edge at this input transmits the set selection.
eSetKeyMode: 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: A rising edge at this input transmits the set selection.
bResetAlarm: A rising edge at this input resets the currently pending alarm on the device. [3, 2]
bResetCounters: A rising edge at this input resets counters, such as operating hours or energy. [3, 36]
eCommandPriority: Priority (high, medium or low) with which the command is processed by the PLC library.
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;
bBusy: This output is always TRUE when a command or query is being processed.
bError: 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: Contains the command-specific error code of the most recently executed command. It is set back to 0 by the reactivation of the function block via the bStart input. See Error codes.
udiErrorArg: If applicable, contains an extended description of the error code.
eActualOpMode: Currently valid operating mode. [2, 81]
eActualCtrlMode: Currently valid control mode. [2, 81]
bNightReduction: Night setback is selected. [2, 84]
bWarning: A warning message is pending.
byWarnCode: Code of the current warning message. [2, 156]
bAlarm: An alarm is pending.
byAlarmCode: Code of the current alarm. [2, 158]
bKeysLocked: Locking of manual operation on the pump is activated. [4, 170]
stActualSetpoint: Currently set setpoint; the unit displayed depends on the control mode. [2, 48]
stNormalizedSetpoint: Currently normalized setpoint. [2, 49]
stPumpFlow: Flow rate. [2, 39]
stPowerConsumption: Power consumption. [2, 34]
stRotationalSpeed: Speed. [2, 35/36]
stPumpHead: Pump head. [2, 37]
stEngeryConsumption: Energy consumption. [2, 152/153]
stOperatingHours: Operating hour meter. [2, 24/25]
stMediumTemperature: Pumped water (medium) temperature. [2, 58]
![]() | 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. |
VAR_IN_OUT
stCommandBuffer : ST_GENIbusCommandBuffer;
stCommandBuffer: Reference to the structure for communication (buffer) with the FB_GENIbusCommunication() function block.
Requirements
Development environment | Target platform | Required libraries |
---|---|---|
TwinCAT v2.11 R3/x64 from Build 2253 | PC / CX | TcGENIbus library from V1.0.0 |