Home
Chapter 4 - AutomationDirect
Contents
1. LDA 040600 RX VC100 Beginning address in the in master PLC expressed as an octal number SUOIJEOIUNWIWOD JO SUOHONAISU XM XY Beginning address in the slave PLC Rung 4 All DirectLOGIC PLCs use an END statement to identify the final rung of the main body of the program CEND Program for the This two rung program resides in the slave X0 C100 Slave PLC PLC s CPU Its function is simply to use OUT the XO contact to turn on the internal control relay C100 END DLO5 06 Data Communications Module 2nd Edition 09 07 4 10 Using RX and WX Instructions Example Program with One WX Instruction The Ladder View screen below is the program development screen in DirectSOFT Programming Software This four rung program is explained in detail on page 4 11 This is a complete program although its function is very limited There is also a two rung program that runs in the responding PLC It is also explained on page 4 11 This example assumes the DCM is in slot 2 of a DLO6 PLC Program for the CETTE Ch hl Master PLC LD K2 LDA 040600 vc100 Program for the Slave PLC c100 YO A Ue l OUT When the input X0 to the master PLC is turned on transitions from 0 to 1 the C100 bit in the slave PLC also transitions from 0 to 1 The program in the slave PLC causes YO to turn on in response to the C100 bit NOTE T
2. VSP760 Timer Status Bits TO 1T177 V41100 V41107 VTO VT160 Counter Status Bits CTO CT177 V41140 V41147 VCTO VCT160 Stages Data Types Timer Current Values SO S377 Bit Memory V41000 V41017 Word Memory VO V377 VSO VS360 TAO TA177 Counter Current Values V1000 V1177 CTAO CTA177 User Data Words V400 V677 V1200 V7377 V10000 V17777 None Input Points X0 X777 V40400 V40437 VX0 VX760 Output Points YO Y777 V40500 V40537 VYO VY760 Control Relays CO C1777 V40600 V40677 VCO VC1760 Special Relays SPO SP777 V41200 V41237 VSPO VSP760 Timer Status Bits TO T377 V41100 V41117 VTO VT160 Counter Status Bits CTO CT177 V41140 V41147 VCTO VCT160 Stages S0 S1777 V41000 V41077 VSO VS1760 Remote I O GX0 GX3777 GY0 GY3777 DLO5 06 Data Communications Module 2nd Edition 09 07 V40000 V40177 V40200 V40377 VGX0 VGX3760 VGY0 VGY3760 4 7 Using Rx and WX Instructions Special Relays for Communications The DirectLOGIC PLCs provide internal contacts bits for monitoring the status of communications The internal contacts are called Special Relays there are other Special Relays used for other purposes The
3. Ow Interlocking It is easy to see the function of the interlocking relays if we construct a truth table first S5 Relays sb Across the top of the truth table we 29 show internal control relays that we AED ils 25 are considering using for our bail ee xE sequencing strategy We have used First RX WX 0 0 0 8 C50 through C52 for our chart but Second RX WX 0 0 1 P any contacts that are not used for exe other purposes in your program will Third RX WX l work just as well Fourth RX WX 0 1 1 Fifth RX WX 1 0 0 1 0 1 1 1 0 1 1 1 The three contacts in this truth table Eighth RX WX will accommodate as many as eight Read or Write instructions Our program only has three RX WxX instructions so we only need to use two contacts see why on page 4 13 We will use C50 and C51 One additional contact C53 would give us 32 combinations since the number of combinations expands as the power of 2 DLO5 06 Data Communications Module 2nd Edition 09 07 Using Rx and WX Instructions Our three RX W X instructions can be sequenced by the two contacts C50 and C51 Two contacts provide four First RX WX 0 0 0 iff t bi tates different binary states Second BXIWX 5 5 i e both off Third RX WX 0 1 0 e C50 on and C51 off Fourth RX WX 0 7 e C50 off and C51 on Fifth RX WX 1 0 0 boiron Sixth RX WX 1 0 1 We only need to use
4. PS In this last rung C50 is normally SP122 C51 C50 closed and C51 is normally open For 7 rae this rung to be executed the C50 bit must be off and the C51 bit must be on corresponding to the third row of the truth table C51 was turned on in the previous rung LD K2 LDA 040602 After the RX instruction is executed a 4 C50 is RESET which opens the C50 contact in this rung and allows it to j close in preparation for repeating the first communication rung on the next c50 CPU scan RSP C51 RST C51 is also RESET which allows the C51 contact to close in preparation for repeating the first communication rung on the next CPU scan p ce Q0 ow J0 Cc Ee xE Zo Zo x Te Returning to the At the end of the third RX WX instruction we cycle back to the top row of the truth First RX WX table on page 4 13 Both C50 and C51 are off and the next CPU scan executes the Instruction first RX WX instruction DL05 06 Data Communications Module 2nd Edition 09 07 Shift Register Store If Equal Using Rx and WX Instructions 4 15 The Shift Register can be used for creating interlocks as an alternative to using control relays For a complete explanation of the function of the Shift Register see the User Manual for your PLC If you have more than a few RX WX instructions using control relays can become cumbersome The Shift Reg
5. Master example This project contains simple logic for reading the inputs from a DL05 06 slave and placing their status in CO C17 in the master It also writes C17 C37 to the outputs on the slave Slave example This project can be used in conjunction with the master project to setup the slave to turn off its outputs if the master PLC stops communicating with it DLO5 06 Data Communications Module 2nd Edition 09 07 Using Rx and WX Instructions 4 9 Program for the In our example the normally open contact ae a Master PLC labeled CO is an internal control relay oun Rung 1 When CO is on discrete output YO is energized Rung 2 The second rung uses a Special Relay to identify a communication error In the example SP123 is on if a communication error is present for slot two Use different SP123 y1 Special Relays if your DCM module is in a SET different slot see page 4 7 We use SP123 to turn on an indicator light connected to a discrete output Rung 3 The Special Relay labeled SP122 is on when slot 2 is busy transmitting or receiving The Read instruction may take longer than one PLC scan to complete Use this Special Relay to prevent overwriting the previous Read instruction with each PLC scan K214 aS Upper gyte Lower Byte LD Z Master PLC 7 4 Slave PLC rd ee DCM Slot P Slave Hex Number of bytes to be transferred Max 128 bytes
6. LD instruction ipa In this example the eight byte block of data 040600 beginning at C100 and ending at C177 in the slave PLC is read copied into the RX master PLC s memory beginning at C100 V40600 Master PLC Slave PLC V40577 V40603 V40600 V40604 v40601 V40605 v40602 V40606 V40603 V40607 V40604 V40610 JI J Ce Y Y byte byte Ga J Y word 4 words 8 bytes Write WX The Write WX instruction specifies the LD Instruction memory location to be written to in the K114 slave PLC A block of data is written that begins at the LD specified memory location and extends the K8 Qn number of bytes specified in the second LD 86 instruction T os In the example the 8 byte block of data 040600 is beginning at V40600 and ending at V40603 i E in the master PLC is written copied into the WX x E slave PLC s memory beginning at C100 and C100 8 ending at C177 ae Master PLC Slave PLC V40577 V40603 V40600 V40604 v40601 V40605 v40602 V40606 V40603 V40607 v40604 v40610 e CD byte byt y yte J yY word 4 words 8 bytes DL05 06 Data Communications Module 2nd Edition 09 07 Using Rx and WX Instructions 45 Addressing the Different Memory Types Some data types are inherently 16 bits long for example timer and counter current values Other data types are 1 bit long for example discrete inputs and outputs Word length and bit length data are mapped into Word Memory also known as V memory which allows you to address any of the
7. Module 2nd Edition 09 07
8. 2 C71 C70 C67 C 6 C65 C64 C63 C62 C61 C60 peal os 3 x The following Write routines are all equivalent DirectSOFT gives you the flexibility 2 to identify the responding PLC s memory area in three different ways as shown 52 below 2a ae E LD LD LD K114 K114 K114 LD LD LD K8 K8 K8 LDA LDA LDA 040600 040600 040600 WX WX WX C C100 VC100 V40605 DL05 06 Data Communications Module 2nd Edition 09 07 4 6 Using RX and WX Instructions Available You can address the different data types by any available convention shown in the Data Types following tables The largest block of data that can be sent in a single Read or Write operation is 128 bytes The smallest block of data is one byte for Bit Memory types and two bytes or one word for Word Memory types The octal numbering system is used for all addresses in these tables DLO5 CPU Data Types Bit Memory Word Memory Alias i ce 25 oe J0 Ee xE o LO xXS Te Timer Current Values None VO V177 TAO TA177 Counter Current Values None V1000 V1177 CTAO CTA177 User Data Words None V1200 V7377 None Input Points XO X377 V40400 V40417 VX0 VX360 Output Points YO Y377 V40500 V40517 VYO VY360 Control Relays CO C777 V40600 V40677 VCO VC760 Special Relays SPO SP777 V41200 V41237 VSPO
9. DirectNet Communications Using RX WX In This Chapter RX WxX Network Instructions Addressing the Different Memory Types Special Relays for Communications Example Program with One RX Instruction Example Program with One WX Instruction Integrating Multiple RX and WX Instructions 42 Using RX and WX Instructions i ce Q0 ow J0 Cc Ee xE Zo Zo be ce RX WX Network Instructions Read RX and The Read RX and Write WX instructions are used by the master PLC to Read a Write WX block of data from another PLC or Write a block of data to another PLC To perform Instructions their functions the RX WX instructions must be preceded in the ladder logic program by two Load instructions and one Load Address instruction The Load and Load Address instructions load communication parameters into the accumulator and the first and second level of the accumulator stack The RX or WX instruction takes these parameters from the stack and the accumulator and prepares the data to be sent over the network If you need to Know more about the function of the accumulator and the accumulator stack refer to the User Manual for your PLC Building the For network communications you build LD Read RX or the Read RX or Write WX instructions Aaaa Write WX into a routine which requires the four Routine instructions you see to the right The function of each of t
10. a different slot see page 4 7 We use SP 123 to turn on an indicator light connected to a discrete output Rung 3 The Special Relay labeled SP122 is on 5P122 when slot 2 is busy transmitting or D LD receiving The Write instruction may take 7 K214 longer than one PLC scan to complete Use lee this Special Relay to prevent overwriting the previous Write instruction with each PLC scan LD Upper Pye one Byte KO Master PLC Slave PLC le Ko 214 LDA DCM Slot we Slave Hex 040600 WX VC100 Number of bytes to be transferred Max 128 bytes Beginning address in the in master PLC expressed as an octal number SUOIJEOIUNWIWOD JO SUOHONAISU XM XY Beginning address in the slave PLC Rung 4 All DirectLOGIC PLCs use an END statement to identify the final rung of the CEND main body of the program Program for the This two rung program resides in the slave C100 YO Slave PLC PLC s CPU Its function is simply to take OUT the C100 contact and convert it to a real output YO END DLO5 06 Data Communications Module 2nd Edition 09 07 4 12 Using RX and WX Instructions Integrating Multiple RX and WX Instructions Multiple Read and Write instructions require interlocks for sequencing because only one RX WxX instruction can be processed at once Using interlocks one RX WX instruction is processed in each scan until all RX WX instructions have been executed After the
11. d DLO6 are listed below Relay Option Slot Communication busy SP120 Communication error SP121 Relay Slot 1 Slot2 Slot3 Slot 4 Communication busy SP120 SP122 SP124 SP126 Communication error SP121 SP123 SP125 SP127 DLO5 06 Data Communications Module 2nd Edition 09 07 SUOIJEOIUNWIWOD JO SUOHONAISU XM XY 48 Using RX and WX Instructions Program with One RX Instruction The Ladder View screen below is the program development screen in DirectSOFT Programming Software This four rung program is explained in detail on page 4 9 This is a complete program although its function is very limited There is also a two rung program that runs in the slave PLC and it is also explained on page 4 9 This example assumes the DCM is in slot 2 of a DLO6 PLC Program for the Ei adder view ix Master PLC LD K2 LDA 040600 vc100 Prog ram for the Hi Ladder View Of x Slave PLC xo C100 1 L OUT Ei When the input XO to the slave PLC is turned on transitions from 0 to 1 the CO bit i in the master PLC also transitions from 0 to 1 The program in the master PLC causes YO to turn on in response to the CO bit x O o S xS E E For example DL05 06 communications programs go to www automationdirect com Rne technical support website gt Example programs gt Coummunications gt example EP COM 005
12. different memory types as 16 bit words Bit Memory Bit memory can be addressed in Read and Write instructions by the name of the first bit of any byte If your second LD instruction contains the constant K8 eight bytes will be transmitted If you use CO in your RX or WX instruction you will transmit the eight bytes from CO through C77 Word Memory In the example below V40600 is the V memory designation for the sixteen bits from and Aliases CO through C17 Aliases are a convenient substitute for V memory designations and can be used interchangeably in Read and Write instructions VCO is the alias for V40600 Either nomenclature addresses the same 16 bits The alias is simply the name of the first bit in a group of sixteen bits with V added as a prefix For example VCO represents the 16 bits beginning with CO Word Memory Bit Memory and Aliases all use the octal numbering system Word Memory Address V40600 VCO Alias C17 C16 C15 C14 C13 C12 C11 C10 C7 C6 C5 C4 C3 C2 C1 CO V40601 VC20 C37 C36 C35 C34 C33 C32 C31 C30 C27 C26 C25 C24 C23 C22 C21 C20 V40602 VC40 C57 C56 C55 C54 C53 C52 C51 C50 C47 C46 C45 C44 C43 C42 C41 C40 ee V40603 VC60 C77 C76 C75 C74 C73 C7
13. he slave PLC logic is a basic example only If the master slave communication fails the bits written to the slaves from the master will remain in the same state last written from the the master i ce Q0 ow J0 Cc Ee xE o LO xXS Te rly E I For example DLO5 06 communications programs go to www automationdirect com a 6 technical support website gt Example programs gt Coummunications gt example EP COM 005 Master example This project contains simple logic for reading the inputs from a DLO5 06 slave and placing their status in CO C17 in the master It also writes C17 C37 to the outputs on the slave Slave example This project can be used in conjunction with the master project to setup the slave to turn off its outputs if the master PLC stops communicating with it DLO5 06 Data Communications Module 2nd Edition 09 07 Using Rx and WX Instructions 4 11 Program for the In our example the normally open contact xo a Master PLC labeled XO is a toggle switch input to a z OUD Rung 1 discrete input module When XO is on Control Relay CO is energized Rung 2 The second rung uses a Special Relay to identify a communication error In the example SP123 is on if there is a SP123 eet Y1 communication error present in slot 2 Use different Special Relays if your DCM SET module is in
14. hese instructions is Ep explained on the following pages They paaa must be used in the sequence shown LDA O aaa RX or WX A aaa The First LD The first Load LD instruction accepts either a constant or a variable Use a K to Instruction designate the number as a constant Use a V if you are entering the address of a register The contents of that register perform the same function as the constant shown below For example you could use V2000 in place of K0114 If the contents of V2000 is the number 114 the function would be the same Using a variable allows changing parameters while the program is running It is recommended however to use a constant when possible Upper Byte Lower Byte ED N L aa K114 Master DCM Slave KO 1 im DCM Slot Number Slave Address Hex Master PLC Slave Device on Network DLO5 06 Data Communications Module 2nd Edition 09 07 Using Rx and WX Instructions 43 The Second LD The second Load LD instruction LD Instruction determines the length of the data block to DET be transmitted during the Read or Write communication This instruction will also accept two data types Use a K to designate the number as a constant Use a V if you are entering the address of a register For Word Memory data you must use a multiple of two bytes between 2 and 128 For Bit Memory data you can use any multiple of one byte between 1 and 128 For more
15. information about addressing Word and Bit Memory see page 4 6 K114 LD PLC Memory 4 words 8 bytes The LDA The Load Address LDA instruction LD Instruction specifies the V memory address of the K114 beginning memory register in the master PLC The data block to be transmitted will begin at this address and extend the number of bytes specified in the preceding LD instruction The leading O indicates this is an octal number Simply substitute LDA the letter O for the V in the V memory 040600 designation For example V40600 becomes 040600 Read instructions copy the data block from the slave PLC memory into the master PLC memory Write instructions copy the data block from the master PLC memory into the slave PLC memory K8 O ai O c J O 9 D suol jond su XM XY Master PLC V40577 V40600 V40601 V40602 V40603 V40604 DLO5 06 Data Communications Module 2nd Edition 09 07 44 Using RX and WX Instructions Read RX The Read RX instruction specifies the LD Instruction memory location to be read from the slave K114 PLC A block of data is read that begins at the LD specified memory location and extends the K8 number of bytes specified in the second
16. ister allows a single contact to be used in each communication rung as an interlock place The data input to the Shift Register SP1 SR Ceo SR is Special Relay SP1 SP1 is the always on bit Combined with a SP122 C77 normally closed contact it sends zeros j to the Shift Register data input The clock input to the Shift Register is SP122 the communication busy bit 1 Each time one of the RX WX instructions executes the Shift Register moves the set bit over one C63 is used in this example to reset the Shift Register to all zeros C77 C76 C75 C74 C73 C72 C71 C70 C67 C66 C65 C64 C63 C62 C61 C60 Shift Register after first scan C77 C76 C75 C74 C73 C72 C71 C70 C67 C66 C65 C64 C63 C62 C61 C60 Shift Register after second scan C77 C76 C75 C74 C73 C72 C71 C70 C67 C66 C65 C64 C63 C62 C61 C60 Shift Register after first RX WX oF C77 C76 C75 C74 C73 C72 C71 C70 C67 C66 C65 C64 C63 C62 C61 C60 Ss Shift Register after second RX WX 3 x o gt C77 C76 C75 C74 C73 C72 C71 C70 C67 C66 C65 C64 C63 C62 C61 C60 Shift Register after third RX WX 9 6 oo 35 C77 C76 C75 C74 C73 C72 C71 C70 C67 C66 C65 C64 C63 C62 C61 C60 we Shift Register after third RX WX plus one scan The Store If Equal in
17. last instruction the sequence then begins again at the first RX WX instruction Without interlocks the RX WX instructions would be executed in an unpredictable order and some might be executed many times before others are executed once The interlocks serve to open disconnect the ladder circuits for all Read and Write instructions except the one that should be processed on the current CPU scan We show two methods of creating the interlocks necessary for sequencing multiple Read and Write instructions e Sequenced Internal Control Relays e Shift Register We will step you through the development of the interlocks using both methods The two examples shown perform the same function Only the interlocks are different understand the Example Programs on pages 4 8 and 4 10 as well as the material i NOTE To fully understand the material in this section you will first need to in the Network Instructions section beginning on page 4 2 The following program segment sequences through three RX WX instructions two Write instructions and one Read instruction You can develop your own program incorporating either of the two interlocking control strategies and expanding the number of interlocks to accommodate the number of RX WX instructions in your Down the left side of the chart we list the number of RX WX instructions we Sixth RX WX may want to use in our RLL program Seventh RX WX program
18. re are two Special Relays for each slot in the PLC that will be used by DCM module The two relays perform the following functions e Communication Busy This bit is on when the communication module is busy transmitting or receiving You must use this bit or relay contact to prevent overwriting your Read or Write RX WX instructions e Communication Error This bit is on when an error occurred in the last RX or WX communication This error automatically clears the bit resets to zero when another RX or WX instruction executes For example Special Relays SP124 and Comm error SP125 correspond to an DCM module in SP125 a slot 3 of the DLO6 PLC SET The Special Relay SP125 is used in the example to energize the output Y50 aa ee er indicating a communication error has LD occurred This Special Relay must Eig K304 appear earlier in the program than your Beet cee aie Bea RX or WX instruction because it is turned LD i off reset to zero when a subsequent Ae Read or Write instruction is executed E PS SSS eS SSeS ay The Special Relay SP124 indicates the LDA DCM is busy When SP124 is on the Tarmi normally closed contact opens to prevent D eos executing another RX or WX instruction RX i until the last one is completed The ason i appropriate busy bit must be usedasa 0 DI IIIIDIL NC contact on every RX WX instruction rung in the program The Special Relays for the DLO5 an
19. struction detects v40603 KO C60 when the Shift Register is reset to SET S zeros When that condition is true the C60 bit is SET by this rung The C60 bit becomes the high bit shifted by the Shift Register until each RX WX instruction is executed in turn DL05 06 Data Communications Module 2nd Edition 09 07 4 16 Using RX and WX Instructions First RX WX Instruction C60 is the interlocking contact It is 5P122 C60 5 turned on by the Store If Equal rung 17 K214 preceding this one LD K2 LDA 040600 WX VC100 Second RX WX Instruction C61 is the interlocking contact It is 5P122 C61 T turned on by the sequencing steps of 7 K209 the Shift Register in a preceding rung LD K2 LDA 040601 WX VCO ge Be Third RX WX 36 Instruction DE Se C62 is the interlocking contact It is SP122 C62 XE turned on by the sequencing steps of 17 LD Zo K214 ZO the Shift Register in a preceding rung x5 m LD K2 LDA 040602 RX VC20 After this rung is executed the Shift Register shifts the high bit from C62 to C63 on the next CPU scan C63 resets the Shift Register to zeros the Store If Equal sets the C60 bit and the CPU executes the first RX WX instruction DLO5 06 Data Communications
20. three of the four Seventh RX WX 1 1 0 binary states circled since we only have three RX WxX instructions to UME d 4 sequence First RX WX Instruction C50 and C51 are interlocking 5P122 51 C50 F contacts They are normally closed in 7 7 K214 this rung to permit power flow to the first WX instruction Both bits are off m corresponding to the first row of the LD truth table After the WX instruction is executed nen C50 is SET turned on which opens the contact in this rung and closes the C50 contact in the next rung WX VC100 C51 is RESET turned off which C50 leaves the C51 contact closed for the SET next rung c51 RST SUOIJEOIUNWIWOD JO SUOHONAISU XM XY DLO5 06 Data Communications Module 2nd Edition 09 07 414 Using RX and WX Instructions es C50 is normally open and C51 is SP122 C51 C50 T normally closed For this rung to be 7 7 K209 executed the C50 bit must be on and the C51 bit must be off corresponding to the second row of the truth table e LD C50 was turned on in the previous K2 rung C51 was turned off in the previous rung LDA 040601 After the WX instruction is executed C50 is RESET turned off which WX opens the C50 contact in this rung and VCO closes it in the next rung C50 C51 is SET turned on which closes Go the normally open C51 contact in the C51 next rung SET
Download Pdf Manuals
Related Search
Related Contents
Consolicdado_Adicion.. H QXPpULTXH FKDQFH HW GpIL SRXU QRV V\VWqPHV FT- BADIGEON Calibradores de temperatura Modelos CTD9300 Santiago CR87 d. DSR-25 GSM/WCDMA Mobile Adaptor ADP-010 LTU - EX - - 07/138 - Model MF5000 Copyright © All rights reserved.
Failed to retrieve file