0% found this document useful (0 votes)
81 views81 pages

GENERIC D

This document provides a summary of generic base elements for arithmetic, bistable, bit-shift, bitwise operations, comparison, counter, edge detection, numeric, selection, timer, and type conversion functions. It describes the functionality of over 50 different blocks including adder, divider, modulo, multiplier, subtractor, reset/set bistable, bit-shift, AND, OR, XOR, equality, greater/less than, counter, edge detector, absolute value, logarithm, sine/cosine/tangent, limiter, multiplexer, timer, and type conversion functions.

Uploaded by

ngocanhvy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views81 pages

GENERIC D

This document provides a summary of generic base elements for arithmetic, bistable, bit-shift, bitwise operations, comparison, counter, edge detection, numeric, selection, timer, and type conversion functions. It describes the functionality of over 50 different blocks including adder, divider, modulo, multiplier, subtractor, reset/set bistable, bit-shift, AND, OR, XOR, equality, greater/less than, counter, edge detector, absolute value, logarithm, sine/cosine/tangent, limiter, multiplexer, timer, and type conversion functions.

Uploaded by

ngocanhvy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 81

1MRS752371-MUM Generic Base Elements

Issued: 11/1997
Version: D/12.2.2002
Data subject to change without notice

Contents
1. Arithmetic.................................................................................................. 4

1.1 Extensible adder (ADD)....................................................................... 4


1.2 Divider (DIV)........................................................................................ 5
1.3 Exponentiation (EXPT) ........................................................................ 6
1.4 Modulo (MOD)..................................................................................... 7
1.5 Move (MOVE) ..................................................................................... 8
1.6 Extensible multiplier (MUL).................................................................. 9
1.7 Subtract (SUB) .................................................................................. 10

2. Bistable ................................................................................................... 11
2.1 Reset dominant bistable function block (RS) ..................................... 11
2.2 Reset dominant bistable function block (RS_D) with data input......... 12
2.3 Set dominant bistable function block (SR) ......................................... 13
3. Bit-Shift ................................................................................................... 14
3.1 Rotate to left (ROL) ........................................................................... 14
3.2 Rotate to right (ROR) ........................................................................ 15
3.3 Bit-shift to left (SHL) .......................................................................... 16
3.4 Bit-shift to right (SHR) ....................................................................... 17
4. Bitwise Operation ................................................................................... 18

4.1 Extensible bitwise Boolean AND (AND)............................................. 18


4.2 Get one bit (BITGET) ........................................................................ 19
4.3 Set one bit (BITSET) ......................................................................... 20
4.4 Bitwise Boolean NOT (NOT) ............................................................. 22
4.5 Extensible bitwise Boolean OR (OR)................................................. 23
4.6 Extensible bitwise Boolean XOR (XOR) ............................................ 24

5. Comparison ............................................................................................ 25

5.1 Hysteresis comparator (COMH) ........................................................ 25


5.2 Extensible equality (EQ) .................................................................... 26
5.3 Extensible greater than or equal (GE) ............................................... 27
5.4 Extensible greater than (GT) ............................................................. 28
5.5 Extensible less than or equal (LE) ..................................................... 29
5.6 Extensible less than (LT) ................................................................... 30
Generic Base Elements Substation Automation

5.7 Not equal (NE) ...................................................................................31

6. Counter ....................................................................................................32
6.1 Down-counter (CTD)..........................................................................32
6.2 Up-down counter (CTUD) ..................................................................34
6.3 Up-counter (CTU) ..............................................................................37
7. Edge Detection........................................................................................39

7.1 Falling edge detector (F_TRIG) .........................................................39


7.2 Rising edge detector (R_TRIG)..........................................................40

8. Numeric ...................................................................................................41
8.1 Absolute value (ABS).........................................................................41
8.2 Principal arc cosine (ACOS) ..............................................................42
8.3 Principal arc sine (ASIN)....................................................................43
8.4 Principal arc tangent (ATAN) .............................................................44
8.5 Cosine in radians (COS) ....................................................................45
8.6 Natural exponential (EXP) .................................................................46
8.7 Natural logarithm (LN)........................................................................47
8.8 Logarithm base 10 (LOG) ..................................................................48
8.9 Sine in radians (SIN)..........................................................................49
8.10 Square root (SQRT)...........................................................................50
8.11 Tangent in radians (TAN)...................................................................51

9. Selection..................................................................................................52
9.1 Limiter (LIMIT) ...................................................................................52
9.2 Extensible maximum (MAX)...............................................................53
9.3 Extensible minimum (MIN).................................................................54
9.4 Multiplexer (MUX) ..............................................................................55
9.5 Binary selection (SEL) .......................................................................56

10. Timer ......................................................................................................57

10.1 Time delay OFF (TOF).......................................................................57


10.2 Time delay ON (TON) ........................................................................58
10.3 Pulse (TP)..........................................................................................59
10.4 Pulse width for TOF, TON and TP .....................................................60
11. Type Conversion ...................................................................................61

11.1 BOOL inputs to INT output (BOOL2INT)............................................61


11.2 BOOL to ** (BOOL_TO_**) ................................................................63

2
Substation Automation Generic Base Elements

11.3 BYTE to ** (BYTE_TO_**)................................................................. 64


11.4 DATE to UDINT (DATE_TO_UDINT) ................................................ 65
11.5 DINT to ** (DINT_TO_**)................................................................... 66
11.6 DWORD to ** (DWORD_TO_**)........................................................ 67
11.7 INT input to BOOL outputs (INT2BOOL) ........................................... 68
11.8 INT to ** (INT_TO_**)........................................................................ 70
11.9 REAL to ** (REAL_TO_**)................................................................. 71
11.10SINT to ** (SINT_TO_**) ................................................................... 73
11.11TIME to ** (TIME_TO_**) .................................................................. 74
11.12TOD to ** (TOD_TO_**) .................................................................... 75
11.13UDINT to ** (UDINT_TO_**).............................................................. 76
11.14UINT to ** (UINT_TO_**)................................................................... 77
11.15USINT to ** (USINT_TO_**) .............................................................. 78
11.16WORD to ** (WORD_TO_**)............................................................. 79
12. Truncation toward Zero........................................................................ 80

12.1 TRUNC_REAL_TO_**....................................................................... 80

3
Generic Base Elements Substation Automation

1. Arithmetic

1.1 Extensible adder (ADD)

)LJXUH )XQFWLRQEORFNV\PERO

1.1.1 Input description

Name Type Description


IN1 ANY_NUM Input 1
IN2 ANY_NUM Input 2
INn ANY_NUM Input n

1.1.2 Output description

Name Type Description


OUT ANY_NUM Output

1.1.3 Description of operation

OUT := IN1 + IN2 + ... + INn

For example:

ADD(2,3) = 5
ADD(2,-3) = -1

4
Substation Automation Generic Base Elements

1.2 Divider (DIV)

)LJXUH )XQFWLRQEORFNV\PERO

1.2.1 Input description

Name Type Description


IN1 ANY_NUM Input 1
IN2 ANY_NUM Input 2

1.2.2 Output description

Name Type Description


OUT ANY_NUM Output

1.2.3 Description of operation

OUT := IN1 / IN2

For example:

DIV(7,3) = 2

5
Generic Base Elements Substation Automation

1.3 Exponentiation (EXPT)

)LJXUH )XQFWLRQEORFNV\PERO

1.3.1 Input description

Name Type Description


IN1 ANY_REAL Input 1
IN2 ANY_NUM Input 2

1.3.2 Output description

Name Type Description


OUT ANY_REAL Output

1.3.3 Description of operation

OUT := IN1IN2

For example:

EXPT(2, 3) = 8

6
Substation Automation Generic Base Elements

1.4 Modulo (MOD)

)LJXUH )XQFWLRQEORFNV\PERO

1.4.1 Input description

Name Type Description


IN1 ANY_INT Input 1
IN2 ANY_INT Input 2

1.4.2 Output description

Name Type Description


OUT ANY_INT Output

1.4.3 Description of operation

Returns the remainder after division IN1/IN2.

OUT := IN1 modulo IN2

Example:

MOD(7,3) = 1

7
Generic Base Elements Substation Automation

1.5 Move (MOVE)

)LJXUH )XQFWLRQEORFNV\PERO

1.5.1 Input description

Name Type Description


IN ANY Input

1.5.2 Output description

Name Type Description


OUT ANY Output

1.5.3 Description of operation

OUT := IN

8
Substation Automation Generic Base Elements

1.6 Extensible multiplier (MUL)

)LJXUH )XQFWLRQEORFNV\PERO

1.6.1 Input description

Name Type Description


IN1 ANY_NUM Input 1
IN2 ANY_NUM Input 2
INn ANY_NUM Input n

1.6.2 Output description

Name Type Description


OUT ANY_NUM Output

1.6.3 Description of operation

OUT:= IN1 * IN2 * ... * INn

For example:

MUL(2,3) = 6

9
Generic Base Elements Substation Automation

1.7 Subtract (SUB)

)LJXUH )XQFWLRQEORFNV\PERO

1.7.1 Input description

Name Type Description


IN1 ANY_NUM Input 1
IN2 ANY_NUM Input 2

1.7.2 Output description

Name Type Description


OUT ANY_NUM Output

1.7.3 Description of operation

OUT := IN1 - IN2

For example:

SUB(3,2) = 1

10
Substation Automation Generic Base Elements

2. Bistable

2.1 Reset dominant bistable function block (RS)

)LJXUH )XQFWLRQEORFNV\PERO

2.1.1 Input description

Name Type Description


SET BOOL Set input
RESET1 BOOL Reset input

2.1.2 Output description

Name Type Description


Q1 BOOL Output

2.1.3 Description of operation

The output Q1 is reset if the RESET1 input is set, regardless of the state of the SET
input. If the SET input is set and RESET1 is low, the output pin Q1 is set. If both the
inputs are FALSE, the output Q1 will preserve its previous value.

11
Generic Base Elements Substation Automation

2.2 Reset dominant bistable function block (RS_D) with data input

)LJXUH )XQFWLRQEORFNV\PERO

2.2.1 Input description

Name Type Description


SET BOOL Set input
D BOOL Data input
LOAD BOOL Loads the RS_D with the value at input D
RESET BOOL Reset input

2.2.2 Output description

Name Type Description


Q BOOL Output

2.2.3 Description of operation

If only SET and RESET are used, RS_D operates as an ordinary RS element. When
the RESET input is reset and LOAD goes to 1, the value at D is stored at the output
Q. When the RESET input is set, the output Q is unconditionally reset, i.e. the RESET
input overrides the other inputs.

12
Substation Automation Generic Base Elements

2.3 Set dominant bistable function block (SR)

)LJXUH )XQFWLRQEORFNV\PERO

2.3.1 Input description

Name Type Description


SET1 BOOL Dominant set input
RESET BOOL Reset input

2.3.2 Output description

Name Type Description


Q1 BOOL Output

2.3.3 Description of operation

The output Q1 is set if the SET1 input is set, regardless of the state of the RESET
input. If the RESET input is set and SET1 is low, the output pin Q1 is cleared. If both
the inputs are FALSE, the output will preserve its previous value.

13
Generic Base Elements Substation Automation

3. Bit-Shift

3.1 Rotate to left (ROL)

)LJXUH )XQFWLRQEORFNV\PERO

3.1.1 Input description

Name Type Description


IN ANY_BIT Input value to be rotated
N ANY_BIT Number of bit positions to
rotate

3.1.2 Output description

Name Type Description


OUT ANY_BIT Output

3.1.3 Description of operation

OUT := IN rotated to the left by N bits, circular.

14
Substation Automation Generic Base Elements

3.2 Rotate to right (ROR)

)LJXUH )XQFWLRQEORFNV\PERO

3.2.1 Input description

Name Type Description


IN ANY_BIT Input value to be rotated
N ANY_BIT Number of bit positions to
rotate

3.2.2 Output description

Name Type Description


OUT ANY_BIT Output

3.2.3 Description of operation

OUT := IN rotated to the right by N bits, circular.

15
Generic Base Elements Substation Automation

3.3 Bit-shift to left (SHL)

)LJXUH )XQFWLRQEORFNV\PERO

3.3.1 Input description

Name Type Description


IN ANY_BIT Input value to be shifted
N ANY_BIT Number of bit positions to
shift

3.3.2 Output description

Name Type Description


OUT ANY_BIT Output

3.3.3 Description of operation

OUT := IN left-shifted by N bits, zero filled on right.

16
Substation Automation Generic Base Elements

3.4 Bit-shift to right (SHR)

)LJXUH )XQFWLRQEORFNV\PERO

3.4.1 Input description

Name Type Description


IN ANY_BIT Input 1
N ANY_BIT Input 2

3.4.2 Output description

Name Type Description


OUT ANY_BIT Output

3.4.3 Description of operation

OUT := IN right-shifted by N bits, zero-filled on left.

17
Generic Base Elements Substation Automation

4. Bitwise Operation

4.1 Extensible bitwise Boolean AND (AND)

)LJXUH )XQFWLRQEORFNV\PERO

4.1.1 Input description

Name Type Description


IN1 ANY_BIT Input 1
IN2 ANY_BIT Input 2
INn ANY_BIT Input n

4.1.2 Output description

Name Type Description


OUT ANY_BIT Output

4.1.3 Description of operation

OUT := IN1 & IN2 & ... & INn

For example:

AND(TRUE,FALSE) = FALSE
AND(0x0F,0x08) = 0x08

18
Substation Automation Generic Base Elements

4.2 Get one bit (BITGET)

4.2.1 Application

BITGET is used to read a selected bit of an integer value and is thus useful in reading
the status information of a relay.

)LJXUH )XQFWLRQEORFNV\PERO

4.2.2 Input description

Name Type Description


BITNR INT Input for selecting the bit number to be read
IN WORD Data input

4.2.3 Output description

Name Type Description


Q BOOL Status of the bit read

4.2.4 Description of operation

If the BITNR is not within the range from 0 to 15, the output Q is FALSE. Otherwise
the bit value of IN, specified by BITNR, is loaded to the output Q.

LSB = Least significant bit


MSB = Most significant bit
For example:

BITGET(BITNR=2, IN=WORD#2#0000_1111_0000_0100) = TRUE


BITGET(BITNR=3, IN=WORD#2#0000_1111_0000_0100) = FALSE

19
Generic Base Elements Substation Automation

4.3 Set one bit (BITSET)

4.3.1 Application

BITSET is used to set a selected bit of an integer value and is thus useful in writing
the status information of a relay.

)LJXUH )XQFWLRQEORFNV\PERO

4.3.2 Input description

Name Type Description


EN BOOL Enable input
BITNR INT Input for selecting the bit number to be set
BIT BOOL Value of the bit (input)
IN WORD Data input

4.3.3 Output description

Name Type Description


Q WORD Output of the set data

4.3.4 Description of operation

When the input EN is FALSEthe data input IN is loaded unchanged to the output Q.
When the input EN is TRUE, the value of the bit number BITNR of the input data IN
is replaced by the value of the input BIT and the result is loaded to the output Q. If the
BITNR input is not within the range from 0 to 15, the output Q remains unchanged.

LSB = Least significant bit


MSB = Most significant bit

20
Substation Automation Generic Base Elements

For example:

BITSET(EN=TRUE, BITNR=2, BIT=TRUE,


IN=WORD#2#0000_1111_0000_0000) = WORD#2#0000_1111_0000_0100
BITSET(EN=TRUE, BITNR=2, BIT=FALSE,
IN=WORD#2#0000_1111_0000_0100) = WORD#2#0000_1111_0000_0000
BITSET(EN=FALSE, BITNR=2, BIT=FALSE,
IN=WORD#2#0000_1111_0000_0100) = WORD#2#0000_1111_0000_0100

21
Generic Base Elements Substation Automation

4.4 Bitwise Boolean NOT (NOT)

)LJXUH )XQFWLRQEORFNV\PERO

4.4.1 Input description

Name Type Description


IN ANY_BIT Input

4.4.2 Output description

Name Type Description


OUT ANY_BIT Output

4.4.3 Description of operation

OUT := NOT IN

For example:

NOT(TRUE) = FALSE
NOT(FALSE) = TRUE
NOT(0x80) = 0x7F

22
Substation Automation Generic Base Elements

4.5 Extensible bitwise Boolean OR (OR)

)LJXUH )XQFWLRQEORFNV\PERO

4.5.1 Input description

Name Type Description


IN1 ANY_BIT Input 1
IN2 ANY_BIT Input 2
INn ANY_BIT Input n

4.5.2 Output description

Name Type Description


OUT ANY_BIT Output

4.5.3 Description of operation

OUT := IN1 OR IN2 OR ... INn

For example:

OR(TRUE, FALSE) = TRUE


OR(0x01, 0x0F) = 0x0F

23
Generic Base Elements Substation Automation

4.6 Extensible bitwise Boolean XOR (XOR)

)LJXUH )XQFWLRQEORFNV\PERO

4.6.1 Input description

Name Type Description


IN1 ANY_BIT Input 1
IN2 ANY_BIT Input 2
INn ANY_BIT Input n

4.6.2 Output description

Name Type Description


OUT ANY_BIT Output

4.6.3 Description of operation

OUT := IN1 XOR IN2 XOR ... XOR INn

For example:

XOR(FALSE,FALSE) = FALSE
XOR(TRUE,TRUE) = FALSE
XOR(FALSE,TRUE) = TRUE
XOR(TRUE, FALSE) = TRUE
XOR(0x08, 0x0F) = 0x07

24
Substation Automation Generic Base Elements

5. Comparison

5.1 Hysteresis comparator (COMH)

5.1.1 Application

COMH is used for monitoring a value with limits.

)LJXUH )XQFWLRQEORFNV\PERO

5.1.2 Input description

Name Type Description


IN INT Input value
HHYS INT Higher limit value
LHYS INT Lower limit value

5.1.3 Output description

Name Type Description


Q BOOL Output

5.1.4 Description of operation

The output Q is set to TRUE if IN ≥ HHYS and reset to FALSE if IN ≤ LHYS.


Otherwise the output Q remains unchanged.

25
Generic Base Elements Substation Automation

5.2 Extensible equality (EQ)

)LJXUH )XQFWLRQEORFNV\PERO

5.2.1 Input description

Name Type Description


IN1 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 1
IN2 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 2
INn ANY_BIT, ANY_NUM, ANY_DATE, TIME Input n

5.2.2 Output description

Name Type Description


OUT BOOL Output

5.2.3 Description of operation

OUT := (IN1 = IN2) & (IN2 = IN3) & ... & (INn-1 = INn)

For example:

EQ(1,0) = FALSE

26
Substation Automation Generic Base Elements

5.3 Extensible greater than or equal (GE)

)LJXUH )XQFWLRQEORFNV\PERO

5.3.1 Input description

Name Type Description


IN1 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 1
IN2 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 2
INn ANY_BIT, ANY_NUM, ANY_DATE, TIME Input n

5.3.2 Output description

Name Type Description


OUT BOOL Output

5.3.3 Description of operation

OUT := (IN1 ≥ IN2) & (IN2 ≥ IN3) & ... & (INn-1 ≥ INn)

For example:

GE(10,9) = TRUE
GE(10,10) = TRUE
GE(9, 10) = FALSE

27
Generic Base Elements Substation Automation

5.4 Extensible greater than (GT)

)LJXUH )XQFWLRQEORFNV\PERO

5.4.1 Input description

Name Type Description


IN1 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 1
IN2 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 2
INn ANY_BIT, ANY_NUM, ANY_DATE, TIME Input n

5.4.2 Output description

Name Type Description


OUT BOOL Output

5.4.3 Description of operation

OUT := (IN1 > IN2) & (IN2 > IN3) & ... & (INn-1 > INn)

For example:

GT(10,9) = TRUE
GT(10,10) = FALSE
GT(9, 10) = FALSE

28
Substation Automation Generic Base Elements

5.5 Extensible less than or equal (LE)

)LJXUH )XQFWLRQEORFNV\PERO

5.5.1 Input description

Name Type Description


IN1 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 1
IN2 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 2
INn ANY_BIT, ANY_NUM, ANY_DATE, TIME Input n

5.5.2 Output description

Name Type Description


OUT BOOL Output

5.5.3 Description of operation

OUT := (IN1 ≤ IN2) & ( IN2 ≤ IN3) & ... & (INn-1 ≤ INn)

For example:

LE(10,9) = FALSE
LE(10,10) = TRUE
LE(9, 10) = TRUE

29
Generic Base Elements Substation Automation

5.6 Extensible less than (LT)

)LJXUH )XQFWLRQEORFNV\PERO

5.6.1 Input description

Name Type Description


IN1 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 1
IN2 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 2
INn ANY_BIT, ANY_NUM, ANY_DATE, TIME Input n

5.6.2 Output description

Name Type Description


OUT BOOL Output

5.6.3 Description of operation

OUT := (IN1 < IN2) & (IN2 < IN3) & ... & (INn-1 < INn)

For example:

LT(10,9) = FALSE
LT(10,10) = FALSE
LT(9, 10) = TRUE

30
Substation Automation Generic Base Elements

5.7 Not equal (NE)

)LJXUH )XQFWLRQEORFNV\PERO

5.7.1 Input description

Name Type Description


IN1 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 1
IN2 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 2

5.7.2 Output description

Name Type Description


OUT BOOL Output

5.7.3 Description of operation

OUT := (IN1 <> IN2)

For example:

NE(10,9) = TRUE
NE(10,10) = FALSE
NE(9, 10) = TRUE

31
Generic Base Elements Substation Automation

6. Counter

6.1 Down-counter (CTD)

)LJXUH )XQFWLRQEORFNV\PERO

6.1.1 Input description

Name Type Description


CD BOOL Count down
LOAD BOOL Load preset value
PV INT Preset value

6.1.2 Output description

Name Type Description


Q BOOL Supervision output
CV INT Counter value output

6.1.3 Description of operation

6.1.3.1 Counting

When the LOAD input is FALSE, each rising edge at the CD input decrements the
counter value CV by one.

6.1.3.2 Presetting

The LOAD input is used to load the new preset value of the counter from PV. The
counter is held as long as the LOAD input is TRUE.

32
Substation Automation Generic Base Elements

6.1.3.3 Supervision

The status output Q specifies the relation of the counter value to zero.Q is set when
CV ≤ 0.

6.1.3.4 Limits

When the counter reaches its lowest or highest value for the data type INT, all
counting ceases.

33
Generic Base Elements Substation Automation

6.2 Up-down counter (CTUD)

)LJXUH )XQFWLRQEORFNV\PERO
Note! The CTUD function complies with the corrected version of the IEC 61131-3
standard (see the correction below).

2.5.2.3.3 Table 36, No.3: DELETE the extraneous BOOL


output of the CTUD block and change its definition
(corrected 97-05-13)
to the following to provide proper operation when
both CU and CD inputs are TRUE:
IF R THEN CV := 0 ;
ELSIF LD THEN CV := PV ;
ELSE
IF NOT (CU AND CD) THEN
IF CU AND (CV < PVmax)
THEN CV := CV+1;
ELSIF CD AND (CV > PVmin)
THEN CV := CV-1;
END_IF;
END_IF;
END_IF ;
QU := (CV ≥ PV) ;
QD := (CV ≤ 0) ;

34
Substation Automation Generic Base Elements

6.2.1 Input description

Name Type Description


CU BOOL Count up
CD BOOL Count down
RESET BOOL Reset counter
LOAD BOOL Load preset value
PV INT Preset value

6.2.2 Output description

Name Type Description


QU BOOL Supervision output 1
QD BOOL Supervision output 2
CV INT Counter value output

6.2.3 Description of operation

6.2.3.1 Up-count

Each rising edge at the CU input increments the counter value by one. If there is a
rising edge at both CU and CD, nothing is done.

6.2.3.2 Down-count

Each rising edge at the CD input decrements the counter value by one. If there is a
rising edge at both CU and CD, nothing is done.

6.2.3.3 Clearing

The RESET input clears the counter and prevents all further counting or loading.
When set, RESET overrides the other inputs of the counter and prevents them from
affecting the state of the counter.

6.2.3.4 Supervision

The status outputs specify the relation of the counter value to zero and to a loaded
preset value. QD is set when CV ≤ 0 and QU is set when CV ≥ PV.

35
Generic Base Elements Substation Automation

6.2.3.5 Limits

When the counter reaches its lowest or highest value for the data type INT, all
counting ceases.

36
Substation Automation Generic Base Elements

6.3 Up-counter (CTU)

)LJXUH )XQFWLRQEORFNV\PERO

6.3.1 Input description

Name Type Description


CU BOOL Count-up input
RESET BOOL Reset counter
PV INT Preset value input

6.3.2 Output description

Name Type Description


Q BOOL Supervision output
CV INT Counter value

6.3.3 Description of operation

6.3.3.1 Counting

When the RESET input is FALSE, each rising edge at the CU input increments the
counter value CV by one.

6.3.3.2 Clearing

The input RESET clears the counter (CV := 0) and prevents all further counting.

37
Generic Base Elements Substation Automation

6.3.3.3 Supervision

The status output Q specifies the relation of the counter value to a supervision high
limit value. The Q is set, when CV ≥ PV.

6.3.3.4 Limits

When the counter reaches its lowest or highest value for the data type INT, all
counting ceases.

38
Substation Automation Generic Base Elements

7. Edge Detection

7.1 Falling edge detector (F_TRIG)

)LJXUH )XQFWLRQEORFNV\PERO

7.1.1 Input description

Name Type Description


CLK BOOL Input

7.1.2 Output description

Name Type Description


Q BOOL Output

7.1.3 Description of operation

The Q output of the F_TRIG element stands at the TRUE value from one execution of
the element to the next, following the TRUE to FALSE transition of the “CLK” input,
and returns to FALSE at the next execution.

39
Generic Base Elements Substation Automation

7.2 Rising edge detector (R_TRIG)

)LJXUH )XQFWLRQEORFNV\PERO

7.2.1 Input description

Name Type Description


CLK BOOL Input

7.2.2 Output description

Name Type Description


Q BOOL Output

7.2.3 Description of operation

The Q output of the R_TRIG element stands at the TRUE value from one execution of
the element to the next, following the FALSE to TRUE transition of the “CLK” input,
and returns to FALSE at the next execution.

40
Substation Automation Generic Base Elements

8. Numeric

8.1 Absolute value (ABS)

)LJXUH )XQFWLRQEORFNV\PERO

8.1.1 Input description

Name Type Description


IN ANY_NUM Input

8.1.2 Output description

Name Type Description


OUT ANY_NUM Output

8.1.3 Description of operation

For example:

ABS(10) = 10
ABS(-10) = 10
ABS(-10.11) =10.11

41
Generic Base Elements Substation Automation

8.2 Principal arc cosine (ACOS)

)LJXUH )XQFWLRQEORFNV\PERO

8.2.1 Input description

Name Type Description


IN ANY_REAL Input

8.2.2 Output description

Name Type Description


OUT ANY_REAL Output

8.2.3 Description of operation

The ACOS function returns the arc cosine of a floating-point argument IN. IN must be
in the range [-1, 1]. The return value is an angle in the range [0, π ] radians.

42
Substation Automation Generic Base Elements

8.3 Principal arc sine (ASIN)

)LJXUH )XQFWLRQEORFNV\PERO

8.3.1 Input description

Name Type Description


IN ANY_REAL Input

8.3.2 Output description

Name Type Description


OUT ANY_REAL Output

8.3.3 Description of operation

The ASIN function returns the arc sine of a floating-point argument IN. IN must be in
the range [-1, 1]. The return value is an angle in the range

π π
[− , ]
2 2 radians.

43
Generic Base Elements Substation Automation

8.4 Principal arc tangent (ATAN)

)LJXUH )XQFWLRQEORFNV\PERO

8.4.1 Input description

Name Type Description


IN ANY_REAL Input

8.4.2 Output description

Name Type Description


OUT ANY_REAL Output

8.4.3 Description of operation

The ATAN function returns the arc tangent of a floating-point argument IN. The
return value is an angle in the range

π π
[− , ]
2 2 radians.

44
Substation Automation Generic Base Elements

8.5 Cosine in radians (COS)

)LJXUH )XQFWLRQEORFNV\PERO

8.5.1 Input description

Name Type Description


IN ANY_REAL Input

8.5.2 Output description

Name Type Description


OUT ANY_REAL Output

8.5.3 Description of operation

The COS function returns the cosine of a floating-point number IN. IN is an angle
expressed in radians. An argument with large magnitude may produce a result with
little or no significance.

45
Generic Base Elements Substation Automation

8.6 Natural exponential (EXP)

)LJXUH )XQFWLRQEORFNV\PERO

8.6.1 Input description

Name Type Description


IN ANY_REAL Input

8.6.2 Output description

Name Type Description


OUT ANY_REAL Output

8.6.3 Description of operation

OUT := eIN

46
Substation Automation Generic Base Elements

8.7 Natural logarithm (LN)

)LJXUH )XQFWLRQEORFNV\PERO

8.7.1 Input description

Name Type Description


IN ANY_REAL Input

8.7.2 Output description

Name Type Description


OUT ANY_REAL Output

8.7.3 Description of operation

OUT := ln IN

47
Generic Base Elements Substation Automation

8.8 Logarithm base 10 (LOG)

)LJXUH )XQFWLRQEORFNV\PERO

8.8.1 Input description

Name Type Description


IN ANY_REAL Input

8.8.2 Output description

Name Type Description


OUT ANY_REAL Output

8.8.3 Description of operation

OUT := log IN

48
Substation Automation Generic Base Elements

8.9 Sine in radians (SIN)

)LJXUH )XQFWLRQEORFNV\PERO

8.9.1 Input description

Name Type Description


IN ANY_REAL Input

8.9.2 Output description

Name Type Description


OUT ANY_REAL Output

8.9.3 Description of operation

The SIN function returns the sine of a floating-point number IN. IN is an angle
expressed in radians. An argument with large magnitude may produce a result with
little or no significance.

49
Generic Base Elements Substation Automation

8.10 Square root (SQRT)

)LJXUH )XQFWLRQEORFNV\PERO

8.10.1 Input description

Name Type Description


IN ANY_REAL Input

8.10.2 Output description

Name Type Description


OUT ANY_REAL Output

8.10.3 Description of operation

287:= ,1
An argument with large magnitude may produce a result with little or no significance.
Negative input values yield to a zero result.

50
Substation Automation Generic Base Elements

8.11 Tangent in radians (TAN)

)LJXUH )XQFWLRQEORFNV\PERO

8.11.1 Input description

Name Type Description


IN ANY_REAL Input

8.11.2 Output description

Name Type Description


OUT ANY_REAL Output

8.11.3 Description of operation

The TAN function returns the tangent of a floating-point number IN. IN is an angle
expressed in radians. An argument with large magnitude may produce a result with
little or no significance.

51
Generic Base Elements Substation Automation

9. Selection

9.1 Limiter (LIMIT)

)LJXUH )XQFWLRQEORFNV\PERO

9.1.1 Input description

Name Type Description


MN ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 1
IN ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 2
MX ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 3

9.1.2 Output description

Name Type Description


OUT ANY Output

9.1.3 Description of operation

OUT := MIN(MAX(IN,MN),MX)

52
Substation Automation Generic Base Elements

9.2 Extensible maximum (MAX)

)LJXUH )XQFWLRQEORFNV\PERO

9.2.1 Input description

Name Type Description


IN1 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 1
IN2 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 2
INn ANY_BIT, ANY_NUM, ANY_DATE, TIME Input n

9.2.2 Output description

Name Type Description


OUT ANY_BIT, ANY_NUM, ANY_DATE, TIME Output

9.2.3 Description of operation

OUT := MAX(IN1, IN2, ..., INn)

53
Generic Base Elements Substation Automation

9.3 Extensible minimum (MIN)

)LJXUH )XQFWLRQEORFNV\PERO

9.3.1 Input description

Name Type Description


IN1 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 1
IN2 ANY_BIT, ANY_NUM, ANY_DATE, TIME Input 2
INn ANY_BIT, ANY_NUM, ANY_DATE, TIME Input n

9.3.2 Output description

Name Type Description


OUT ANY_BIT, ANY_NUM, ANY_DATE, TIME Output

9.3.3 Description of operation

Returns the minimun of input values, OUT := MIN(IN1, IN2, ..., INn)

This POU has extensible inputs.

54
Substation Automation Generic Base Elements

9.4 Multiplexer (MUX)

)LJXUH )XQFWLRQEORFNV\PERO

9.4.1 Input description

Name Type Description


K ANY_INT Multiplexer index
IN0 ANY Input 1
IN1 ANY Input 2
INn ANY Input N-1

9.4.2 Output description

Name Type Description


OUT ANY Output

9.4.3 Description of operation

Select one of the “N” inputs depending on the input K. Note that index zero selects
the first input IN1. If index K is greater than N-1, funtion returns zero.

For example:

MUX(0, IN0, IN1, IN2) = IN0


MUX(3, IN0, IN1, IN2) = 0

55
Generic Base Elements Substation Automation

9.5 Binary selection (SEL)

)LJXUH )XQFWLRQEORFNV\PERO

9.5.1 Input description

Name Type Description


G BOOL Selection input
IN0 ANY Input 1
IN1 ANY Input 2

9.5.2 Output description

Name Type Description


OUT ANY Output

9.5.3 Description of operation

OUT := IN0, if G=FALSE

OUT:= IN1, if G=TRUE

56
Substation Automation Generic Base Elements

10. Timer

10.1 Time delay OFF (TOF)

)LJXUH )XQFWLRQEORFNV\PERO

10.1.1 Input description

Name Type Description


IN BOOL Input
PT TIME Preset time

10.1.2 Output description

Name Type Description


Q BOOL Output
ET TIME Elapsed time

10.1.3 Description of operation

IN
t0 t1 t2 t3 t4 t5

Q
t0 t1+PT t2 t5+PT
(PT)
ET

t1 t3 t5 0

)LJXUH 2IIGHOD\WLPLQJ

57
Generic Base Elements Substation Automation

10.2 Time delay ON (TON)

)LJXUH )XQFWLRQEORFNV\PERO

10.2.1 Input description

Name Type Description


IN BOOL Input
PT TIME Preset time

10.2.2 Output description

Name Type Description


Q BOOL Output
ET TIME Elapsed time

10.2.3 Description of operation

IN
t0 t1 t2 t3 t4 t5

Q
t0+PT t1 t4+PT t5

(PT)
ET

t0 t1 t2 t3 t4 t5
)LJXUH 2QGHOD\WLPLQJ

58
Substation Automation Generic Base Elements

10.3 Pulse (TP)

)LJXUH )XQFWLRQEORFNV\PERO

10.3.1 Input description

Name Type Description


IN BOOL Input
PT TIME Preset time

10.3.2 Output description

Name Type Description


Q BOOL Output
ET TIME Elapsed time

10.3.3 Description of operation

IN
t0 t1 t2 t3 t4 t5 t6 t7

Q
t0 t0+PT t2 t2+PT t6 t6+PT
(PT)
ET

t0 t1 t2 t6 t7 0

)LJXUH 3XOVHWLPLQJ

59
Generic Base Elements Substation Automation

10.4 Pulse width for TOF, TON and TP

The time duration for TOF, TON and TP is configured in the Relay Configuration
Tool. The time duration can be defined in the range 0...49.7 days, in steps of one
millisecond. The desired time duration can be given in milliseconds (ms), seconds (s),
minutes (m) , hours (h) or days (d).

Examples of time duration literals:

These are all equivalent:

"TIME#1000ms"
"time#1s"
"T#1000ms"
"t#1s"

These are all equivalent:

"T#1d 2h 3m 4s 5ms"
"T#1d_2h_3m_4s_5ms"

The most significant unit is allowed to overflow:

"T#25h_15m"

is equivalent to

"T#1d_1h_15m"

For example, the pulse width of 50 ms is configured in the configuration tool as


shown below.

)LJXUH ([DPSOHRISXOVHZLGWKFRQILJXUDWLRQ

60
Substation Automation Generic Base Elements

11. Type Conversion

11.1 BOOL inputs to INT output (BOOL2INT)

11.1.1 Application

BOOL2INT is used to pack boolean information in an integer variable. Typically,


apparatus statuses are packed in the integer variable in order to connect it to LON by
means of the snvt_state.

)LJXUH )XQFWLRQEORFNV\PERO

61
Generic Base Elements Substation Automation

11.1.2 Input description

Name Type Description


B0 BOOL Input bit B0
B1 BOOL Input bit B1
B2 BOOL Input bit B2
B3 BOOL Input bit B3
B4 BOOL Input bit B4
B5 BOOL Input bit B5
B6 BOOL Input bit B6
B7 BOOL Input bit B7
B8 BOOL Input bit B8
B9 BOOL Input bit B9
B10 BOOL Input bit B10
B11 BOOL Input bit B11
B12 BOOL Input bit B12
B13 BOOL Input bit B13
B14 BOOL Input bit B14
B15 BOOL Input bit B15

11.1.3 Output description

Name Type Description


Q UINT Integer value of the boolean inputs

11.1.4 Description of operation

BOOL2INT returns the integer output Q, the value of which is equal to the 16 input
bits.

62
Substation Automation Generic Base Elements

11.2 BOOL to ** (BOOL_TO_**)

11.2.1 Input description

Name Type Description


IN BOOL Input

11.2.2 Output description

Name Type Description


OUT ** Output

11.2.3 Description of operation

(**) Possible output data types:

BYTE
DINT
DWORD
INT
REAL
SINT
UDINT
UINT
USINT
WORD
The BOOL type of data is converted e.g. to the BYTE type.

63
Generic Base Elements Substation Automation

11.3 BYTE to ** (BYTE_TO_**)

11.3.1 Input description

Name Type Description


IN BYTE Input

11.3.2 Output description

Name Type Description


OUT ** Output

11.3.3 Description of operation

(**) Possible output data types:

DWORD
WORD
The BYTE type of data is converted e.g. to the DWORD type.

64
Substation Automation Generic Base Elements

11.4 DATE to UDINT (DATE_TO_UDINT)

11.4.1 Input description

Name Type Description


IN DATE Input

11.4.2 Output description

Name Type Description


OUT UDINT Output

11.4.3 Description of operation

The DATE type of data is converted to the UDINT type.

65
Generic Base Elements Substation Automation

11.5 DINT to ** (DINT_TO_**)

11.5.1 Input description

Name Type Description


IN DINT Input

11.5.2 Output description

Name Type Description


OUT ** Output

11.5.3 Description of operation

(**) Possible output data types:

INT
REAL
SINT
When the DINT type of data is converted e.g. to the INT type:

Data type DINT: -2 147 483 648 ... 2 147 483 647
Data type INT: -32 768 ... 32 767
For example:

DINT_TO_INT(10) = 10
DINT_TO_INT(-10) = -10
DINT_TO_INT(32768) = -32 768
DINT_TO_INT(-32769) = 32 767
When the DINT type of data is converted to the SINT type:

Data type DINT: -2 147 483 648 ... 2 147 483 647
Data type SINT: -128 ... 127
For example:

DINT_TO_SINT(10) = 10
DINT_TO_SINT(-10) = -10
DINT_TO_SINT(128) = -128
DINT_TO_SINT(-129) = 127

66
Substation Automation Generic Base Elements

11.6 DWORD to ** (DWORD_TO_**)

11.6.1 Input description

Name Type Description


IN DWORD Input

11.6.2 Output description

Name Type Description


OUT ** Output

11.6.3 Description of operation

(**) Possible output data types:

BYTE
WORD
The DWORD type of data is converted to the BYTE or WORD type.

For example:

DWORD_TO_BYTE(0xFFFFFFFF) = 0xFF
DWORD_TO_WORD(0xFFFFFFFF) = 0xFFFF

67
Generic Base Elements Substation Automation

11.7 INT input to BOOL outputs (INT2BOOL)

11.7.1 Application

INT2BOOL is used to unpack an integer variable to 16 Boolean signals. Typically,


the apparatus statuses of one relay unit are transferred over the LON network in
snvt_state and unpacked in the receiver unit by the INT2BOOL function to be used
for interlocking, for example.

)LJXUH )XQFWLRQEORFNV\PERO

11.7.2 Input description

Name Type Description


IN UINT Integer input

68
Substation Automation Generic Base Elements

11.7.3 Output description

Name Type Description


B0 BOOL Status of bit 0
B1 BOOL Status of bit 1
B2 BOOL Status of bit 2
B3 BOOL Status of bit 3
B4 BOOL Status of bit 4
B5 BOOL Status of bit 5
B6 BOOL Status of bit 6
B7 BOOL Status of bit 7
B8 BOOL Status of bit 8
B9 BOOL Status of bit 9
B10 BOOL Status of bit 10
B11 BOOL Status of bit 11
B12 BOOL Status of bit 12
B13 BOOL Status of bit 13
B14 BOOL Status of bit 14
B15 BOOL Status of bit 15

11.7.4 Description of operation

The input value IN is separated to a bit format and the status of each of the 16 bits is
returned as an output.

For example: the output B0 is equal to the status of the first bit of input IN.

69
Generic Base Elements Substation Automation

11.8 INT to ** (INT_TO_**)

11.8.1 Input description

Name Type Description


IN INT Input

11.8.2 Output description

Name Type Description


OUT ** Output

11.8.3 Description of operation

(**) Possible output data types:

DINT
REAL
The INT type of data is converted e.g. to the DINT type.

70
Substation Automation Generic Base Elements

11.9 REAL to ** (REAL_TO_**)

11.9.1 Input description

Name Type Description


IN REAL Input

11.9.2 Output description

Name Type Description


OUT ** Output

11.9.3 Description of operation

(**) Possible output data types:

DINT
INT
SINT
UDINT
UINT
USINT
The REAL type of data is converted e.g. to the DINT type.

DINT values are -2147483648 ... 2147483647, for example:

REAL_TO_DINT(2147483647.1) = 2147483647
REAL_TO_DINT(-2147483648.1) = -2147483648
REAL_TO_DINT(10.4) = 10
REAL_TO_DINT(10.5) = 11
REAL_TO_DINT(-10.4) = -10
REAL_TO_DINT(-10.5) = -11

71
Generic Base Elements Substation Automation

INT values are -32768 ... 32767, for example:

REAL_TO_INT(32767.1) = 32767
REAL_TO_INT(-32768.1) = -32768
REAL_TO_INT(10.4) = 10
REAL_TO_INT(10.5) = 11
REAL_TO_INT(-10.4) = -10
REAL_TO_INT(-10.5) = -11
SINT values are -128...127, for example:

REAL_TO_SINT(127.1) = 127
REAL_TO_SINT(-128.1) = -128
REAL_TO_SINT(10.4) = 10
REAL_TO_SINT(10.5) = 11
REAL_TO_SINT(-10.4) = -10
REAL_TO_SINT(-10.5) = -11
UDINT values are 0...4294967295, for example:

REAL_TO_UDINT(4294967295.1) = 4294967295
REAL_TO_UDINT(-0.1) = 0
REAL_TO_UDINT(10.4) = 10
REAL_TO_UDINT(10.5) = 11
REAL_TO_UDINT(-10.4) = 0
REAL_TO_UDINT(-10.5) = 0
UINT values are 0...65535, for example:

REAL_TO_UINT(65535.1) = 65535
REAL_TO_UINT(-0.1) = 0
REAL_TO_UINT(10.4) = 10
REAL_TO_UINT(10.5) = 11
REAL_TO_UINT(-10.4) = 0
REAL_TO_UINT(-10.5) = 0
USINT values are 0 ... 255, for example:

REAL_TO_USINT(255.1) = 255
REAL_TO_USINT(-0.1) = 0
REAL_TO_USINT(10.4) = 10
REAL_TO_USINT(10.5) = 11
REAL_TO_USINT(-10.4) = 0
REAL_TO_USINT(-10.5) = 0

72
Substation Automation Generic Base Elements

11.10 SINT to ** (SINT_TO_**)

11.10.1 Input description

Name Type Description


IN SINT Input

11.10.2 Output description

Name Type Description


OUT ** Output

11.10.3 Description of operation

(**) Possible output data types:

DINT
INT
REAL
The SINT type of data is converted e.g. to the DINT type.

73
Generic Base Elements Substation Automation

11.11 TIME to ** (TIME_TO_**)

11.11.1 Input description

Name Type Description


IN TIME Input

11.11.2 Output description

Name Type Description


OUT ** Output

11.11.3 Description of operation

(**) Possible output data types:

REAL
TOD
UDINT
The TIME type of data is converted e.g. to the REAL type.

74
Substation Automation Generic Base Elements

11.12 TOD to ** (TOD_TO_**)

11.12.1 Input description

Name Type Description


IN TOD Input

11.12.2 Output description

Name Type Description


OUT ** Output

11.12.3 Description of operation

The TOD type of data is converted e.g. to the REAL type.

(**) Possible output data types are:

REAL
TIME
UDINT
The TOD type of data is converted e.g. to the TIME type.

75
Generic Base Elements Substation Automation

11.13 UDINT to ** (UDINT_TO_**)

11.13.1 Input description

Name Type Description


IN UDINT Input

11.13.2 Output description

Name Type Description


OUT ** Output

11.13.3 Description of operation

(**) Possible output data types:

REAL
UINT
USINT
The UDINT type of data is converted e.g. to the REAL type.

76
Substation Automation Generic Base Elements

11.14 UINT to ** (UINT_TO_**)

11.14.1 Input description

Name Type Description


IN UINT Input

11.14.2 Output description

Name Type Description


OUT ** Output

11.14.3 Description of operation

(**) Possible output data types:

BOOL
REAL
UDINT
USINT
The UINT type of data is converted e.g. to the BOOL type.

77
Generic Base Elements Substation Automation

11.15 USINT to ** (USINT_TO_**)

11.15.1 Input description

Name Type Description


IN USINT Input

11.15.2 Output description

Name Type Description


OUT ** Output

11.15.3 Description of operation

(**) Possible output data types:

REAL
UDINT
UINT
The USINT type of data is converted to the REAL type.

78
Substation Automation Generic Base Elements

11.16 WORD to ** (WORD_TO_**)

11.16.1 Input description

Name Type Description


IN WORD Input

11.16.2 Output description

Name Type Description


OUT ** Output

11.16.3 Description of operation

(**) Possible output data types:

BYTE
DWORD
The WORD type of data is converted e.g. to the BYTE type.

For example:

WORD_TO_BYTE(0xFFFF) = 0xFF

79
Generic Base Elements Substation Automation

12. Truncation toward Zero

12.1 TRUNC_REAL_TO_**

12.1.1 Input description

Name Type Description


IN REAL Input

12.1.2 Output description

Name Type Description


OUT ** Output

12.1.3 Description of operation

The input data is truncated.

(**) Possible output data types:

DINT
INT
SINT
UDINT
UINT
USINT
DINT values are in the range -2147483648...2147483647, for example:

TRUNC_REAL_TO_DINT(2147483647.1) = 2147483647
TRUNC_REAL_TO_DINT(-2147483648.1) = -2147483648
TRUNC_REAL_TO_DINT(10.4) = 10
TRUNC_REAL_TO_DINT(10.5) = 10
TRUNC_REAL_TO_DINT(-10.4) = -10

80
Substation Automation Generic Base Elements

INT values are in the range -32768...32767, for example:

TRUNC_REAL_TO_INT(32767.1) = 32767
TRUNC_REAL_TO_INT(-32768.1) = -32768
TRUNC_REAL_TO_INT(10.4) = 10
TRUNC_REAL_TO_INT(10.5) = 10
TRUNC_REAL_TO_INT(-10.4) = -10
TRUNC_REAL_TO_INT(-10.5) = -10
SINT values are in the range -128...127, for example:

TRUNC_REAL_TO_SINT(127.1) = 127
TRUNC_REAL_TO_SINT(-128.1) = -128
TRUNC_REAL_TO_SINT(10.4) = 10
TRUNC_REAL_TO_SINT(10.5) = 10
TRUNC_REAL_TO_SINT(-10.4) = -10
TRUNC_REAL_TO_SINT(-10.5) = -10
UDINT values are in the range 0...4294967295, for example:

TRUNC_REAL_TO_UDINT(4294967295.1) = 4294967295
TRUNC_REAL_TO_UDINT(-0.1) = 0
TRUNC_REAL_TO_UDINT(10.4) = 10
TRUNC_REAL_TO_UDINT(10.5) = 10
TRUNC_REAL_TO_UDINT(-10.4) = 0
TRUNC_REAL_TO_UDINT(-10.5) = 0
UINT values are in the range 0...65535, for example:

TRUNC_REAL_TO_UINT(65535.1) = 65535
TRUNC_REAL_TO_UINT(-0.1) = 0
TRUNC_REAL_TO_UINT(10.4) = 10
TRUNC_REAL_TO_UINT(10.5) = 10
TRUNC_REAL_TO_UINT(-10.4) = 0
TRUNC_REAL_TO_UINT(-10.5) = 0
USINT values are in the range 0...255, for example:

TRUNC_REAL_TO_USINT(255.1) = 255
TRUNC_REAL_TO_USINT(-0.1) = 0
TRUNC_REAL_TO_USINT(10.4) = 10
TRUNC_REAL_TO_USINT(10.5) = 10
TRUNC_REAL_TO_USINT(-10.4) = 0
TRUNC_REAL_TO_USINT(-10.5) = 0

81

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy