Home
PLC programming WEEK 1
Contents
1. Programmable Logic Controller PLC Alireza Mousavi Morad Danishvar and Alexandre Spieser 1 Introduction PLC is adigital computer used for automation of electromechanical processes in plants The PLC is designed for multiple inputs and outputs arrangements so we can get the data from the sensors work with it and command the actuators The first Programmable Logic Controller PLC was developed by a group of engineers at General Motors in 1968 when the company were looking for an alternative to replace complex relay control systems The new control system had to meet the following requirements e Simple programming e Program changes without system intervention no internal rewiring e Smaller cheaper and more reliable than corresponding relay control systems e Simple low cost maintenance 2 PLC Components Fig 1 illustrates the system components of a PLC Input module Central control unit o gt Output module Sensors Actuators Figure 1 PLC components The function of an input module is to convert incoming signals into signals that can be processed by the PLC and to pass those signals to the central control unit The reverse task is performed by an output module This converts the PLC signal into signals suitable to operate and invoke the plant actuators The actual processing of the signals is undertaken in the central control unit and with respect to the program st
2. Booki W File Edit View Insert Format Tool Data Window Help D S S cw 2 js 2 ules CommandBut W fe EMBED Forms CommandButton 1 Ww kic GEER 2 2 2 AS AD 42 First create a function that will open the DDE topic to Excel Private Function OpenBRS3SLinxi On Error Resume Next Open the connection to EsLinx UpenRSLinx DDEInitiatei RSLINZ EZCEL TEST Check if the connection was made If Err Number lt gt O Then MsgBox Error Connecting to topic whExclamation Error OpenBRSLinx O Return false if there was an error End If End Function Now if I call this function from the CommandButtonl Click event it will open the link to RSLinx Private Sub CommandButtonl Click bslinx OpenRSLinxi End Sub 43 References http literature rockwellautomation com idc groups literature documents um 1769 um0l1_ en p pdf http literature rockwellautomation com idc groups literature documents qs 1756 qsOO1_ en p pdf http literature rockwellautomation com idc groups literature documents pm 1756 pm001_ en e pdf http literature rockwellautomation com idc groups literature documents rm 1756 rm003_ en p pdf http literature rockwellautomation com idc groups literature documents rm 1756 rm094 en p pdf 44
3. Internal bit OTE Output Energize Symbol B3 0 i L 2 Definition Turns a bit on or off Use OTE instruction in your ladder logic to turn on a bit when rung condition is evaluated as true Devices Light Motor run signal Internal bits OTL Output Latch Usually we latch a signal with a condition and then unlatch it when a different condition becomes true Most of time the Latch Unlatch go together Symbol B3 Ly T Definition e Turns a bit on when the rung is executed and this bit retains its state when the rung is not executed or a power cycle power occurs e OTL is a retentive output instruction OTL can only turn on a bit This instruction is usually used with OTU with both OTL and OTU addressing the same bit e Ladder logic can examine a bit controlled by OTL as often as necessary e When you assign an address to the OTL instruction that corresponds to the address of a physical output the output device wired to the screw terminal 1s energized when the bit is set When rung conditions become false the bit remains set and the corresponding output device remains energized e Actuating the latch input turns the function on or causes it to change state The function then stays on even if the latch input is turned off To turn the function off another input must unlatch which turns the function off OTU Output Unlatch Symbol B3 0 lt A 4 Definition e Turns a bit off when the rung is executed and thi
4. Create Module Choose the Emulator RSLogix Emulate 5000 Controller Chose slot 2 for the controller A oie x Click OK to add it to the chassis monitor Select Module E i x Module Type 1784 PCIC Control et PCI Messaging 1784 FLIL5 Control et PL Scanner 1754 PLID5 DeviceNet PCI Scanner Lemos 1784 PETES Control et Scanner 1784 PMU ZAE 2 Asis Analog Encoder Servo 1784 PMTBSE 16 Asis SERCOS 189 51M 32 Pant Input Output Simulator Emulator ASLogis E mulate 5000 Controller di 5 Atthis point you may be accosted with a message about previous configurations Just select Reset the Configuration to Default Values and click NEXT 2 6 The next two dialog screens are for setting up the controller details Click NEXT and FINISH accepting all the defaults General Type A5Logix Emulate 5000 Emulogehebs Controller Vendor Allen Bradley Version fi 5 Memory Size KB 3072 Periodic Save Interval I un Range 0 5 to 30 min 1 0 Iw Enable Periodic Save Controller Mame Last Loaded lt Back Lancel Help MT System X Type RSLogis Emulate 5000 EmuLogi 5 amp 8 Controller Vendor Allen Bradley Continuous T ask Dwell Time ms m CPU Affinity Iam Channel O Serial Port None hd lt Back Lancel Help Next we ll add some input output simulation Click Slot Create Module 2 Choose the 1789 SIM 32 Point Input output Simulator 3 Chose slot
5. SaltLoge Bie Add Mew AS 232 DF devices Ethemet devices O Ethemet IP Drner 1784 ET KTX DPPET D HPCHME far DH4 DH 485 devices 1784 E 106 for Conta et devices DF1 Folling Master Drreer 1784 PEC for CantrolMet devices 1784 PCIC S fee ContralHet devices 1747 PIL AIC Drner DF Slave Drrer 5 5 505002 for DH devices ilar ES E ol LiL ts eoe DeviceNe Divers 1784 PCD PCIDS 1770 KFD 5DNPT divers PLC 5 DH Emulator driver Running Configure SUC 500 DH 485 Emulator diver SoltLoged dives Remote Devices via Linx Gateway Using RSLogix Emulator in a Project To use the emulator in a project you must setup the hardware correctly 1 Start the RSLogix 5000 software and create a new project 2 Under the New Controller window type select an Emulator RSLogix Emulator 5000 Controller Give it a name and assign it to the same slot as the one you put in the Chassis Monitor which in our example is slot 2 Click OK New Controller X Vendor Allen Bradley Hevisian i5 Lancel I Redundancy Enabled Heln M arme Emulator Example Descriptions Chassis Type 1756 47 Slot Controllogis Chassis v Slot 4 Safety Partner Slot Create In CARSLogis 5000 Projecta Browse U ei 3 In RSLogix 5000 s Controller Organizer right click on the I O Configuration folder and then click New Module The software displays the Select Module window 4 Open the Other folder Sel
6. 07 16 17 18 19 20 21 22 25 Lancel Apply Help NI For Ladder Logic programming with RSLogix 5000 and RSEmulator 5000 First Step with RSLinx RSLinx is the software RSLogix will use to communicate with your PLC or in our case to the emulator Let s start by running the RSLinx software under the START gt All Programs gt Rockwell Software gt RSLinx gt RSLinx Classic A Follow these steps to set 1t up 1 Under the Communications menu select Configure Drivers 2 Under the Available Drivers Types select the PLC Emulator driver and click the Add button You can give the driver a name but I just leave it at the default 4 Leave the configuration options as Station Number 00 and click OK Your driver should now be running and look likes the picture below Configure Drivers Available Driver Types SLC 500 DH 485 Emulator driver Configured Drivers Mame and Description S Latus EMLISDD 1 SLE 500 DH485 Emulator Sta 00 Hunning Second step running RSLogix 5000 START All Programs Rockwell Software RSLogix 5000 36 G E m x Es F RSLogix 5000 HURON GINNING EAST in HURON GINNING EAST 150CTOS ACD 1756 55 MalnProgram MainRoutine WM ree Ede Vew Search loge Communicators Tools Window ve au ae X sieje oust AND MAN PB EDD ft ym aa y H est ie t o o 2 Ottane WWF RUN m Path AB ETH YL30 130 130 ABackplane O MWavomes WA Tete
7. 8 128 to 127 Integer INT 16 32 768 to 32 767 Double Integer DINT 32 2 147 483 648 to 2 147 483 647 Real Number REAL 92 3 402823E38 to 1 1754944E 38 Logix5000 controllers are true 32 bit controllers meaning the memory words are 32 bits wide No matter what a tag always reserves 32 bits of memory even if it is a Boolean or integer data type For this reason it is best to use a DINT when dealing with integers Furthermore a Logix5000 controller typically compares or manipulates values as 32 bit values DINTs or REALs A Logix5000 controller lets you divide your application into multiple programs each with its own data The Scope of the tag defines if a tag is global controller tags and therefore available to all programs or local program tags to a select program group Pay careful 22 attention to this field as creating it 1n the wrong area may lead to some confusion later on as to 1ts location as Controller Empty Demo V16 C Controller Fault Handler 9 Power Up Handler Sj Tasks ta MainTask 3 MainProgram i MainRoutine 8 RobotControl a MainRoutine 21 Unscheduled Programs Controller Tags are available to all programs You cannot go wrong using controller scoped tags unless you easily want to copy and paste programs A tag must be controller scoped when used in a Message MSG instruction to produce or consume data and to communicate with a Panel View terminal Pro
8. numeric characters 0 9 and underscores _ e must start with an alphabetic character or an underscore e no more than 40 characters e no consecutive or trailing underscore characters _ e not case sensitive The tag Type defines how the tag operates in the project Base A tag that actually defines the memory where the data is stored Alias A tag that represents another tag Produced Send data to another controller Consumed Receive data from another controller Alias tags mirror the base tag to which they refer When the base tag value changes so does the alias tag Use aliases in the following situations 21 e program logic in advance of wiring diagrams e assign a descriptive name to an I O device e provide a more simple name for a complex tag e usea descriptive name for an element of an array Produced and consumed tags make it possible to share tags between controllers in the same rack or over a network This article does not cover this aspect Select a Data Type for the tag by typing it in or by clicking on the ellipsis button and selecting it from the list A data type is a definition of the size and layout of memory allocated for the created tag Data types define how many bits bytes or words of data a tag will use The term Atomic Data Type refers to the most basic data types They form the building blocks for all other data types Data Type Abbreviation Memory bits Range Boolean BOOL 1 0 1 Short Integer SINT
9. or false the processor verifies if a continuous left to right path of true input instructions exists between the line L and neutral N power rails c Basics of PLC Programming When a continuous path of true input instructions exists the rung 1s evaluated as true and the output instruction on this rung is true When there is no continuous path of true input instructions on the rung the rung is evaluated as false and the output instruction on this rung 1s false The status of a rung instruction true or false depends on the logic state of the data file bit this instruction is shown in Figure 6 for example indicates the status of the instructions Examine If Closed XIC and Examine If Open XIO according to the logic state of the corresponding data file bit From this figure we can see that e The Examine If Closed XIC instruction is true when its associated bit is at logic state 1 Conversely the Examine If Open XIO instruction is true when its associated bit 1s at logic state O THE STATUS OF THE INSTRUCTION IS IF THE CORRESPONDING XIC DATA FILE EXAMINE IF CLOSED EXAMINE IF OPEN BIT IS LOGIC 0 FALSE TRUE LOGIC 1 TRUE FALSE Fig 6 Truth table for the XIC and XIO input instructions d Series AND and Parallel OR Logics The ladder rung in Figure 2 is an example of series AND logic Series logic means that all the instructions in the rung XIC I 0 O AND XIO I 0 1 must be true in order for out
10. 3 for the simulator and click OK 28 Module Type 1 784 PCIC ControlMet PCI Messaging 1784 PLIC S Cantral et PCI Scanner 1784 PCIOS DeviceNet PCI Scanner eme 1784 PETES Control et Scanner 1784 PM 2AE 2 Axis Analog Encoder Servo 1784 PMTBSE 15 Asis S5SERCOS 1783 5IM 32 Font Input Output Simulator Emulator ASLogis E mulate S000 Controller 4 Accept the defaults for the setup by clicking NEXT and FINISH Select Device l x Type 17 83 5IM 32 Paint Input Output Simulator Vendor Allen Bradley Lancel Help Type 17 83 5IM 32 Point Input Output Simulator Vendor Allen Bradley Serial Number E Label for 1789 51 Simulation T Module Marquee imulation T est lt Back Lancel Help 29 The chassis monitor will now have two emulation modules in it ready to go ti RSLogin Emulate 5000 Chassis Monitor Slot wiew Options Help Computer STUDENT ll 1 RSLinz RS Lins For Help press F1 Creating a connection in RSLinx 1 Start RSLinx under Start gt Programs gt Rockwell Software gt RSLinx gt RSLinx Classic 2 Click Communications gt Configure Drivers 3 Select the Virtual Backplane SoftLogix 58xx driver from the Available Driver Types list 4 Click Add New The Add New RSLinx Driver dialog box appears Click OK The new driver appears in the Configured Drivers list Click Close 30 Configure Drivers Available Dinver Types Virtual Backplane
11. All instructions of the same type that have a common address will automatically have the same instruction description The instruction description 1s displayed over each instruction in the ladder view window The address description used to identify the type of input or output device associated with an address All instructions having the same address will automatically have the same address description Note that address descriptions associated with instructions that are provided with an instruction description are not displayed in the ladder view However all address descriptions can be observed by opening the Cross Reference data file f Some definitions The following is a list of the basic instructions in RSLogix series e XIC Examine if Closed e XIO Examine if Open e OTE Output Energize e OTL Output Latch e OTU Output Unlatch e OSR One Shot Rising XIC Examine 1f Closed Symbol Definition e Examines a bit for an On condition e Use the XIC instruction in your ladder logic to determine if a bit is ON e 0 False e True Devices e Start Stop push buttons e Selectors e limit switch e Proximity switch e Light e Internal bit XIO Examine if Open Symbol B3 0 Definition Examines a bit for an off condition Use an XIO instruction in your ladder logic to determine if a bit 1f off 1 True O False Devices Start Stop push buttons Selectors Limit switch Proximity switch Light
12. ControlWNet Module Fault Statue Offline Cancel Ready Set Go You are now ready to use the emulator just like you would any other PLC Open Who Active and set the path to the RSLogix 5000 Emulator 33 4 Who Active alaista Ed Workstation STUDENTI 1 ge Linx Gateways Ethernet Hee AB DF1 1 DH 485 Et AB VEP 1 1789 A17 4 Virtual Chassis Ml 00 Workstation RSLinx Server A B o1 RSLinx Enterprise Desktop RSLinx Enterprise Desktop RSLogix 5000 Emulator Emulator R15 39 03 1789 SIM 32 Point Input Output Simulator 1789 SIM v1 00 Hea oec Ea The inputs can be simulated in the emulator s Chassis Monitor by right clicking on the module and selecting Properties Under the I O Data tab is the ability to toggle each of the inputs on or off 34 Controller Tags Emulator Example controller Scope P Emulator Examp Shaw All Mame le Faroe Mask e Sue O floc e e METE A 6e EMes3lDaa e eedDemd HHeoca3bDaa Decimal oo EHeaAbDad4l SA Deeimal o Hioba Decimal o tocaba Deeimal o o o o poca Data2 Peeimal o bessiDae l 3 Decimal o peeAbDas 4 0 1 Decimal o e EE Module Properties Slot 3 A Sc General 140 Data Module Into Module Status Inputs Click to toggle an nff o Oo 04 OF US 0494 05 06 OF dE 17 18 18 EN EU es ES Outputs nn O1 02 03 094 05 06
13. PROA OK Dew No Forces pb For Y NoE dts r UD Enables the DNET Scanner o Local O Commarcregaler Run THE FOLLOWING TEN OR SO RUNOS ARE FOR APRON 1 DANE CONTROL WA DNET Copes the fve 32 bt DAET Scanner DNTS from he Drive lo den 16 bt words The fest two 16 bt words are the drives status and speed feedback The reat of the t bl words are Data Out A1 through Osca Out DD from the Gwe LOGE STATUS WORD OF i Cecy Fa Source Dealt Dest APRON DRIVE NUT MAGIS Leagt 10 L When the drive amp running 21 1756 H8T JA ETHERNET ACTIVE X 1794 78 APRON Det NPUT MAGEO 1 amp PRON 1 DRIVE RUN TATUS JE lt 1sFORWARD ACTUAL OR OeREVERSE APRON t CRIVE_NPUT_MAGENS 3 APRON t DRIVE FORWARD REVERSE STATUS AT APRON DRIVE INPUT IMAGEJO 7 APRON 1 DRIVE FAULT STATUS 4 nn T _ le Mdainfousee 1 Let s make a simple rung to test Make sure the cursor is on the rung with the END on it and then click the New Rung icon in the instruction toolbar New Rung loon H TT JE JE t gt 4 Nr AEL ABS F Alk User Abit TimeriCounter 4 InputiQutput Compare Now click on the Examine if Closede 7E instruction to add it to the rung A Double click on the question mark above it and enter 1 0 0 as its input address Just leave the description pop up box
14. The following is a list of counter instructions e CTU Count Up e CTD Count Down e RES Reset CTU Count UP Symbol Definition Increments the accumulated value at each false to true transition and retains the accumulated value when the instruction goes false or when power cycle occurs The CTU is an instruction that counts false to true transition When this transition happens the accumulated value is incremented by one count A CTU accumulation 1s reset by the RES instruction If the accumulation value is over the maximum range then the overflow OV bit will be true Each counter address 1s made of a 3 word element Word 1 is the control word Bit 0 7 Internal Use Bit 10 UA Update accumulation value Bit 11 UN Underflow bit Bit 12 OV Overflow bit Bit 13 DN Done Bit 14 CD Count down is enabled Bit 15 CU Count up is enabled Word 2 stores the preset value PRE Specifies the value which the counter must reach before the controller sets the done bit When the accumulator value becomes equal to or greater than the preset value the done status bit 1s set You can use this bit to control an output device Preset value 1s from 32 768 to 32 767 If a timer preset value is negative an error will occur Word 3 stores the accumulated value ACC This 1s the number of times of false to true transitions that have occurred since the counter was last rest CTD Count Down Definition Decr
15. The table below shows the association between the current data types and the older systems with data files Type RSLogix 5000 Output Input and output modules when configured Input automatically create their own tags like Local 0 I Data O Status Use the GSV and SSV instructions to get status information such as the CPU time module states and scan times Bit Assign the Boolean BOOL data type to the tag Timer Assign the TIMER data type to the tag Counter Assign the COUNTER data type to the tag Control Assign the CONTROL data type to the tag Integer Assign the double integer DINT data type to the tag Floating Point Assign the REAL data type to the tag Creating a Tag One way to create a new tag is right click on the Controller Tags in the Controller Organizer and select New Tag Even faster is the Ctrl W hot key 20 3 6 Controller Class I Aiii New Tag Ckri W Controller Fau AN 2 US 2 Power Up Han Monitor Tags 3 Tasks MainTask Edit Tags 3 MainProgr verify Unscheduled F Motion Groups Ungrouped Ax Print gt Add On Instructiol Pans Export Tags The following dialog box pops up New Tag Name line Stat Description Start button on Line Cancel Help Type Bass y Alias For Data Type BOOL e Scope i Style Decim vel r The Name given to the tag has the following rules e only alphabetic characters A Z or a z
16. e of setting up a simulation This involves three major steps 1 Setting up the chassis monitor 2 Creating a connection in RSLinx 3 Creating a project with associated emulation hardware Setting up the Chassis Monitor To start the Chassis Monitor click Start gt Programs gt Rockwell Software gt RSLogixEmulate 5000 gt RSLogix Emulate 5000 Chassis Monitor f RSLogix 5 English f utilities f BOOTP DHCP Server I FactoryTalk Tools R SLimx f RSLogix 500 English 3 RSLagix 5000 Enterprise Series RSLogix 5000 Tools R 5Linx Tools Fs RSLogix Emulate 5000 fe RSMetWarx f RsTestStand Lite A RSview Enterprise f RSView32 f Rsview32 Tools E FactoryTalk Administration Console Tr F F0 wo TF gt Y F Y 4 RSLogix Emulate 5000 Chassis Monitor AsLogix Emulate 5000 ReadMe Test Time Utility T F SS F 26 When the emulator opens up you re confronted with what looks like an empty chassis In slot 0 1s an RSLinx module which has to be there for the emulator communications to work Your slot 1 might have another irremovable RSLinx module depending if you are running RSLogix Enterprise ti RSLogin Emulate 5000 Chassis Monitor Slot wiew Options Help Computer STUDENT 0 For Help press F1 From here we set up our hardware configuration for simulation Our first step will be to add the CPU In this case it is a special one called an Emulation Controller Click Slot gt
17. ect the 1756 MODULE from the modules list and then click OK Select Module Communications Controllers Digital Drives Motion Specialty E Find By Category Favorites cancel 5 The software displays the New Module window a Add a Name for the card b In the Slot field put the number that corresponds with the Chassis Monitor c For the Connection Parameters put in the following and click OK Assembly Size Instance me I 2 Output 2 1 Configuration 16 0 32 Neu Module Type 1756 MODULE Genetic 1756 Module Parent Local Connection Parameters Assembly l Instance 5i Ze Name Simulator Cad Input po 1 A2 Baw Description Output 2 fi zi 32 bit Configuration fig fo ew Comm Eomat Data DINT FL ar pO p Slot h ET Status Wutput v Open Module Properties Carcel Help 6 On the next Module Properties screen make sure to change the Requested Packet Interval to 50 0 ms im Module Properties Local 4 1756 MODULE 1 1 General Connection Module Infa Backplane Requested Packet Interval API 500 ms 0 2 750 0 ms Inhibit Module Major Fault On Controller If Connection Fails While in Run Made Use Scheduled Connection over
18. ements the accumulate value at each false to true transition and retains the accumulated value when the instruction goes false or when power cycle occurs The CTD is an instruction that counts false to true transition When this transition happens the accumulated value is decrements by one count A CTD accumulation 1s reset by the RES instruction If the accumulation value 1s below the minimum range then the underflow UN bit will be true Each counter address is made of a 3 word element Word 1 is the control word Bit 0 7 Internal Use Bit 10 UA Update accumulation value Bit 11 UN Underflow bit Bit 12 OV Overflow bit Bit 13 DN Done Bit 14 CD Count down is enabled Bit 15 CU Count up is enabled Word 2 stores the preset value PRE Specifies the value which the counter must reach before the controller sets the done bit When the accumulator value becomes equal to or greater than the preset value the done status bit is set You can use this bit to control an output device Preset value 1s from 32 768 to 32 767 If a timer preset value is negative an error will occur Word 3 stores the accumulated value ACC RES Reset Symbol CRES gt Definition e Resets the accumulated value and status bit of a timer or counter e Use a RES instruction to reset timers or counters When the RES instruction is enabled it resets the Timer On Delay Retentive Timer and Counter Up Counter Down instruction ha
19. empty by clicking OK Next click on the Output Energize instruction to add it to the right side of the rung Double click on the question mark above it and enter O 0 0 as its output address Just leave the description pop up box empty by clicking OK You should now have something like below 3 5 LAD 2 MAIN_PROG AAi e 1 0 on E i 0000 a a L Ft ES EMD 0001 wri pg aT Jo yn ap a A A Y The next very important step 1s to verify the project with the Edit gt Verify Project menu item This will compile the project and get it ready for the emulator HE RSLogix Micro Starter Lite TES File Edit view Search Comms Toole 1 Undo Chrl z2 3 Cut Cri x No Copy Ch HA Delete Del Sl Insert Ins Append Verify File Verify Project MP HA MD Y Save the project as something like Test RSEmulator 5000 The emulator allows us test our work by running a virtual PLC and help us to download our program to it and run it in a very similar fashion to a real PLC Start the emulator with the START gt All Programs gt Rockwell Software gt RSLogix Emulate 500 gt RSLogix Emulate 5000 Set the Emulator up as 1t has been explain above in Emulator part 38 Connecting Excel to ControlL ogix By John Schop at http www pledev com comnecting_controllogix_excel Have you ever lost data in a CLX processor because you downloaded new code Unfortunately when
20. fy the serial port settings o From the Com Port pull down menu choose the serial port on the workstation to that the cable 1s connected to e g Port 1 Port 2 o From the Device pull down menu choose Logix 5550 Serial Port o Click Auto Configure Verify that the Auto Configuration was successful If it doesn t work check if you have selected the correct port 3 2 Configure the I O modules In the next steps we intend to configure the physical modules in the project In order to establish a communication between the controller and an I O module in the system add the module to the I O Configuration folder of the controller When you add a module you also define a specific configuration for the module Ue D E cred ns No Forces b F OK No Edits ch FU 1 4 Favorites Add On Controller Organizer X 6 8 MainTask Cg MainProgram 7 Unscheduled Programs Phases 5 3 Motion Groups LE Ungrouped Axes 1769 IFI6C 16 Channel Current Analog Input Allen Bradle il Add On Instructions 1769 IFL6V 16 Channel Voltage Analog Input Allen Bradle 9 3 Data Types i gt 1769 IF4 4 Channel Current Voltage Analog Input Allen Bradle i P Cg User Defined i 1769 IF4FXOF2F 4 Channel Input 2 Channel Output Fast Analog Allen Bradle m Cyh Strings i 1769 IFAI 4 Channel Isolated Analog Current Voltage Input Allen Bradle A Cg Add On Defined 1769 IF4XOF2 4 Channel Input 2 Channel Output Low Resolut
21. gram Tags are isolated from other programs Routines cannot access data that is at the program scope of another program Having program tags make it easy to copy paste programs and not have to worry about conflicting tag names Make sure though that no controller tags are named the same as program tags Style is the form in which to display the tag by default The following table provides you with information on the base and notation used for each style Style Base Notation Binary 2 2 Decimal 10 Hexadecimal 16 16 Octal 8 SH Exponential 0 0000000e 000 Float 0 0 23 Edit and Monitor Tags To edit existing tags select the Logic gt Edit Tags menu item A spread sheet like view lets you create and edit tags Right click on squares for tag options Show Show All Alas For Base Tag Data Type Style Description Start BOOL Decimal Start button For motor Stop BOOL Decimal Stop button for motor Jog BOOL Decimal Jog button for motor Right click the header for options Speed REAL Float Speed setpoint used for Alarm_Code DINT Decimal Alarm code returned fror H Motor Delay TIMER Delay before starting mc Edit Tags 4 F Tabs to switch between monitoring and editing Clicking the sign next to a tag reveals its structure For a DINT tag this is the 32 individual bits that make up the tag which will not be of interest 1f you are using the tag as a number rather t
22. han individual bits If you do wish to use the individual bits then you can address them in this way with the tag name followed by a period and then the bit position e g MyTag 5 Shown below is the expanded structure for a TIMER Notice it is made of two DINTs and three BOOLs In this case the Booleans are packed into one DINT and therefore a timer uses three DINTs of memory Conclusion These are the basics of tags The advantages are 1 Tags if done right create a level of documentation that is stored in the PLC 2 The software does an automatic housekeeping of memory locations There is no more worrying about physical addressing and memory conflicts 3 Structures can be more easily put together based on function rather than data type 24 Advance subjects include arrays user defined data types UDT and Add On Instructions Hopefully you will continue to learn more about the power of tags There 1s no doubt that 1f you grasp the principles presented here you will be well on your way to using and troubleshooting any Logix5000 controller 25 A Quick Tutorial on RSLogix Emulator 5000 RSLogix Emulator 5000 1s a software simulator for the Allen Bradley line of Logix 5000 controllers ControlLogix amp CompactLogix FlexLogix SoftLogix5800 and DriveLogix The goal is to mimic the function of a PLC without the actual hardware and thus do advanced debugging As a quick introduction we ll go through a simple exampl
23. ime elapsed since the timer was last reset When enabled the timer updates this continually e Time Base is the timing update interval this can vary from O 1 second 5 An Introduction to RSLogix5000 Tags Tags are the method for assigning and referencing memory locations in Allen Bradley Logix5000 controllers No longer are there any physical addresses such as N7 0 or F8 7 which use symbols to describe them These have been replaced with tags that have a pure text based addressing scheme This is a departure from the more conventional ways of programming PLCs which includes Allen Bradley earlier line of PLCS and SLC 500 controllers One of the hardest transitions from the older systems is realizing how the tag database works The person with experience in Allen Bradley systems will recognize many of the instructions and be at home with the editor in RSLogix 5000 Understanding the tag database is the first major hurdle in becoming comfortable with the ControlLogix and CompactLogix systems 19 Earlier Allen Bradley PLCs programmed with RSLogix 5 and RSLogix 500 software had data files to store I O and other internal values These different data files could only hold one data type A data type defines the format and the size of the stored value The Logix5000 controllers have done away with data files and in its place 1s the tag database The tag database organizes memory locations in one place Each tag 1s assigned its own data type
24. ion Allen Bradle Exp Predefined 1769 IF8 8 Channel Current Voltage Analog Input Allen Bradle z CR Mii Deed gt 1769 IR6 6 Channel RTD Direct Resistance Analog Input Allen Bradle i l Trends f 1769 IT6 6 Channel Thermocouple mV Analog Input Allen Bradle amp VO Configuration 1769 OF2 2 Channel Current Voltage Analog Output Allen Bradle _ 78 Backplane CompactLogix System 1720 A AS AS A AS AS ae ee Atl Moo E ff 1769 L32E test with manual 1769 L32E Ethernet Port LocalE ae Ethernet CompactBus Local m 59 OWSL B output m fJ 3 1769 1A16 A input mod n By Category By Vendor Favorites 1 Figure 4 Configuring and adding modules to the project 3 3 Creating a program a Ladder Logic programming In this section we will cover some of the basic and most used instructions in PLC programming Following the explanations on how to program the controller we will then have a look at how we can implement and use those instructions in real life applications Figure 5 shows a PLC ladder program A PLC ladder program is a planned set of instructions resembling a hardwired ladder diagram It consists of a line L power rail and a neutral N power rail between which one or more rungs are inserted Each individual rung contains one or more input instructions on its left hand L power rail side and a single output instruction or several output instructions placed in paralle
25. is 1s the time elapsed since the timer was last reset When enabled the timer updates this continually Time Base is the timing update interval this can vary from O 1 second RTO Retentive Timer Definition Counts time base intervals when the instruction 1s true and retains the accumulated value when the instruction goes false or when power cycle occurs The Retentive Timer instruction 1s a retentive instruction that begins to count time base intervals when rung conditions become true The Retentive Timer instruction retains its accumulated value when any of the following occurs Rung conditions become false e Changing Processor mode from REM run Test program mode e The processor loses power while battery backup is still maintained and a fault occurs Note To reset the accumulated value in RTO you must use a reset instruction RES with the same address Each Retentive Timer is made of a 3 word element Word is the control word e Bit 0 12 Internal Use e Bit 13 DN Done e Bit 14 TT Timer Timing e Bit 15 EN Timer is enabled Word 2 stores the preset value PRE e Specifies the value which the timer must reach before the controller sets the done bit When the accumulated value becomes equal to or greater than the preset value the done bit is se e Preset value is from O 32 767 e If a timer preset value is negative an error will occur Word 3 stores the accumulated value ACC e This is the t
26. l on its right hand N power rail side In Figure 5 for example the instructions Examine If Closed XIC and Examine If Open XIO are input instructions analogous to relay contacts On the other hand the instruction Output Energize OTE 1s an output instruction analogous to a relay coil The PLC ladder program is the main component of the project you download to a PLC The PLC uses this program to interpret the signals present at its inputs and operate its outputs accordingly INPUT OUPUT INSTRUCTIONS INSTRUCTIONS EXAMINE L IF CLOSED OUTPUT ENERGIZE RUNG 0 RUNG 1 RUNG 2 EXAMINE IF OPEN RUNG 3 Fig 5 PLC ladder program b Logical Continuity During PLC operations and in order to determine whether these PLC inputs are activated or deactivated the processor reads scans the status of the signals applied to the PLC inputs through the PLC internal input interface The processor then updates the input data file data file I1 bits accordingly The processor then evaluates each rung of the ladder program 7 individually updates the timer binary status counter and control data and then modifies the output data file data file OO bits accordingly The output data file bits are used to energize or de energize relays in the PLC internal output interface causing these relays to apply or remove power to from the devices connected to the PLC output interface terminals To evaluate a rung that 1s to determine if the rung is true
27. loat REAL A REAL Array 1 2 0 Float REAL f REAL A rray 2 3 0 Float REAL 1 REAL A rray 3 4 0 Float REAL REAL Arap 4 5 0 Float REAL E sd REAL Aray 5 6 0 Float REAL i HEAL A rray E 7 0 Float REAL f REAL Arravy 8 0 Float REAL REAL A rray g 9 0 Float REAL 3 REAL Arawv 3 10 0 Float REAL a Monitor Tags Edit Tags 4 3 JM xn h a a e T T air gd gdr E I m not going to do anything with the PLC program I just need some data in a number of tags Next we re going to set up a DDE OPC Topic in RSLinx Depending on the version of RSLinx you use it might look slightly different but you should be able to follow this with the screenshots Assuming that you know how to setup RSLinx initially to get online with your controller I ve skipped some steps The setup I use looks like this in RSLinx 40 Workstation LIM ri Linx Gateways Ethernet l AB_ETH 1 Ethernet 134 200 211 16 1756 ENBT A 1756 ENBT A Backplane 1756 A10 A H A oo 1756 61 LOGIX5561 MN Ro 1755 ENBT A Hl 02 17564 1 4 LOGIX5550 Excel Test apes o MP i ntn uem anm sm 0i 02 00 1756 ENBT A Excel Test MHI HydO f A by orc ad As you can see I have a 10 slot CLX rack with a 1756 ENBT card in slot 1 address 134 200 211 16 and two processors one in slot 0 and one in slot 2 The one in slot 2 is the processor we are going to use for this exercise Now open up the DDE OPC topic c
28. one bit When the accumulated value becomes equal to or greater than the preset value the done bit is set Usually preset value is from O 32 767 e l fatimer preset value is negative an error will occur Word 3 stores the accumulated value ACC e This is the time elapsed since the timer was last reset When enabled the timer updates this continually e Time Base is the timing update interval this can vary from O 1 second TOF Timer Off Delay Definition e Counts time base intervals when the instruction 1s false e The Timer Off Delay instruction begins to count time base intervals when the rung makes a true to false transition As long as rung conditions remain false the timer increments its accumulated value ACC each scans until it reaches the preset value PRE The accumulated value 1s reset when rung conditions go true regardless of whether the timer has timed out Each timer address 1s made of a 3 word element Word 1 is the control word Bit 0 12 Internal Use Bit 13 DN Done Bit 14 TT Timer Timing Bit 15 EN Timer is enabled Word 2 stores the preset value PRE Specifies the value which the timer must reach before the controller sets the done bit When the accumulated value becomes equal to or greater than the preset value the done bit is se Preset value is from O 32 767 If a timer preset value is negative an error will occur Word 3 stores the accumulated value ACC Th
29. onfiguration by clicking DDE OPC and then Topic Configuration in the top menu of RSLinx Dot joc Topic confuraton jx Project Defauk Data Source Data Collection Advanced Communication Workstation USCLEJSCHOP E Linx Gateways Ethernet 45 AB ETH 1 Ethemet Ef 134 200 211 16 1756 ENBT A 1756 ENBT A ci 9 Backplane 1756 A10 A amp fJ 00 1756 4161 LOGIX556 1 MHI_HydOEMBase 01 1756 ENBT A a 02 17564 1 A LOGIX5550 Excel Test I m going to create a new DDE OPC topic called EXCEL TEST and use the Logix5550 processor in slot 2 as the data source In order to do this you have to click the New button 4 give the topic the desired name and make sure the processor in slot 2 is selected as the source before you click Done RSLinx Classic Gateway File Edit View Communications Station DDE OPC Security Window Help a E S E12 Li 3 To test if your setup is working at this point you can use the OPC test client provided with RSLinx l m not going into detail about that but I did make sure this worked before continuing with the next step creating the Excel sheet Let s start up good old Excel and create a new workbook On this workbook place a new command button You can find the Command Button control in the Control Toolbox toolbar in Excel When you have the button right click on it and choose View Code This will take you to the Visual Basic Editor Fd Microsoft Excel
30. ored in the memory The programs and operational routines in a PLC can be created in various ways The Ladder diagram strongly resembles a schematic diagram of relay logic The other features are function block diagram FBD and statement list STL Fig 2 shows an example presented in different ways using controlLogix development tool Depending on how the central control unit 1s connected to the input and output modules various versions of the PLC can be put together For example compact PLCs input module central control unit and output module in one housing or modular PLCs Ladder Logic LAD suitable for users from the electrical engineering industry for example Green Lig hey 10 Key 4 IF ht FF n mM Statement List STL Suitable for users from the world of computer technology for example A Ee y 1 rr Key 4 Green Light Function Block Diagram FBD Suitable for users from the world of circuit engineering for example Green Lig ht Fig 2 Different PLC programming structures 3 Basic Procedure for PLC programming Figure 3 describes the basic procedure for programming PLC Fig 3 Basic procedure for PLC programming ALLEN BRADLEY PLC CompactLogix L32E Allen Bradley is the brand name of a line of Factory Automation Equipment manufactured by Rockwell Automation The connection between the controller and the computer is either serial cable or Ethernet cable We will explain the steps to set
31. put instruction OTE O 0 1 to be true The ladder rung in Figure 7 is an example of parallel OR logic Parallel logic means that one or another path of true instructions must exist on the rung in order for the output instruction to be true In Figure 7 at least one of the input instructions XIC I 0 1 OR XIC I 0 2 must be true in order for instruction OTE O 0 1 to be true Parallel logic is programmed by branching instructions in a ladder rung BRANCH Fig 7 Series and parallel logics e Documenting a Ladder Program You can document a ladder program by inserting rung comments instruction descriptions and address descriptions This allows you to keep notes on How your ladder program works The purpose of an instruction or a rung The type of input or output device pilot lamp pushbutton limit switch etc associated with each address The conditions required for a rung to be true You can insert your comments and descriptions while you enter a ladder program or after you have entered it The three types of comments and descriptions which can be inserted are described below The rung comment normally used to determine what the rung is meant to do It is displayed just over the rung in the ladder view window The instruction description used to determine what the instruction is meant to do or the conditions required for the instruction to be true This description specifies the type and address of the instruction
32. s bit retains its state when the rung 1s not executed or when power cycle occurs e OTU is a retentive output instruction OTU can only turn off a bit This instruction is usually used with OTL with both OTL and OTU addressing the same bit e Ladder logic can examine a bit controlled by OTU as often as necessary e When you assign an address to the OTU instruction that corresponds to the address of a physical output the output device wired to the screw terminal 1s de energized when the bit 1s cleared e The unlatch instruction tells the controller to turn off the addressed bit Thereafter the bit remains off regardless of the rung condition until it is turned on OSR One Shot Rising Symbol B3 0 OSR 5 Definition e Triggers a one time event e The OSR instruction is a retentive input instruction that triggers an event to occur only one time Use the OSR instruction when an event must start based on change of state of the rung from false to true e When the input instruction goes from false to true the OSR instruction conditions the rung so that the output goes true for one scan The output goes false and remains false for successive scans until the input makes another false to true transition 3 Introduction to Counters In this section we will cover the count up count down and reset instruction Counters are very essential in ladder logic programming Counters are used to index increment or decrement values
33. ting up a project on PLC Allen Bradley using RS logix5000 software 3 1 Configuring the hardware Connect the Controller via the Serial Port and Configure the Serial Driver Begin with connecting the serial cable to the PC on one side and the controller on the other side Next configure a connection To configure a connection we use the RSLinx Classic Lite software For the serial communication we need to configure the RS 232 DF1 Device driver 1 Choose configure driver 2 From the Available Driver Types pull down menu choose the RS 232 DFI Device driver 3 Click Add New to add the driver 4 The Add New RSLinx Driver dialog box appears Specify the driver name and click OK The configure dialog box appears y RSLinx Classic Gateway RSWho 1 Tola Il as File Edit View C cations Station w 2 8 liz x DDE OPC Security Window f M Autobro Configure Drivers 3 Available Driver Types Close Configure RS 232 DF1 Devices Hel p Co Device Name AB_DF1 1 Configure Comm Port COM4 v Device Logix 5550 CompactLogis v Startup Baud Rate 119200 Y Station Number m Start Decimal Stop Parity None Error Checking BCC v _ Se _ Delete Stop Bits 1 v Protocol Full Duplex Auto Configure For Help press Fl Use Modem Dialer _Confioure Dister JM 07 04 12 04 07 PM Delete Help Figure 2 3 Configuring Communication Speci
34. ving the same address as the RES instruction 4 Introduction to Timers In this section we will cover timers used in ladder logic programming Timers are very important in ladder logic programming Timers give the precision in time Timer on delay starts timing when instruction 1s true Timers are used to track time when instruction is on or off They could also keep track on a retentive base Definition The following is a list of timer instructions e TON Timer On Delay e TOF Timer Off Delay e RIO Retentive Timer TON Timer On Delay Definition e Count time base intervals when the instruction 1s true e The Timer on Delay instruction begins to count time base intervals when rung conditions become true As long as rung conditions remain true the timer adjust its accumulated value ACC each evaluation until it reaches the preset value PRE The accumulated value is reset when rung conditions go false regardless of whether the timer has timed out Each Timer on Delay is made of a 3 word element Word 1 1s the control word e Bit 0 12 Internal Use e Bit 13 Done DN this bit is on when the Accumulation value gt Preset Value e Bit 14 Timer Timing TT this bit is on when the timer is timing e Bit 15 Enabled EN this bit is on when the timer is energized Word 2 stores the preset value PRE e The programmer specifies this value When the accumulated time reaches the preset value the controller sets the d
35. you download a program to a ControlLogix processor you also download the values of the tags variables A solution to this problem that could be useful is an Excel sheet that reads and writes values to the ControlLogix processor using the DDE OPC capabilities of RSLinx In this article I will show you how to create one of these sheets for your projects Here s what you ll need e Microsoft Excel with some basic knowledge about programming macro s in Visual Basic e RSLinx not the Lite version because that does not have DDE OPC capabilities e A ControlLogix processor of course Let s fire up RSLogix first and create a bunch of tags with values In this example I created 2 arrays Of the types DINT and REAL each with a length of 10 tags These arrays I filled with some values 39 Scope AO EXCEL_TEST Show DINT REAL Po Mame iva ejf Orce Mask Style Data Type Des DINT Array I E BH Ml m B BH B B B B M B m B I B E B BH HE us LX Oo a obe 1 3 Decimal DINT TU P T DINT_Array 0 1 Decimal DINT DINT_Array 1 2 Decimal DINT 4 DBIMT Amrrav 2 3 Decimal DINT f DINT_Array 3 5 Decimal DINT d DIMT Arrav 4 5 Decimal DINHT DINT_Array 5 6 Decimal DINT T DINT_Array 6 7 Decimal DINT f T DINT_Array 5 Decimal DINT j DINT_Array 8 a Decimal DINT gt DINT_Arrav 3 10 Decimal DINT 3 n Los Float REAL 10 F REAL Arav U 1 0 F
Download Pdf Manuals
Related Search
Related Contents
User`s Manual Configurations User Manual Zic Boom n°32 Octobre / Novembre 2005 Samsung MAX-WB650 Manual de Usuario Hitachi Koki USA H 65SD2 User's Manual Anthro ShopAbout Mini TT23/GP White KEMPARC™ Copyright © All rights reserved.
Failed to retrieve file