PID_FIXCYCLE (FB) ¶ FUNCTION_BLOCK PID_FIXCYCLE Represents a PID controller for which the cycle time can be set manually A PID controller continuously calculates an error value e(t) as the difference between a desired set point and a measured process variable. The PID contoller applies a correction based on proportional, integral, and derivative terms (sometimes denoted P, I, and D respectively) which give their name to the controller type. Note For fast and fix tasks it is recommended to use PID_FIXCYCLE instead of PID, because the cycle time is defined accurately, whereas PID only can measure the cycle time with a maximum accuracy of milliseconds. In case of very short cycles (1ms) this might lead to a rough run (see PID). Note It is not necessary to readjust the controller parameters (KP, TN, TV) if the cycle time changes. For more information see: PID . InOut: Scope Name Type Initial Comment Input ACTUAL REAL Actual value, process variable SET_POINT REAL Desired value, set point KP REAL Proportionality const. P TN REAL Reset time I in sec TV REAL Rate time, derivative time D in sec Y_MANUAL REAL Y is set to this value as long as MANUAL = TRUE Y_OFFSET REAL Offset for manipulated variable Y_MIN REAL Minimum value for manipulated variable Y_MAX REAL Maximum value for manipulated variable MANUAL BOOL TRUE : Manual : Y is not influenced by controller FALSE : Controller determines Y RESET BOOL TRUE : Sets Y output to Y_OFFSET and reset integral part CYCLE REAL Time in s between two calls Output Y REAL Manipulated variable, set value LIMITS_ACTIVE BOOL FALSE TRUE : Set value would exceed limits Y_MIN , Y_MAX OVERFLOW BOOL FALSE Overflow in integral part
Datatypes ¶ GEN_MODE (Enum) POINT (Struct) PT_SIZE (Struct)
GEN_MODE (ENUM) ¶ TYPE GEN_MODE : InOut: Name Initial TRIANGLE 0 TRIANGLE_POS 1 SAWTOOTH_RISE 2 SAWTOOTH_FALL 3 RECTANGLE 4 SINUS 5 COSINUS 6 SINE 7 COSINE 8
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)
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)