SEG: Create bit pattern for seven-segment display (S7-1500) - STEP 7

FBD (S7-1200, S7-1500)

ft:publication_title
FBD (S7-1200, S7-1500)
Product
STEP 7
Version
V20
Publication date
11/2024
Language
en-US
SEG: Create bit pattern for seven-segment display

Description

The instruction "Create bit pattern for seven-segment display" is used to convert each of the four hexadecimal digits of the specified source word (IN) into an equivalent bit pattern for a seven-segment display. The result of the instruction is output in the double word on the OUT parameter.

The following relation exists between the hexadecimal digits and the assignment of the 7 segments (a, b, c, d, e, f, g):

Input digit

(Binary)

Assignment of the segments

‑ g f e d c b a

Display

(Hexadecimal)

Seven-segment display

0000

00111111

0

0001

00000110

1

0010

01011011

2

0011

01001111

3

0100

01100110

4

0101

01101101

5

0110

01111101

6

0111

00000111

7

1000

01111111

8

1001

01100111

9

1010

01110111

A

1011

01111100

B

1100

00111001

C

1101

01011110

D

1110

01111001

E

1111

01110001

F

Parameters

The following table shows the parameters of the "Create bit pattern for seven-segment display" instruction:

Parameter

Declaration

Data type

Memory area

Description

EN

Input

BOOL

I, Q, M, D, L, T, C or constant

Enable input

ENO

Output

BOOL

I, Q, M, D, L

Enable output

IN

Input

WORD

I, Q, M, D, L, P or constant

Source word with four hexadecimal digits

OUT

Output

DWORD

I, Q, M, D, L, P

Bit pattern for the seven-segment display

Example

The following example shows how the instruction works:

The following table shows how the instruction functions using specific values:

Parameters

Operand

Value

Hexadecimal

Binary

IN

Tag_Input

W#16#1234

0001 0010 0011 0100

OUT

Tag_Output

DW#16065B4F66

00000110 01011011 01001111 01100110

Display: 1234