Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
21
Добавлен:
11.10.2020
Размер:
3.39 Mб
Скачать

342 The UTIL.LIB Library

Function manipulators

PERIOD or CYCLES defines the corresponding cycle period.

AMPLITUDE defines, in a trivial way, the amplitude of the function to be generated.

The function generator is again set to 0 as soon as RESET=TRUE.

Example in FBD:

14.7 Function manipulators

14.7.1CHARCURVE

This function block serves to represent values, piece by piece, on a linear function:

IN of the type INT is fed with the value to be manipulated. The BYTE N designates the number of points which defines the presentation function. This characteristic line is then generated in an ARRAY P[0..10] with P of the type POINT which is a structure based on two INT values (X and Y).

The output consists of OUT of the type INT, the manipulated value and BYTE ERR, which will indicate an error if necessary.

The points P[0]..P[N-1] in the ARRAY must be sorted according to their X values, otherwise ERR receives the value 1. If the input IN is not between P[0].X and P[N-1].X, ERR=2 and OUT contains the corresponding limiting value P[0]. Y or P[N-1].Y.

If N lies outside of the allowed values which are between 2 and 11, then

ERR=4.

Example in ST:

First of all ARRAY P must be defined in the header:

VAR

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32

The UTIL.LIB Library 343

Function manipulators

...

CHARACTERISTIC_LINE:CHARCURVE;

KL:ARRAY[0..10] OF POINT:= (X:=0,Y:=0), (X:=250,Y:=50), (X:=500,Y:=150), (X:=750,Y:=400), 7((X:=1000,Y:=1000));

COUNTER:INT;

...

END_VAR

Then we supply CHARCURVE with for example a constantly increasing value:

COUNTER:=COUNTER+10;

CHARACTERISTIC_LINE(IN:=COUNTER,N:=5,P:=KL);

The subsequent tracing illustrates the effect:

14.7.2RAMP_INT

RAMP_INT serves to limit the ascendance or descendance of the function being fed:

The input consists on the one hand out of three INT values: IN, the function input, and ASCEND and DESCEND, the maximum increase or decrease for a given time interval, which is defined by TIMEBASE of the type TIME. Setting RESET to TRUE causes RAMP_INT to be initialised anew.

The output OUT of the type INT contains the ascend and descend limited function value.

When TIMEBASE is set to t#0s, ASCEND and DESCEND are not related to the time interval, but remain the same.

Example in CFC:

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32

Соседние файлы в папке 759-332