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)
BLINK (FB) ¶ FUNCTION_BLOCK BLINK Simulates a blinking signal (turning on and off for specific durations) InOut: Scope Name Type Comment Input ENABLE BOOL TRUE : Starts blinking FALSE : Stops blinking whereas OUT keeps its value TIMELOW TIME Time for OUT to be FALSE TIMEHIGH TIME Time for OUT to be TRUE Output OUT BOOL Output value, starts with FALSE and switches between TRUE and FALSE for the given high and low times
FREQ_MEASURE (FB) ¶ FUNCTION_BLOCK FREQ_MEASURE Measures the frequency of a signal InOut: Scope Name Type Initial Comment Input IN BOOL Input signal PERIODS INT (1..10) 1 A period is the time between two rising edges of the input signal. OUT will equal the average frequency during the given PERIODS (number of periods; minimal 1 maximal 10). The function block will not work unless this value is between 1 and 10. RESET BOOL Reset measurement Output OUT REAL Frequency [Hz] VALID BOOL FALSE : As long as the first measure has been finished. Or time distance between two rising edges > 3 * OUT . (Indicates that something is wrong with the inputs)
GEN (FB) ¶ FUNCTION_BLOCK GEN Generates periodic functions of different, given types The generation may be done relative to a specific time base or a given call-count base ( BASE ). An example set of available types of periodic functions are shown in the following image. InOut: Scope Name Type Initial Comment Input MODE GEN_MODE Types available: TRIANGLE : Triangular from - AMPLITUDE to + AMPLITUDE TRIANGLE_POS : Triangular from 0 to + AMPLITUDE SAWTOOTH_RISE : Sawtooth increasing from - AMPLITUDE to + AMPLITUDE SAWTOOTH_FALL : Sawtooth decreasing from + AMPLITUDE to - AMPLITUDE RECTANGLE : Rectangular switching from - AMPLITUDE to + AMPLITUDE SINE : Sine COSINE : Cosine BASE BOOL FALSE : Period referring to call ( CYCLES ) TRUE : Period referring to time ( PERIOD ) PERIOD TIME TIME#1s0ms Period time, only relevant if BASE = TRUE CYCLES INT 1000 Number of calls per period, only relevant if BASE = FALSE AMPLITUDE INT Amplitud of the function to be generated RESET BOOL TRUE : Sets OUT to zero Output OUT INT Generated function value
Enums ¶ ERROR (Enum) PERIOD (Enum) WEEKDAY (Enum)
ERROR (ENUM) ¶ TYPE ERROR : Attributes: qualified_only InOut: Name Initial NO_ERROR WRONG_CONFIGURATION 2 RTC_HIGHRES_NOT_SUPPORTED SYS_TIMEZONE_NOT_SUPPORTED
PERIOD (ENUM) ¶ TYPE PERIOD : Attributes: qualified_only InOut: Name Initial UNKNOWN 0 STANDARD 1 DAYLIGHT 2
POINT (STRUCT) ¶ TYPE POINT : STRUCT InOut: Name Type X DINT Y DINT
PT_SIZE (STRUCT) ¶ TYPE PT_SIZE : STRUCT InOut: Name Type Comment pString POINTER TO BYTE Pointer to the text uiSize UINT Size of the text