Professional Documents
Culture Documents
DFB
October 2008
Overview
DFB is a user logic encapsulated in a
reusable block
To structure the application, simplify the
program creation, improve readability, make
debugging easier and protect your know-how
Schneider Electric
DFB Structure
DFB type
Inputs
Outputs
Inputs/outputs
Public / private variables
Code sections
Schneider Electric
Outputs : 32 max
In write only by the DFB
To transfer values from DFB to application
Section of Program
DFB structured in program sections
IEC compliant : only one section
Not IEC compliant : several sections
Section
Symbolic name
Written in LD, IL, ST, FBD
Validation condition
Protection (no, write, read / write)
Comment : 256 characters max
Schneider Electric
DFB Properties
General attributes
Name
Comment : 1024 characters max
Protection : None, read only, no read & write
(independent of application protection)
Diag : to define a user diagnostic DFB
Descriptive form
To edit descriptive file
Schneider Electric
Schneider Electric
Diagnostic DFB
A DFB can be used for application diagnostics at source (directly at the PLC
level)
Defaults are registered in the Diag buffer with a datation made by the PLC
The clients (viewers) can display and acknowledge these defaults
Detecting
Diag DFB
Memorizing
Diag BUFFER
Viewing VIEWER
PLC
Message
Application
Diag
Buffer
Viewer 1
Acknowledge
Registration
Acknowledge
Viewer 2
Message
Date
Schneider Electric
Principle
Detecting
Diag DFB
Memorizing
Diag BUFFER
Viewing VIEWER
PLC
Message
Application
Diag
Buffer
Viewer 1
Acknowledge
Registration
Acknowledge
Viewer 2
Message
Date
Schneider Electric
10
Registration / Deregistration
REGDFB function is used to write a time stamped record inside the Diag
buffer when an error occurs (up to 4 registrations inside a same DFB)
DEREG function updates inside the Diag buffer the date and time of the error
disappearance. The message is delete inside the buffer only when ALL clients
have acknowledged the default (for errors that require acknowledgement)
REGDFB and DEREG functions are only available inside a diagnostic DFB
Syntaxes are as follows
REGDFB(AREA, 16#0062, SLEN, CTRL, PIN, VALPIN, ESTS, ERID, STAT)
OUT := DEREG(ERID)
Schneider Electric
11
12