© SIEMENS
. Source file for this DB100 is generated in AI_Org.exe and is passed after generation to the user
as text
file projectname.awl and it is copied to the clipboard from which can be pasted to the
Source File Editor of STEP7.
S7 block DB100 is then created in Source File
Editor by selecting Compiling source file.
FC 100 & DB100 - can be freely
renumbered to any allowed number !
DB 100 contains all data (
attributes of AI ) which are used by FC100 for AI treatment. For one AI is used
142 bytes.
This
structure is repeated in DB as many
time as number of consequent AI
specified in FC100.
Structure of DB 100 :
Structure for one AI :
|
|
|
|
||
DB100.DBW 0 |
Value (code) read directly from PIW |
INT |
AI101_IN |
||
DB100.DBD 2 |
current 4 - 20 mA |
REAL |
AI101_mA |
||
DB100.DBD 6 |
value for LL switch point |
REAL |
AI101_LLvs |
||
DB100.DBD 10 |
value for L switch point |
REAL |
AI101_Lvs |
||
DB100.DBD 14 |
value for H switch point |
REAL |
AI101_Hvs |
||
DB100.DBD 18 |
value for HH switch point |
REAL |
AI101_HHvs |
||
DB100.DBD 22 |
value for LL alarm |
REAL |
AI101_LLva |
||
DB100.DBD 26 |
value for L alarm |
REAL |
AI101_Lva |
||
DB100.DBD 30 |
value for H alarm |
REAL |
AI101_Hva |
||
DB100.DBD 34 |
value for HH alarm |
REAL |
AI101_HHva |
||
DB100.DBD 38 |
Hysteresis for switch points |
REAL |
AI101_HYsp |
||
DB100.DBD 42 |
Hysteresis for alarms |
REAL |
AI101_HYa |
||
DB100.DBD 46 |
Filter constant |
REAL |
AI101_FC |
||
DB100.DBD 50 |
Low range in physical units |
REAL |
AI101_LR |
||
DB100.DBD 54 |
High rang in physical units e |
REAL |
AI101_HR |
||
DB100.DBD 58 |
Value in physical units |
REAL |
AI101_V |
||
DB100.DBX 62.0 |
Quit alarm |
BOOL |
AI101_QF |
||
DB100.DBX 62.1 |
Do filtering |
BOOL |
AI101_Fi |
||
DB100.DBX 62.2 |
Cancel all alarms |
BOOL |
AI101_NA |
||
DB100.DBX 62.3 |
mask for LL switch point |
BOOL |
AI101_LLms |
||
DB100.DBX 62.4 |
mask for L switch point |
BOOL |
AI101_Lms |
||
DB100.DBX 62.5 |
mask for H switch point |
BOOL |
AI101_Hms |
||
DB100.DBX 62.6 |
mask for HH switch point |
BOOL |
AI101_HHms |
||
DB100.DBX 62.7 |
mask for LL alarm |
BOOL |
AI101_LLma |
||
DB100.DBX 63.0 |
mask for L alarm |
BOOL |
AI101_Lma |
||
DB100.DBX 63.1 |
mask for H alarm |
BOOL |
AI101_Hma |
||
DB100.DBX 63.2 |
mask for HH alarm |
BOOL |
AI101_HHma |
||
DB100.DBX 63.3 |
AI type “0” = (0)4-20 mA / “1” = PT100 |
BOOL |
AI101_PT |
||
DB100.DBX 63.4 |
reserve |
BOOL |
AI101_c14 |
||
DB100.DBX 63.5 |
reserve |
BOOL |
AI101_c15 |
||
DB100.DBX 63.6 |
reserve |
BOOL |
AI101_c16 |
||
DB100.DBX 63.7 |
reserve |
BOOL |
AI101_c17 |
||
DB100.DBX 64.0 |
Error < 4 mA |
BOOL |
AI101_ErL |
||
DB100.DBX 64.1 |
Error > 20 mA |
BOOL |
AI101_ErH |
||
DB100.DBX 64.2 |
Current loop error - sum |
BOOL |
AI101_Er |
||
DB100.DBX 64.3 |
LL switch point |
BOOL |
AI101_LLsp |
||
DB100.DBX 64.4 |
L switch point |
BOOL |
AI101_Lsp |
||
DB100.DBX 64.5 |
H switch point |
BOOL |
AI101_Hsp |
||
DB100.DBX 64.6 |
HH switch point |
BOOL |
AI101_HHsp |
||
DB100.DBX 64.7 |
LL alarm |
BOOL |
AI101_LLa |
||
DB100.DBX 65.0 |
L alarm |
BOOL |
AI101_La |
||
DB100.DBX 65.1 |
H alarm |
BOOL |
AI101_Ha |
||
DB100.DBX 65.2 |
HH alarm |
BOOL |
AI101_HHa |
||
DB100.DBX 65.3 |
reserve |
BOOL |
AI101_s13 |
||
DB100.DBX 65.4 |
reserve |
BOOL |
AI101_s14 |
||
DB100.DBX 65.5 |
reserve |
BOOL |
AI101_s15 |
||
DB100.DBX 65.6 |
reserve |
BOOL |
AI101_s16 |
||
DB100.DBX
65.7 |
New alarm |
BOOL |
AI101_NL |
||
DB100.DBD 66 |
PID Setpoint |
REAL |
AI101_C_Sp |
||
DB100.DBD 70 |
PID Setpoint Min limit |
REAL |
AI101_C_Si |
||
DB100.DBD 74 |
PID Setpoint Max limit |
REAL |
AI101_C_Sx |
||
DB100.DBD 78 |
PID P - gain |
REAL |
AI101_C_P |
||
DB100.DBD 82 |
PID Integral time |
TIME |
AI101_C_I |
||
DB100.DBD 86 |
PID CONT_C Derivative time |
TIME |
AI101_C_D |
||
DB100.DBD 90 |
PID deadband |
REAL |
AI101_C_DB |
||
DB100.DBD 94 |
PID CONT_C Manual setpoint |
REAL |
AI101_C_Mc |
||
DB100.DBD 98 |
PID Cycle time |
TIME |
AI101_C_C |
||
DB100.DBD 102 |
PID STEP_C minimal pulse |
TIME |
AI101_C_MP |
||
DB100.DBD 106 |
PID STEP_C minimal break |
TIME |
AI101_C_MB |
||
DB100.DBD 110 |
PID STEP_C travel time |
TIME |
AI101_C_TT |
||
DB100.DBD 114 |
PID CONT_C Max limit |
REAL |
AI101_C_Mx |
||
DB100.DBD 118 |
PID CONT_C Min limit |
REAL |
AI101_C_Mi |
||
DB100.DBD 122 |
PID Disturbance value |
REAL |
AI101_C_DV |
||
DB100.DBD 126 |
PID Calculated setpoint |
REAL |
AI101_C_Cs |
||
DB100.DBD 130 |
PID CONT_C Controller output 0 – 100 % |
REAL |
AI101_C_O |
||
DB100.DBD 134 |
PID Error value SP - PV |
REAL |
AI101_C_Er |
||
DB100.DBW 138 |
PID CONT_C Controller output PQW |
WORD |
AI101_C_Ow |
||
DB100.DBX 140.0 |
PID CONT_C High limit reached |
BOOL |
AI101_C_Hr |
||
DB100.DBX 140.1 |
PID CONT_C Low limit reached |
BOOL |
AI101_C_Lr |
||
DB100.DBX 140.2 |
PID Manual mode |
BOOL |
AI101_C_MM |
||
DB100.DBX 140.3 |
Calculated SP is used |
BOOL |
AI101_C_Cu |
||
DB100.DBX 140.4 |
PID P is selected |
BOOL |
AI101_C_Ps |
||
DB100.DBX 140.5 |
PID I is selected |
BOOL |
AI101_C_Is |
||
DB100.DBX 140.6 |
PID CONT_C D is selected |
BOOL |
AI101_C_Ds |
||
DB100.DBX 140.7 |
PID I hold |
BOOL |
AI101_C_Ih |
||
DB100.DBX 141.0 |
PID I initialization |
BOOL |
AI101_C_It |
||
DB100.DBX 141.1 |
PID use calculated SP order |
BOOL |
AI101_C_IC |
||
DB100.DBX 141.2 |
PID use own SP order |
BOOL |
AI101_C_IO |
||
DB100.DBX 141.3 |
PID Manu mode selection |
BOOL |
AI101_C_IM |
||
DB100.DBX 141.4 |
PID AUTO mode selection |
BOOL |
AI101_C_IA |
||
DB100.DBX 141.5 |
reserve |
BOOL |
AI101_C_p15 |
||
DB100.DBX 141.6 |
reserve |
BOOL |
AI 1 |
||
DB100.DBX 141.7 |
reserve |
BOOL |
AI101_C_p17 |
||
DB100.DBW
142 |
Value (code) read directly from PIW |
INT |
AI 2 |
||
DB100.DBD 144 |
current 4 - 20 mA |
REAL |
AI102_mA |
||
DB100.DBD 148 |
value for LL switch point |
REAL |
AI102_LLvs |
||
|
|
|
|
Data from DBB 66 to DBB141 are
not used in FC100 but can be used in apropos PID relative to this AI.
Data
structure of the "green" area matches to the data structure of
standard FB41 CONT_C,FB42 STEP_C from STEP 7 library.
Explanation of particular attributes of AI.
_V is main product of FC100 - it is value represented AI in
physical units recalculated from _HR and _LR.
in case of type of PT100
(platinum thermocouple ) the value is calculated PIW x 10 because
PIW in case of PT100 gives
"linear" number of tenth of °C
Example : PIW = 534
… => 53.4 °C
_LR is low range of sensor when
sensor sends 4 mA, not used when PT100 is connected
_HR is high range of sensor when
sensor sends 20 mA, not used when PT100 is connected
_LLvs limit value; when _V is lower or equal this value _LLsp
( low low switch point ) is reported
_Lvs, _Hvs, _HHvs.
_LLva limit value; when _V is lower or equal this value _LLa
( low low alarm ) is reported
_Lva, _Hva, _Hhva.
_LLsp, _Lsp, _Hsp, _HHsp switch
point bits for using in PLC algorithm
_LLa, _La, _Ha, _HHa alarm
bits for using in alarm system ( Alarm
window …)
_LLms, _Lms, _Hms, _HHms mask
for switch points; if _LLms bit is "1" then _LLsp switch point
can be generated according to _LLvs
and _V value
_LLma, _Lma, _Hma, _HHma mask
for alarms; if _LLma bit is "1" then _LLa alarm
can be generated according to _LLva
and _V value
_NA all alarms ( NOT switch points!
) are disabled even already existing - global mask for alarms
_ErL .. bit is set when current is less than 3,5 mA - broken wire - only for
4 -20 mA
_ErH .. bit is set when current is higher than 21 mA - overcurrent - only
for 4 -20 mA
_Er logical OR of _ErL and _ErH
_PT –
according the type the addressing of PIW is calculateed. Current AI takes 2
bytes, PT100 takes 4 bytes
( one PIW (
two bytes ) is reserved for cicuit which supplyes resistor of PT100 )