Structure Definitions

ST_ControllerParameter

TYPE ST_ParaControlValue :
STRUCT
   
(***********************************************************************)

    (* general parameters *)
    iMode : E_ControlMode; (* 1=heating, 2=cooling,
3=heating&cooling *)
    iReactionOnFailure : E_ReactionOnFailure; (* 0=controller off,
1=manual op, 2=yMin, 3=yMax *)
    fYTune : LREAL; (* step change while tuning operation *)
    fYStable : LREAL; (* tuning operation *)
    dwAlarmSupp : DWORD; (* alarm suppression *)
    tCtrlCycleTime : TIME; (* controller cycle time *)
    tTaskCycleTime : TIME; (* plc task cycle time *)
   
(***********************************************************************)

    (* setpoint parameters *)
    fWMin : LREAL; (* lower limit *)
    fWMax : LREAL; (* upper limit *)
    (* start up *)
    fWStartUp : LREAL; (* soft start plateau setpoint *)
    tStartUp : TIME; (* soft start waiting time*)
    bStartUpRamping : BOOL; (* enable ramping while start up phase
*)
    fWStartUpVeloPos : LREAL; (* max gradient for increasing
setpoint in start up phase*)
    fWStartUpVeloNeg : LREAL; (* max gradient for decreasing
setpoint in start up phase *)
    fWVeloPos : LREAL; (* max gradient for increasing setpoint
*)
    fWVeloNeg : LREAL; (* max gradient for decreasing setpoint
*)
   
(***********************************************************************)

    (* actual value parameters *)
    bFilter : BOOL;
    tFilter : TIME;
   
(***********************************************************************)

    (* control value parameters *)
    fYMin : LREAL; (* lower limit *)
    fYMax : LREAL; (* upper limit *)
    fYManual : LREAL; (* manual operation*)
    fYOnFailure : LREAL; (* control value on failure *)
    tPWMCycleTime : TIME; (* PWM *)
   
(***********************************************************************)

    (* controller settings *)
    bEnablePreController : BOOL; (* enable precontroller *)
    bEnableZones : BOOL; (* enable zone around setpoint with open
loop control *)
    bEnableCVFilter : BOOL; (* enable filter for CV (type see
iFilterType) *)
    iFilterType : E_FilterType; (* filtertype of CV filter *)
    iControllerType : E_ControllerType; (* used controller normally
PID *)
   
(***********************************************************************)

    (* min max temperatures *)
    TempLow : LREAL;
    TempLowLow : LREAL;
    TempHigh : LREAL;
    TempHighHigh : LREAL;
    TempAbsoluteHigh : LREAL;
    TempAbsoluteLow : LREAL;
   
(***********************************************************************)

    (* internal tuning parameters *)
    fTuneKp : LREAL := 1.2;
    fTuneTn : LREAL := 2.0;
    fTuneTv : LREAL := 0.42;
    fTuneTd : LREAL := 0.25;
END_STRUCT
END_TYPE

Description

Name

Unit

Value range

Description

iMode

none

INT

Controller operation mode (1 = heating, 2 = cooling, 3 = heating & cooling) (see below)

iReactionOnFailure

none

INT

Parameterizable reaction to errors (see below)

fYTune

none

LREAL

Control value during the self-tuning (normally 100%)

fYStable

none

LREAL

Control value during the settling phase (normally 0%)

dwAlarmSupp

none

DWORD

Masks out the alarms (see below)

tCtrlCycleTime

s

TIME

Controller's sampling time. In the course of the sampling time the controller re-calculates the control value.

tTaskCycleTime

s

TIME

Task cycle time. The FB is called with this time interval.

fWMin

K

LREAL

Minimum setpoint.

fWMax

K

LREAL

Maximum setpoint.

fWVeloPos

K/s

LREAL

Rate of rise (of ramp).

fWVeloNeg

K/s

LREAL

Rate of fall (of ramp).

fWStartUp

K

LREAL

Setpoint at start-up.

tStartUp

s

TIME

Time with the fWStartUp setpoint.

bStartUpRamping

none

[TRUE,FALSE]

Switches on ramping during the start-up phase.

fWStartUpVeloPos

K/s

LREAL

Rate of rise (of ramp) during the start-up phase.

fWStartUpVeloNeg

K/s

LREAL

Rate of fall (of ramp) during the start-up phase

fYMin

none

LREAL

Minimum value of the control value.

fYMax

none

LREAL

Maximum value of the control value.

fYManual

none

LREAL

Control value in manual operation.

fYOnFailure

none

LREAL

Control value in case of error (parameterizable).

tPWMCycleTime

s

TIME

Cycle time of the PWM signal.

tFilter

s

TIME

Time constant of the actual value filter (first order P-T1 filter)

bFilter

none

[TRUE,FALSE]

The actual value filter is actuated if TRUE.

bEnablePreController

none

[TRUE,FALSE]

Switches pre-controller on.

bEnableZones

none

[TRUE,FALSE]

Switches open loop characteristic on until close to setpoint.

bEnableCVFilter

none

[TRUE,FALSE]

Switches on control value filter following the main controller.

iFilterType

none

ENUM

Selection of a filter type for the control value filter following the main controller (see below).

iControllerType

none

ENUM

Selection of a control algorithm (see below)

TempLow

K

LREAL

Relative lower temperature limit in the first band.

TempLowLow

K

LREAL

Relative lower temperature limit in the second band.

TempHigh

K

LREAL

Relative upper temperature limit in the first band.

TempHighHigh

K

LREAL

Relative upper temperature limit in the second band.

TempAbsoluteHigh

K

LREAL

Absolute upper temperature limit.

TempAbsoluteLow

K

LREAL

Absolute lower temperature limit.

fTuneKp

none

LREAL

FineTuning parameters for the PID controller (only for advanced users)

fTuneTn

none

LREAL

FineTuning parameters for the PID controller (only for advanced users)

fTuneTv

none

LREAL

FineTuning parameters for the PID controller (only for advanced users)

fTuneTd

none

LREAL

FineTuning parameters for the PID controller (only for advanced users)

Description

ST_ParaController

TYPE ST_ParaController :
STRUCT
    (* Main Controller parameter set *)
    KpMain : LREAL;
    TnMain : LREAL;
    TvMain : LREAL;
    TdMain : LREAL;
    (* Pre Controller parameter set *)
    KpPre : LREAL;
    TvPre : LREAL;
    TdPre : LREAL;
END_STRUCT
END_TYPE

Description

Name

Unit

Value range

Description

KpMain

none

LREAL

Amplification factor for the main controller.

TnMain

s

TIME

Integral action time for main controller (I component).

TvMain

s

TIME

Derivative action time for main controller (D component).

TdMain

s

TIME

Damping time for the main controller.

KpPre

none

LREAL

Amplification factor for the pre-controller.

TvPre

s

TIME

Derivative action time for pre-controller (D component).

TdPre

s

TIME

Damping time for the pre-controller.

ENUM: error codes

Name

Description

TC_ERR_NOERROR

No error.

TC_ERR_INVALIDPARAM

Invalid parameter.

TC_ERR_NO_INIT

Missing function block initialization.

TC_ERR_NO_INFLECTION_POINT

No inflection was found during self-tuning. No parameters could be determined.

TC_ERR_INVALID_PARAM

Invalid parameter.

TC_ERR_INVALID_CYCLETIME

Invalid combination of cycle times (sampling times and PWM cycle times).

TC_ERR_WRONG_TU

A valid value for the Tu parameter could not be found due to faulty or aborted self-tuning.

ENUM: ReactionOnFailure

Name

Description

TC_OnFailureNoFailure

No error.

TC_OnFailureStopController

If there is an error (an alarm) the controller will stop.

TC_OnFailureSetManMode

If there is an error (an alarm) the controller will switch to manual operation.

TC_OnFailureSetYMax

If there is an error (an alarm) set the control value to its maximum.

TC_OnFailureSetYMin

If there is an error (an alarm) set the control value to its minimum.

ENUM: ST_ControlMode

Name

Description

CTRLMODE_HEATING

Heating only.

CTRLMODE_COOLING

Cooling only.

CTRLMODE_HEATING_COOLING

Heating and cooling.

ENUM: states

Name

Description

TC_STATE_IDLE

Controller switched off.

TC_STATE_INIT

Controller is being initialized.

TC_STATE_OFF

Controller switched off, was previously switched on.

TC_STATE_TUNE

Controller in tuning / self-tuning state.

TC_STATE_MANUAL_OPERATION

Controller in manual operation.

TC_STATE_CLOSED_LOOP

Controller in automatic operation.

TC_STATE_TUNE_IDLE

Tuning started but not yet running. Waiting for idle.

TC_STATE_TUNE_PULSE

Pulse for determination of dead time.

TC_STATE_TUNE_STEP

Step for determination of dead time and maximum velocity.

TC_STATE_TUNE_READY

Self-tuning complete.

TC_STATE_ERROR

Error (logical error).

ENUM: E_FilterType

Name

Description

E_FilterType_FIRSTORDER

First order filter.

E_FilterType_AVERAGE

Mean value filter.

ENUM: E_ControllerType

Name

Description

E_ControllerType_PID

Standard PID control algorithm.

E_ControllerType_PIDD2

Planned serial PID control algorithm.

Bit-masks for alarms

Name

Mask

Description

nAlarmOpenThermocouple

2#0000_0000_0000_0000_0000_0000_0000_0001

Hardware: open temperature sensor

nAlarmReverseThermocouple

2#0000_0000_0000_0000_0000_0000_0000_0010

Hardware: reverse connected temperature sensor

nAlarmBackVoltage

2#0000_0000_0000_0000_0000_0000_0000_0100

Hardware: excessive voltage at temperature sensor

nAlarmLeakageCurrent

2#0000_0000_0000_0000_0000_0000_0000_1000

Hardware: leakage current measured

nAlarmShortCircuit

2#0000_0000_0000_0000_0000_0000_0001_0000

Hardware: short circuit

nAlarmOpenCircuit

2#0000_0000_0000_0000_0000_0000_0010_0000

Hardware: no current

nAlarmLimitLow

2#0000_0000_0000_0000_0000_0001_0000_0000

Software: fallen below first lower relative temperature

nAlarmLimitLowLow

2#0000_0000_0000_0000_0000_0010_0000_0000

Software: fallen below second lower relative temperature

nAlarmLimitHigh

2#0000_0000_0000_0000_0000_0100_0000_0000

Software: first upper relative temperature exceeded

nAlarmLimitHighHigh

2#0000_0000_0000_0000_0000_1000_0000_0000

Software: second upper relative temperature exceeded

nAlarmAbsoluteHigh

2#0000_0000_0000_0000_0001_0000_0000_0000

Software: upper absolute temperature exceeded

nAlarmAbsoluteLow

2#0000_0000_0000_0000_0010_0000_0000_0000

Software: fallen below lower absolute temperature