LIN_TRAFO (FB) ¶ FUNCTION_BLOCK LIN_TRAFO Performs a linear transformation The transformation is performed by using the minimum and maximum values of the inputs for a linear approximation of the output value. Application example: A temperature sensor provides Volt-values (input IN ). These are to be converted to temperature values in degree centigrade (output OUT ). The input (Volt) values range is defined by the limits IN_MIN=0 and IN_MAX=10 . The output(degree centigrade) value range is defined by the limits OUT_MIN=-20 and OUT_MAX=40 . Thus for an input of 5 Volt a temperature of 10 degree centigrade will result. InOut: Scope Name Type Comment Input IN REAL Input value IN_MIN REAL Minimum input value IN_MAX REAL Maximum input value OUT_MIN REAL Corresponding minimum output value OUT_MAX REAL Corresponding maximum output value Output OUT REAL Output value ERROR BOOL TRUE : IN_MIN = IN_MAX or IN out of input range
ROTATION_DIFFERENCE (FB) ¶ FUNCTION_BLOCK ROTATION_DIFFERENCE Computes the difference between two UINT values without rollover This function block receives two values e.g. from an motion encoder and calculates the difference between the two positions. If curValue := 65535 and lastValue := 15, a negative rotation is detected and diffValues := -16. If lastValue := 65535 and curValue := 15, a positive rotation is detected and diffValues := 16. InOut: Scope Name Type Comment Input curValue UINT Current value of rotation lastValue UINT Last value of rotation Output diffValues INT Difference between the two values without rollover
STATISTICS_INT (FB) ¶ FUNCTION_BLOCK STATISTICS_INT Calculates minimum, maximum, and average of an input value The calculation is done over time and can be reset in order to start a fresh caluclation/statistic. InOut: Scope Name Type Initial Comment Input IN INT Input value RESET BOOL TRUE : AVG set to 0, MN and MX to minimum and maximum possible integer values Output MN INT 32767 Minimum value MX INT -32768 Maximum value AVG INT Average value
STATISTICS_REAL (FB) ¶ FUNCTION_BLOCK STATISTICS_REAL Calculates minimum, maximum, and average of an input value The calculation is done over time and can be reset in order to begin a fresh caluclation/statistic. InOut: Scope Name Type Initial Comment Input IN REAL Input value RESET BOOL TRUE : AVG set to 0, MN and MX to minimum and maximum possible real values Output MN REAL 3.402823466E+38 Minimum value MX REAL -3.402823466E+38 Maximum value AVG REAL Average value
VARIANCE (FB) ¶ FUNCTION_BLOCK VARIANCE Calculates the mathematical variance of a variable over time In this case, over time means that the variance is extended for each call to the function block until a reset is done. InOut: Scope Name Type Comment Input IN REAL Input value RESET BOOL Reset Output OUT REAL Variance
Signals ¶ BLINK (FunctionBlock) FREQ_MEASURE (FunctionBlock) GEN (FunctionBlock)
FunctionBlocks ¶ DateTimeProvider (FunctionBlock) GetDateTime (Method) TimerSwitch (FunctionBlock) IDateTimeProvider GetDateTime (Method)
DateTimeProvider (FB) ¶ FUNCTION_BLOCK PUBLIC FINAL DateTimeProvider IMPLEMENTS IDateTimeProvider Methods: GetDateTime Structure: GetDateTime (Method)
DateTimeProvider.GetDateTime (METH) ¶ METHOD FINAL GetDateTime : ULINT InOut: Scope Name Type Comment Return GetDateTime ULINT date and (UTC) time in milliseconds since 1.1.1970 00:00:00.000 Output eErrorID ERROR
TimerSwitch (FB) ¶ FUNCTION_BLOCK PUBLIC FINAL TimerSwitch EXTENDS CBML.LConC IMPLEMENTS ITimeSwitch, IDateTimeProvider InOut: Scope Name Type Initial Comment Inherited from Input xEnable BOOL TRUE : Activates the defined operation FALSE : Aborts/resets the defined operation LConC Output xBusy BOOL TRUE : Operation is running LConC xError BOOL TRUE : Error condition reached LConC Input Const itfDateTimeProvider IDateTimeProvider Globals.g_dtpDateTimeProvider Source for the current date and time information in milliseconds since 1.1.1970 00:00:00.000 tCompensationSpeed TIME Compensation speed [ms/h] for the transition from one time zone period to another. e.g. t#5000ms => 30d <= 1/(30 × 24) × 60 × 60 × 1000 e.g. t#150000ms => 24h <= 1/24 × 60 × 60 × 1000 Input aslSchedule POINTER TO Schedule Switching Schedule tzTimeZone REFERENCE TO TimeZone Current time zone (Optional - Default: |gc_tzTimeZoneCET| ) Output eErrorID ERROR liClockDiff LINT After switching the time zone, a continuously decreasing difference between the current local time and the current time within the TimeSwitch is displayed. eWeekDay WEEKDAY Current day of the week datToday DATE Current date todNow TOD Current time of the day sTimeZone TZ_NAME Name of the current time zone ePeriod PERIOD Current period of the time zone dwSwitches DWORD Status of the 32 switches. Bit 0 => switch 1, … Methods: GetDateTime Structure: IDateTimeProvider GetDateTime (Method)