Example of detecting the fill level of a storage area - STEP 7

Creating FBD programs

ft:publication_title
Creating FBD programs
Product
STEP 7
Version
V20
Publication date
11/2024
Language
en-US
Example of detecting the fill level of a storage area

Detecting the fill level of a storage area

The following figure shows a system with two conveyor belts and a temporary storage area between them. Conveyor belt 1 delivers packages to the storage area. A photoelectric barrier at the end of conveyor belt 1 near the storage area detects how many packages are delivered to the storage area. Conveyor belt 2 transports packages from the temporary storage area to a loading dock where they are loaded onto trucks. A photoelectric barrier at the storage area exit detects how many packages leave the storage area to be transported to the loading dock. Five display lamps indicate the capacity of the temporary storage area.

Implementation

The following table shows the definition of the tags used:

Name

Declaration

Data type

Description

PEB1

Input

BOOL

Photoelectric barrier 1

PEB2

Input

BOOL

Photoelectric barrier 2

RESET

Input

BOOL

Reset counter

LOAD

Input

BOOL

Adjust the current counter value to the value of the PV parameter​.

MAX STORAGE AREA FILL AMOUNT

Input

INT

Maximum possible number of packages in the storage area

PACKAGECOUNT

Output

INT

Number of packages in the storage area (current count value)

STOCK_PACKAGES

Output

BOOL

Is set when the current count value is greater than or equal to the value of the "MAX STORAGE AREA FILL AMOUNT" tag.

STOR_EMPTY

Output

BOOL

Display lamp: Storage area empty

STOR_NOT_EMPTY

Output

BOOL

Display lamp: Storage area not empty

STOR_50%_FULL

Output

BOOL

Display lamp: Storage area 50 % full

STOR_90%_FULL

Output

BOOL

Display lamp: Storage area 90 % full

STOR_FULL

Output

BOOL

Display lamp: Storage area full

VOLUME_50

Input

INT

Comparison value: 50 packages

VOLUME_90

Input

INT

Comparison value: 90 packages

VOLUME_100

Input

INT

Comparison value: 100 packages

The following networks show the FBD programming for activating the lamps:

Network 1:

When a package is delivered to the storage area, the signal state at "PEB1" switches from "0" to "1" (positive signal edge). On a positive signal edge at "PEB1", the "Up" counter is enabled, and the current count value of "PACKAGECOUNT" is increased by one.

When a package is delivered from the storage area to the loading dock, the signal state at "PEB2" switches from "0" to "1" (positive signal edge). On a positive signal edge at "PEB2", the "Down" counter is enabled, and the current count value of "PACKAGECOUNT" is decreased by one.

If there are no packages in the storage area ("PACKAGECOUNT" = "0"), the "STOR_EMPTY" tag is set to signal state "1", and the "Storage area empty" lamp is switched on.

The current count value can be reset to "0" if the "RESET" tag is set to signal state "1".

If the "LOAD" tag is set to signal state "1", the current count value is set to the value of the "MAX STORAGE AREA FILL AMOUNT" tag. As long as the current count value is greater than or equal to the value of the "MAX STORAGE AREA FILL AMOUNT" tag, the "STOCK_PACKAGES" tag supplies the signal state "1".

Network 2:

As long as there are packages in the storage area, the "STOR_NOT_EMPTY" tag is set to signal state "1", and the "Storage area not empty" lamp is switched on.

Network 3:

If the number of packages in the storage area is greater than or equal to 50, the "Storage area 50 % full" lamp switches on.

Network 4:

If the number of packages in the storage area is greater than or equal to 90, the "Storage area 90% full" lamp switches on.

Network 5:

If the number of packages in the storage area reaches 100, the lamp for the "Storage area full" message switches on.