Home

App K_Intro to Serial Comm.qxd

image

Contents

1. Communications Port 2 DLO5 Port Sp ecifications Connects to HPP DirectSOFT 5 operator interfaces etc 6 pin multifunction port RS232C RS422 RS485 RS485 with 2 wire is only available for Modbus and Non sequence Communication speed aud 300 600 1200 2400 4800 9600 19200 38400 Parity odd default even none Station Address 1 default 8 data bits 1 start 1 stop bit Asynchronous half duplex DTE Protocol auto select K sequence eae only DirectNET master slave Modbus RTU master slave non sequence print Communications Port 1 Connects to HPP DireciSOFT 5 operator interfaces etc 6 pin RS232C Communication speed baud 9600 fixed Parity odd fixed Station Address 1 fixed 8 data bits 1 start 1 stop bit Asynchronous half duplex DTE Protocol auto select K sequence slave only DirectNET slave only Modbus RTU slave only 1 Pin Descriptions Port 2 Pin Descriptions Power connection GND OV Power connection GND Power connection 5V Power connection DLO05 Port Pinouts Receive data RS 232C TXD Transmit data RS 232C Transmit data RS 232C Receive data RS 232C Power connection RTS to send RS 232C Power connection GND CTS Clear to send RS232C
2. RUN STOP CZ m S Top View PORT 1 PORT 2 Note that the default configuration for port 2 is Auto detect among K Sequence DirectNET and Modbus RTU protocols Timeout Base Timeout x 1 800 ms RTS on delay time 0 ms RTS off delay time Oms Station Number 1 Baud rate 19200 Stop bits 1 Parity odd Format Hex K 4 01 05 Micro PLC User Manual 6th Edition Rev C Appendix Introduction to Serial Communications H Port Setup Using DirectSOFT or Ladder Logic Instructions Port 2 on the DLO5 can be configured for communications using the various protocols which have been previously mentioned Also the communications parameters can be configured to match the parameters in the other device s with which the PLC will be communicating The port may be configured using the DzrectSOFT PLC programming software or by using ladder logic within the PLC program It is important to note that the settings for port 2 are never saved to disk with DzrectSOFT so if you are using port 2 in other than its default configuration it is a good idea to include the port setup in the ladder program typically on a first scan bit or in an initialization subroutine To set up port 2 using DirectSOFT the PLC must be turned on and connected to Ug DirectSOFT Wi
3. Load Address LDA instruction Its purpose is to load the starting address of the memory area to be Starting address of transferred Entered as an octal number the LDA master transfer area instruction converts it to hex and places the result in the accumulator LDA o0 For a WX instruction the DLO5 CPU sends the number of bytes previously specified from its memory area beginning at the LDA address specified For an RX instruction the DL05 CPU reads the 15 0 number of bytes previously specified from the slave MSB V40601 LSB placing the received data into its memory area beginning at the LDA address specified 15 0 MSB V40600 LSB example if you only specify 3 bytes and you are reading Y outputs from the slave you will only get 24 bits of data In this case only the 8 least significant bits of the last word location will be modified The remaining 8 bits are not affected NOTE Since V memory words are always 16 bits you may not always use the whole word For K 10 DLO05 Micro PLC User Manual 6th Edition Rev C Appendix Introduction to Serial Communications Step 4 Specify Slave Memory Area SP116 ID The last instruction in our sequence is the WX or RX A KF201 instruction itself Use WX to write to the slave and RX to read from the slave All four of our instructions are LD shown to t
4. K 6 0105 Micro PLC User Manual 6th Edition Rev C Appendix Introduction to Serial Communications m Use the ladder logic shown below to set up port 2 for Modbus protocol for the following RTS On delay of 10ms Base timeout x1 RTS Off delay of 5ms Odd parity 1 Stop bit 19 200 baud or Station Number 23 LD K3022 OUT V7655 LD K8617 OUT V7656 Port 2 Setup for RLL Using ASCII V7655 Word 1 RTS On delay ino of std timeout Protocol RTS Off delay Oyyy Ottt mmmm mxxx yyy ttt mmmmm XXX 000 Oms 000 100 00010 Non Sequence 000 Oms 001 2ms 001 120 001 2ms 010 5ms 010 150 011 10ms 011 200 011 10ms 100 20ms 100 500 100 20ms 101 50ms 101 1000 101 50ms 110 100ms 110 2000 110 100ms 111 500ms 111 5000 111 500ms V7656 Word 2 Stop Bits Baud Rate K Sequence DireciNET amp Modbus RTU ppsO Obbb aaaa aaaa pp S bbb 00 None 0 1 bit 000 300 10 Odd 1 2 bits 001 600 11 Even 010 1200 011 2400 100 4800 101 9600 110 19200 111 38400 01 05 Micro PLC User Manual 6th Edition Rev C K 7 Appendix Introduction to Serial Communications a V7656 Word 2 cont d Protocol Mode K Sequence DirecfNET aaaaaaaa amp Mo
5. PENDIX K Introduction to Serial Communications K 2 INTRODUCTION TO SERIAL COMMUNICATIONS In this Appendix Appendix Introduction to Serial Communications a Introduction to Serial Communications DirectLOGIC PLCs have two built in serial communication ports which can be used to communicate to other PLCs or to other serial devices In order to fully understand the capabilities and limitations of the serial ports a brief introduction to serial communications is in order There are three major components to any serial communications setup Wiring standard Communications protocol Communications parameters Each of these will be discussed in more detail as they apply to DirectLOGIC PLCs Wiring Standards There are three different wiring standards that can be used with most of the DirectLOGIC PLCs RS 232C RS 422 and RS 485 DL05 PLCs only support RS 232C although RS 422 can be accomplished by using converters such as the FA ISOCON RS 232C is a point to point wiring standard with a practical wiring distance of 15 meters or 50 feet maximum This means that only two devices can communicate on an RS 232C network a single master device and a single slave device and the total cable length cannot exceed 50 feet AutomationDirect L19772 cable Belden amp 8102 or equivalent is recommended for RS 232C networks Ports 1 and 2 on the DLO5 use RJ12 phone type connectors see pages 4 4 and
6. protocol makes it ideal for PLC to PLC communication over a point to point or multipoint network using the RX and WX instructions Modbus RTU protocol is a very common industry standard protocol and can be used by a master or slave DL05 to communicate with a wide variety of industrial devices which support this protocol ASCII is another very common industry standard protocol and is commonly used where alpha numeric character data is to be transferred Many input devices such as barcode readers and electronic scales use ASCII protocol Many output devices accept ASCII commands as well No matter which wiring standard or protocol is used there are several communications amp parameters to select for each device before it will be able to communicate These parameters include Baud Rate Flow Control Data Bits Echo Suppression Parity Timeouts Stop Bits Delay Times Station Address Format All of these parameters may not be necessary or available for your application The parameters used will depend on the protocol being used and whether the device is a master or slave NOTE An important point to remember is that when the same parameter is available in the master l and in the slave i e Baud Rate Parity Stop Bits etc the settings must match DL05 Micro PLC User Manual 6th Edition Rev C K 3 Appendix Introduction to Serial Communications a
7. BCD DirectNET slaves The format of the word is shown to Internal port hex the right The F2 in the upper byte indicates the use of the the port on the right on the DL05 PLC port H 10 number 2 The lower byte contains the slave address KF201 number in BCD 01 to 99 Step 2 Load Number of Bytes to Transfer 6 4 The second Load LD instruction determines the cm number of bytes which will be transferred between the master and slave in the subsequent WX or RX fb instruction The value to be loaded is in BCD format Or DYTE Torase decimal from 1 to 128 bytes LD K64 DL05 Micro PLC User Manual 6th Edition Rev C K 9 Appendix Introduction to Serial Communications a The number of bytes specified also depends on the type of data you want to obtain For example the DL05 Input points can be accessed by V memory locations or as X input locations However if you only want X0 X27 you ll have to use the X input data type because the V memory locations can only be accessed in 2 byte increments The following table shows the byte ranges for the various types of DirectLOGIC products DLOS Memory Bits per unit V memory T C current value Inputs X SP Outputs Y C Stage T C hits Scratch Pad Memory Diagnostic Status Step 3 Specify Master Memory Area 4 6 0 The third instruction in the RX or WX sequence is a octal
8. 4 5 for the cable connections K 2 DLO05 Micro PLC User Manual 6th Edition Rev C Appendix Introduction to Serial Communications Hr Communications Protocols communications protocol is the language the devices on a network use to communicate with each other All the devices on the network must use the same communications protocol in order to be able to communicate with each other The protocols avaliable in the DirectLOGIC DL05 PLCs are listed in the following table DLO5 Communications Protocols Protocol Master Slave Port 1 Port 2 RS 232C K Sequence No Yes Yes Yes Yes DirectNET Yes Yes Yes Yes Yes Modbus RTU Yes Yes Yes Yes Yes ASCII Out In No Yes Yes Port 1 supports slave only and is only RS 232C with fixed communications parameters of 9600 baud 8 data bits 1 start bit 1 stop bit odd parity and station address 1 It is an asynchronous half duplex DTE port and auto selects between K Sequence DirectNET and Modbus RTU protocols RS 422 is available on Port 2 using an RS 422 converter such as the FA ISOCON K Sequence protocol is not available for use by a master DLO5 PLC Therefore it cannot be used for networking between PLCs Its primary use in the DLO5 PLC is as a slave to DirectSOFT programming software and to an operator interface DirectNET protocol is available for use by a master or by a slave DL05 PLC This and the fact that it is native
9. and is probably the closest thing to an industry standard protocol in existence The DL05 can be a Modbus RTU slave on either port 1 or port 2 and it can be a Modbus RTU master on port 2 In order to use port 2 for Modbus RTU communications you must first set up the port using either DirectSOFT or ladder logic as previously described For network slave operation nothing more needs to be done Port 2 will function as a slave unless network communications instructions are executed by the ladder logic program For network master operation the Modbus RTU network communication instructions MRX and or MWX must be added to the ladder program If more than one network communication instruction is used the rungs need to be interlocked to ensure that only one communication instruction is executed at any given time If only a few network communications instructions are used in your program discrete bits can be used to interlock them If many network communications instructions are used either a counter or a shift register will be a more convenient way to interlock the instructions DL05 Micro PLC User Manual 6th Edition Rev C K 13
10. dbus RTU 01110000 No flow control 01110001 Xon Xoff flow control 01110010 RTS flow control 01110011 Xon Xoff and RTS flow control V7650 Word 3 V memory address for data Hex value of the V memory location to temporarily store the ASCII data coming into the PLC Set this parameter to an unused V memory location which has enough consecutive memory locations free to store the longest string that will come into the PLC Use the ladder logic shown below to set up port 2 for Non sequence ASCIT communications with the following RTS On delay of 10ms Base timeout x1 RTS Off delay of 5ms Odd parity 1 Stop bit 19 200 baud 8 data bits V memory buffer starting at V2000 and no flow control LD OUT V7655 LD K8670 OUT V7656 LDA 02000 OUT V7650 K 8 DL05 Micro PLC User Manual 6th Edition Rev Appendix Introduction to Serial Communications H K Sequence Communications The K Sequence protocol can be used for communication with DirectSOFT an operator interface or any other device that can be a K Sequence master The DL05 PLC can be a K Sequence slave on either port 1 or port 2 The DL05 PLC cannot be a K Sequence master In order to use port 2 for K Sequence communications you first need to set up the port using either DirectSOFT or ladder logic as previously described DirectNET Communication
11. ead of any network instruction boxes since the error bit is reset when an RX or WX instruction is executed Multiple Read and Write Interlocks If you are using multiple reads and writes in the RLL program you have to interlock the routines to make sure all the routines are executed If you dont use the interlocks then the CPU will only execute the first routine This is because each port can only handle one transaction at a time In the example to the right after the RX instruction is executed C100 is set When the port has finished the communication task the second routine is executed and C100 is reset If you re using RLLPLUS Stage Programming you can put each routine in a separate program stage to ensure proper execution and switch from stage to stage allowing only one of them to be active at a time K 12 105 Micro PLC User Manual 6th Edition Rev C SP116 C100 Interlocking Relay LD F201 Interlocking Relay SP116 C100 LD 0003 LDA O40600 RX VYO C100 ser LD KF201 HH LD K0003 LDA 040400 WX VYO C100 RST Appendix Introduction to Serial Communications Modbus RTU Communications The Modbus RTU protocol can be used for communication with any device that uses the Modbus RTU protocol The protocol is very common
12. he right In the last instruction you must specify the starting address and a valid data type for the LDA slave 040600 DirectNET slaves specify the same address in the WX and RX instruction as the slave s native I O address RX e Modbus DLOS slaves specify the same address in the WX Yo and RX instruction as the slave s native I O address DL05 Micro PLC User Manual 6th Edition Rev C K ll Appendix Introduction to Serial Communications a Communications from a Ladder Program Typically network communications will last longer than 1 scan The program must wait for the communications to finish before starting the next transaction Port Communication Error Port 2 which can be a master has two Special Relay contacts associated with it see Appendix D for comm port special relays One indicates Port busy SP116 and the other SP117 Y1 SED SP116 LD KF201 x Port Busy LDA O40600 RX YO indicates Port Communication Error SP117 The example above shows the use of these contacts for a network master that only reads a device RX The Port Busy bit is on while the PLC communicates with the slave When the bit is off the program can initiate the next network request The Port Communication Error bit turns on when the PLC has detected an error Use of this bit is optional When used it should be ah
13. s The DirectNET protocol can be used to communicate to another PLC or to other devices that can use the DirectNET protocol The DLO05 can be used as either a master using port 2 or a slave using either port 1 or port 2 In order to use port 2 for DirectNET communications you must first setup the port using either DirectSOFT or ladder logic as previously described For network slave operation nothing more needs to be done Port 2 will function as a slave unless network communications instructions are executed by the ladder logic program For a network master operation you will simply need to add some ladder rungs using the network communication instructions RX and or WX Only one network communication instruction should be executed at any given time If you have just a few network communications instructions in your program you can use discrete bits to interlock them If you are using many network communications instructions a counter or a shift register will be a more convenient way to interlock the instructions The following step by step procedure will provide the information necessary to set up your ladder program to receive data from a network slave Step 1 Identify Master Port and Slave F201 The first Load LD instruction identifies the ee eee communications port number on the network master DL05 and the address of the slave station This Y Slave address BCD instruction can address up to 99 Modbus slaves or 90 Port number
14. th the PLC Setup toolbar displayed select the Port 2 button or select PLC gt P Setup gt Setup Sec Comm Port from the menu bar located at the top of the programming window A dialog box like the one below will appear Make the appropriate settings and write them to the PLC Pot Pot Protocol Base Timeout KSequence 800 ms DiectNET 800 ms w MODBUS 500 me NonSequence 3 Characters Timeout Base Timeout x 1 RITS on delay time 5 ms FITS off delay lime 2 me Station Number 1 Baud 38400 Stop bie 1 Party Odd Pott 2 6 Pin In order to set up port 2 in relay ladder logic the appropriate values must be written to V7655 Word 1 V7656 Word 2 and V7650 Word 3 for ASCII only to specify the settings for the port Then write the setup complete flag K0500 to V7657 Word 3 to request the CPU to accept the port settings Once the CPU sees the setup complete flag in V7657 it will test the port settings which have selected for validity and then change the value in V7657 according to the results of this test If the port settings are valid the CPU will change the value in V7657 to 0A00 for Accepted If there was an error in the port settings the CPU will change the value in V7657 to 0 00 E for Error NOTE This is a Helpful Hint Rather than build the setup words manually from the tables use DirectSOFT to set up the port as desired then use Dataview to view the se
15. tup words as BCD HEX Then simply use these numbers in the setup code The data that is written to the port setup words has two formats The format that is used depends on whether K Sequence DirectNET Modbus RTU method 1 or ASCII method 2 is selected DL05 Micro PLC User Manual 6th Edition Rev C 5 Appendix Introduction to Serial Communications a Port 2 Setup for RLL Using K Sequence DirectNET or Modbus RTU V7655 Word 1 RTSOm delay Protocol RTS Off delay Ottt mmmm mxxx yyy ttt mmmmm XXX 000 Oms 000 100 10000 K Sequence 000 Oms 001 2ms 001 120 01000 DirectNET 001 2ms 010 5ms 010 150 00100 Modbus RTU 010 5ms 011 10ms 011 200 011 10ms 100 20ms 100 500 100 20ms 101 50ms 101 100095 101 50ms 110 100ms 110 2000 110 100ms 111 500ms 111 5000 111 500ms V7656 Word 2 Parity Stop Bits Baud Rate K Sequence DireciNET amp Modbus RTU 0 Obbb aaaa pp S bbb 00 None 0 1 bit 000 300 10 Odd 1 2 bits 001 600 11 Even 010 1200 011 2400 100 4800 101 9600 110 19200 111 38400 V7656 Word 2 cont d Protocol Port 2 Address K Sequence DireciNET DirectNET DirectNET and amp Modbus RTU Modbus RTU ppsO Obbb aaaa X aaaaaaa 0 Hex DirectNET 1 90 1 ASCII Modbus RTU 1 247

Download Pdf Manuals

image

Related Search

Related Contents

La E-pub mode d`emploi Pédagogie Objectifs    GE CO2 Brochure  CDE-171R/CDE-171RR/CDE-171RM CDE-170R/CDE  Teledex B150D User's Manual  Olympus E-M5 + M.Zuiko Digital ED 12-50mm 1:3.5-6.3 EZ  1 Introduction  proposed method for making the impact assessment proyecto 50  CIK-FIA Leisure Karting Guidelines  llllll|l|l|lllllllllllllllllllllllllllllllllllllllllllllllllll  

Copyright © All rights reserved.
Failed to retrieve file