A NALOG I NPUT C OMPARISON AND D ATA L INEARIZATION
A NALOG I NPUT C OMPARISON AND D ATA L INEARIZATION
In this example, we will compare the input signal from a temperature transducer (0 ° C to 1000 °
C) with two alarm set points (a low alarm and a high alarm). The PLC receives set point data via two sets of 4-digit switches (BCD). The valid range of this set point data is 100 to 850 °
C. The analog input module receives a signal, which is proportional to the temperature, that ranges between –10 and +10 VDC. When the signal is over or under either of the two set points, an indicator light is illuminated. Figure 11-48 illustrates a simple
High Alarm
Low Alarm
Set Point
Set Point
ON ON TWS data read
PL1
PL2
Low Temperature
OK Range
High Temperature
Alarm
Alarm
0 ° C 1000 ° C 4 Low Set Point 4 High Set Point
1 2 Figure 11-48. Elements in an analog input comparison system.
Set
Industrial Text & Video Company 1-800-752-8398
www.industrialtext.com
S ECTION PLC System Programming C HAPTER 3 Programming
and Implementation 11
diagram of the elements used in this system. The thumbwheel switches (TWS) are connected to a register input module with multiplexing (MUX) capability. The TWS inputs are read only once when the spring-loaded, key- operated switch is turned ON. Figure 11-49 shows the analog input relation- ship between counts and degrees Celsuis. Figure 11-50 illustrates a flowchart of the required steps for this example, while Figure 11-51 shows a flowchart of the subroutines used in the program.
° C Y = mX + b
X counts + 500
= 4 ( 1221 10 − ° C )( ) X counts + 500
Figure 11-49. Relationship between counts and degrees Celsuis.
START Read TWS and
convert to decimal (binary)
GO SUB to check for correct range
NO
TWS correct range?
YES Read analog
input GO SUB to
linearize to ˚C
Is
YES
Energize low
temp < low
alarm PL
Is
YES
Energize high
temp > high
alarm PL
? NO END
Figure 11-50. Flowchart of process steps.
Industrial Text & Video Company 1-800-752-8398
www.industrialtext.com
S ECTION PLC System Programming C HAPTER 3 Programming
and Implementation 11
START
Compare TWS
START
low and TWS high settings with range
100 ° C ≤ TWS ≤ 850 ° C MULT 0.1221 times the input
(result in ° C)
Is TWS high
Yes
Set high OK
high OK, then range OK; else range not OK
Figure 11-51. Subroutine flowcharts: (a) check for correct range and (b) linearize to ° C.
Tables 11-22 and 11-23 present the register and internal output address assignment tables, respectively. Table 11-24 lists the I/O address assignment, while Figure 11-52 illustrates the final PLC circuit implementation. Moreover, Figures 11-53 and 11-54 show the subroutine circuit programs.
A block transfer input instruction, used to read the TWS, selects slot location
1 and reads 8 bits (2 digits). It then automatically goes to the next slot (slot
2) to get the other 8 bits.
Table 11-23. Register assignment.
Industrial Text & Video Company 1-800-752-8398
www.industrialtext.com
S ECTION PLC System Programming C HAPTER 3 Programming
and Implementation 11
1 1 0 0 S u b r o u t i n e t o c h e c k f o r v a il d r a n g e s ( C M P f o r L o w )
1 2 0 0 G o t o s u b r o u t i n e t o il n e a r i z e i n p u t c o u n t s t o ° C
1 2 0 1 A d d i t i o n o f 5 0 0 e n a b l e d — r e g 4 1 0 2 h a s t e m p v a l u e Table 11-23. Internal output assignment.
Table 11-24. I/O address assignment.
Industrial Text & Video Company 1-800-752-8398
www.industrialtext.com
S ECTION PLC System Programming C HAPTER 3 Programming
and Implementation 11
Start
XFER IN
TWS Read
Slot 1 Rack 0 Length 2 Reg 4000
TWS Read
BCD-BIN
BIN Done
Reg 4000 Reg 4010 Length 2
Check TWS Ranges
BIN Done
Range OK
XFER IN
Temp Read
Slot 7 Rack 0 Length 1 Reg 4100
Linearize Temp
Temp Read
Range OK
Temp < Low
Reg 4010
Temp < Low
Low Temp Alarm
Range OK
CMP High
Temp > High
Reg 4010
Temp > High
High Temp Alarm
Figure 11-52. PLC implementation of the analog input comparison system.
Industrial Text & Video Company 1-800-752-8398
www.industrialtext.com
S ECTION PLC System Programming C HAPTER 3 Programming
and Implementation 11
CMP
CMP Low TWS Temp 10
Reg 4010
Low TWS ≥ 100 ° C
Reg K100
CMP High TWS Temp
High TWS ≤ 850 ° C
Reg K850
Range OK Low TWS ≥ 100 ° C High TWS ≤ 850 ° C 100 ° C ≤ TWS ≤ 850 ° C
Low TWS ≥ 100 ° C Range not OK
1104 U
High TWS ≤ 850 ° C 1103
RET
Figure 11-53. Subroutine 1100—check for valid TWS range and convert to decimal.
Temp Read
MULT Done
Reg 4100 x Reg K 1221 = Reg 4101 Scale –4
MULT Done
ADD
ADD Done 1201
Reg 4101 + Reg K 500 = Reg 4102
RET
Figure 11-54. Subroutine 1200—convert analog counts to degrees.
Industrial Text & Video Company 1-800-752-8398
www.industrialtext.com
S ECTION PLC System Programming C HAPTER 3 Programming
and Implementation 11
The check range subroutine compares the values entered for the low and high temperature alarms with the constants 100 and 850. If the values are within that range, the program latches internal 1104, indicating that the range is OK. If the values are not within the acceptable range, internal 1104 remains OFF (0). The latch is required because the subroutine is not executed during every scan, yet the main program uses the OK or not OK signal during its regular program execution. The check range subroutine is only executed when the key switch is turned ON.
Parts
» An Industrial Text Company Publication Atlanta • Georgia • USA
» C HAPTER T HREE L OGI C C ON CEPT S
» 3 -3 P RINCIPLES OF B OOLEAN A LGEBRA AND L OGIC
» 3 -4 PLC C I RCU I T S AN D L OGI C C ON TACT S Y M BOLOGY
» C ONTACT S YMBOLS U SED IN PLC S
» L OADING C O N S I D E R AT I O N S
» M E M O RY C A PA C I T Y AND U T I L I Z AT I O N
» A P P L I C AT I O N M E M O RY
» D AT A T ABLE O R G A N I Z AT I O N
» 6 -2 I /O R ACK E NCLOSURES AND T ABLE M APPING
» I /O R ACK AND T ABLE M APPING E XAMPLE
» 6 -4 P L C I NSTRUCTIONS FOR D ISCRETE I NPUTS
» 6 -6 P L C I NSTRUCTIONS F OR D ISCRETE O UTPUTS
» 7 -3 A NALOG I NPUT D ATA R E P R E S E N TAT I O N
» 7 -4 A NALOG I NPUT D ATA H ANDLING
» 7 -6 O V E RV I E W OF A NALOG O UTPUT S IGNALS
» 7 -8 A NALOG O UTPUT D ATA R E P R E S E N TAT I O N
» 7 -9 A NALOG O UTPUT D ATA H ANDLING
» C HAPTER E IGHT S PECI AL F U N CT I ON I /O AN D S ERI AL C OM M U N I CAT I ON I N T ERFACI N G
» T HERMOCOUPLE I NPUT M ODULES
» E NCODER /C OUNTER I N T E R FA C E S
» S TEPPER M OTOR I N T E R FA C E S
» S ERVO M OTOR I N T E R FA C E S
» N ETWORK I N T E R FA C E M ODULES
» S ERIAL C O M M U N I C AT I O N
» I N T E R FA C E U SES AND A P P L I C AT I O N S
» 9 -3 L ADDER D IAGRAM F O R M AT
» 9 -5 L ADDER R E L AY P ROGRAMMING L ADDER S CAN E V A L U AT I O N
» P ROGRAMMING N O R M A L LY C LOSED I NPUTS
» 9 -1 0 A RITHMETIC I NSTRUCTIONS
» 9 -1 4 N ETWORK C O M M U N I C AT I O N I NSTRUCTIONS
» L ANGUAGES AND I NSTRUCTIONS
» F UNCTION B LOCK D IAGRAM (FBD)
» S EQUENTIAL F UNCTION C H A RT S (SFC)
» P ROGRAMMING L ANGUAGE N O TAT I O N
» P ROGRAMMING N O R M A L LY C LOSED T RANSITIONS
» D IVERGENCES AND C ONVERGENCES
» -1 C ONTROL T ASK D EFINITION
» C REAT I N G F LOWCH ART S AN D O U T PU T S EQU EN CES
» C ONFIGURING THE PLC S YSTEM
» S PECIAL I NPUT D EVICE P ROGRAMMING
» S IMPLE S TA R T /S TOP M OTOR C IRCUIT
» F O RWA R D /R EVERSE M OTOR I NTERLOCKING
» AC M OTOR D RIVE I N T E R FA C E
» L ARGE R E L AY S YSTEM M O D E R N I Z AT I O N
» A NALOG I NPUT C OMPARISON AND D ATA L INEARIZATION
» A NALOG P OSITION R EADING F ROM AN LV D T
» L INEAR I N T E R P O L AT I O N OF N ONLINEAR I NPUTS
» L ARGE B AT C H I N G C ONTROL A P P L I C AT I O N
» -7 S H O RT P ROGRAMMING E XAMPLES
» -1 B ASIC M EASUREMENT C ONCEPTS D ATA I N T E R P R E TAT I O N
» I NTERPRETING C OMBINED E RRORS
» B RIDGE C IRCUIT T ECHNIQUES
» R ESISTANCE T E M P E R AT U R E D ETECTORS ( RT D S )
» -1 P ROCESS C ONTROL B ASICS
» I N T E R P R E TAT I O N OF E RROR
» T RAN SFER F U N CT I ON S AN D T RAN SI EN T R ESPON SES
» D E R I V AT I V E L APLACE T RANSFORMS
» Out () s = ( )( ) In () s Hp () s
» S ECOND -O RDER L AG R ESPONSES
» D IRECT -A CTING C ONTROLLERS
» T WO -P OSITION D ISCRETE C ONTROLLERS
» T HREE -P OSITION D ISCRETE C ONTROLLERS
» -5 P R O P O RT I O N A L C ONTROLLERS (P M ODE )
» PV () s ( 1 + Hc Hp () s () s ) = SP Hc Hp () s () s () s
» CV () t = K I ∫ 0 Edt + CV ( t = 0 )
» CV ( t = 2 ) = K I 0 Edt + ∫ CV ( t = 1 )
» -7 P R O P O RT I O N A L -I NTEGRAL C ONTROLLERS (PI M ODE )
» -8 D E R I VAT I V E C ONTROLLERS (D M ODE ) S TANDARD D E R I V AT I V E C ONTROLLERS
» -9 P R O P O RT I O N A L -D E R I VAT I V E C ONTROLLERS (PD M ODE )
» -1 2 C ONTROLLER L OOP T UNING
» Z IEGLER –N ICHOLS O PEN -L OOP T UNING M ETHOD
» I TA E O PEN -L OOP T UNING M ETHOD
» S O F T WA R E T UNING M ETHODS
» R ULE -B ASED K NOWLEDGE R E P R E S E N T AT I O N
» S T AT I S T I C A L AND P ROBABILITY A N A LY S I S
» -1 I NTRODUCTION TO F UZZY L OGIC
» -2 H I S T O RY OF F UZZY L OGIC
» -3 F UZZY L OGIC O P E R AT I O N
» F U Z Z I F I C AT I O N C OMPONENTS
» F UZZY P ROCESSING C OMPONENTS
» D E F U Z Z I F I C AT I O N C OMPONENTS
» S YSTEM D ESCRIPTION AND O P E R AT I O N
» M EMBERSHIP F UNCTIONS AND R ULE C R E AT I O N
» IF A = PS AND B = NS THEN C = ZR IF A = PS AND B = NS THEN D = NS
» C HAPTER N INETEEN I /O B US N ET WORK S
» -4 D EVICE B US N ETWORKS B YTE -W IDE D EVICE B US N ETWORKS
» B IT -W IDE D EVICE B US N ETWORKS
» F IELDBUS P ROCESS B US N ETWORK
» P ROFIBUS P ROCESS B US N ETWORK
» I /O B US N ETWORK A DDRESSING
» P ANEL E NCLOSURES AND S YSTEM C OMPONENTS
» -3 N OISE , H E AT , AND V O LTA G E R EQUIREMENTS
» T ROUBLESHOOTING PLC I NPUTS
» -2 P L C S IZES AND S COPES OF A P P L I C AT I O N S
» I NPUT /O UTPUT C O N S I D E R AT I O N S
» C ONTROL S YSTEM O R G A N I Z AT I O N
» E Q U I VA L E N T L ADDER /L OGIC D IAGRAMS
Show more