Example: stock market

A Guide To RS-232 Communication With FX PLCs - inverter

TECHNOLOGY FOR LIFE. Issued by: Mitsubishi Electric Europe - UK Branch Document issue: Ver B, August 1998. Produced by : - Customer Technology Centre (UK) (CTC UK). Travellers Lane, Hatfield, Herts, AL10 8XB, UK. Author: Alex Kew A Guide TO RS-232 Communication . WITH FX PLCS. MITSUBISHI. ELECTRIC. Page 1 of 35. TECHNOLOGY FOR LIFE. Issued by: Mitsubishi Electric Europe - UK Branch Document issue: Ver B, August 1998. Produced by : - Customer Technology Centre (UK) (CTC UK). Travellers Lane, Hatfield, Herts, AL10 8XB, UK. Author: Alex Kew A Guide TO RS-232 Communication WITH FX PLCS. This document has been written specifically for FX and FX0N users that are unfamiliar with RS-232 no-protocol' Communication and would like to gain more understanding of what the function is and how it works. The aim of this document is not to be too technical, but to give explanations and examples1 of key points where ever possible so that the reader can use the FX range in their own RS-232 system.

1.4 WHAT IS RS-232? RS-232 is the most common of the standards defining the physical and electrical interface of a serial port. 1.4.1 Physical interface definition The physical interface defines the layout of the port and cable type. Below is the pin configuration for the 25-pin RS-232 port (there is also a 9-pin port). The maximum cable length ...

Tags:

  Rt o

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of A Guide To RS-232 Communication With FX PLCs - inverter

1 TECHNOLOGY FOR LIFE. Issued by: Mitsubishi Electric Europe - UK Branch Document issue: Ver B, August 1998. Produced by : - Customer Technology Centre (UK) (CTC UK). Travellers Lane, Hatfield, Herts, AL10 8XB, UK. Author: Alex Kew A Guide TO RS-232 Communication . WITH FX PLCS. MITSUBISHI. ELECTRIC. Page 1 of 35. TECHNOLOGY FOR LIFE. Issued by: Mitsubishi Electric Europe - UK Branch Document issue: Ver B, August 1998. Produced by : - Customer Technology Centre (UK) (CTC UK). Travellers Lane, Hatfield, Herts, AL10 8XB, UK. Author: Alex Kew A Guide TO RS-232 Communication WITH FX PLCS. This document has been written specifically for FX and FX0N users that are unfamiliar with RS-232 no-protocol' Communication and would like to gain more understanding of what the function is and how it works. The aim of this document is not to be too technical, but to give explanations and examples1 of key points where ever possible so that the reader can use the FX range in their own RS-232 system.

2 The intention is not to replace any of the associated manuals, such as the FX. Programming Manual, or the FX-232 ADP / FX0N-232 ADP User Guides, but to back them up in learning how to use the function. 1. Disclaimer: All examples and diagrams in this document are included to aid the readers'. understanding of the text. Mitsubishi Electric does not claim that these examples and diagrams are correct and error free, and will not accept responsibility for any consequential damage that may occur as a result of the installation and programming of the equipment associated with this document. MITSUBISHI. ELECTRIC. CTC-FX RS-232 COMMS Page 2 of 35. TECHNOLOGY FOR LIFE. Issued by: Mitsubishi Electric Europe - UK Branch Document issue: Ver B, August 1998. Produced by : - Customer Technology Centre (UK) (CTC UK). Travellers Lane, Hatfield, Herts, AL10 8XB, UK. Author: Alex Kew Contents 1. INTRODUCTION TO SERIAL Communication 5. WHAT IS SERIAL Communication ?

3 5. TYPES OF SERIAL Communication SYSTEM 5. Simplex 5. Half-duplex 5. Full-duplex 5. TYPES OF TRANSMISSION 6. Synchronous Transmission 6. Asynchronous Transmission 6. WHAT IS RS-232 ? 6. Physical interface definition 6. Electrical interface definition 7. CONFIGURING Communication 7. Data length 7. Baud rate 7. Start bit 8. Stop bit/s 8. Parity bit 8. HANDSHAKING 8. Software handshaking 8. Hardware handshaking 8. SUMMARY 9. 2. OVERVIEW OF SERIAL Communication WITH THE FX PLC 10. FX-232 ADP - RS-232 ADAPTER 10. USER DEFINED NO-PROTOCOL' Communication 11. 3. CREATING THE SERIAL Communication PROGRAM 12. DATA STORAGE FORMAT 12. SET Communication PARAMETERS 13. Parameter set up example 14. Header and terminator characters 14. Hardware handshaking types 14. THE RS INSTRUCTION 15. MITSUBISHI. ELECTRIC. CTC-FX RS-232 COMMS Page 3 of 35. TECHNOLOGY FOR LIFE. Issued by: Mitsubishi Electric Europe - UK Branch Document issue: Ver B, August 1998. Produced by : - Customer Technology Centre (UK) (CTC UK).

4 Travellers Lane, Hatfield, Herts, AL10 8XB, UK. Author: Alex Kew SET TRANSMIT MESSAGE 15. PROCESS RECEIVED MESSAGE 15. 4. POINTS TO NOTE ABOUT FX SERIAL Communication 16. 5. APPLICATION EXAMPLES 17. SENDING MESSAGES TO A PRINTER WITH THE FX 17. SENDING AND RECEIVING DATA TO/FROM A PC 20. PRINTING REAL TIME CLOCK (RTC) DATA - USING THE ASCI INSTRUCTION. (FNC 82) 23. READING BAR CODES 29. Appendix 1 - Standard ASCII character set 33. Appendix 2 - converting 25 pin to 9 pin connectors 33. Appendix 3 - Timing Chart For Handshaking Methods 34. Appendix 4 - Further Reading 34. Notes MITSUBISHI. ELECTRIC. CTC-FX RS-232 COMMS Page 4 of 35. TECHNOLOGY FOR LIFE. Issued by: Mitsubishi Electric Europe - UK Branch Document issue: Ver B, August 1998. Produced by : - Customer Technology Centre (UK) (CTC UK). Travellers Lane, Hatfield, Herts, AL10 8XB, UK. Author: Alex Kew 1. INTRODUCTION TO SERIAL Communication . This chapter introduces the concept of a serial Communication system, and describes the RS-232 serial Communication standard.

5 WHAT IS SERIAL Communication ? Serial Communication is the transfer of binary data (a series of 0's and 1's) through a single channel. Most devices like printers, computers, bar code readers, etc have a serial port by which they can be connected to another device with a serial port and the two devices can send and receive character or bit based data to each other. A basic serial Communication system is shown below, with one device sending data to the other. (Transmitter) (Receiver). Device 1 Device 2. Data Flow 0 1. SD 0 0 1 0 SD. 0 1. RD RD. SG SG. Serial Port Serial Port Figure 1-1 Basic serial Communication system Data is transmitted through SD (Send Data) of the transmitter, and received through RD. (Receive Data) of the receiver. The voltage signals are relative to SG (Signal Ground). TYPES OF SERIAL Communication SYSTEM. Depending on the nature of the devices in the system, data will flow in a certain direction at a certain time. This section overviews the main types of serial Communication .

6 Simplex This describes a system where data flows in one direction only, such as a bar code reader connected to a terminal. Half-duplex This describes a system where data can flow in each direction, but only one way at a time. An example of a half-duplex system is a computer connected to a dot-matrix printer. Full-duplex This describes a system where data flows in each direction, both ways at the same time. An example of a full-duplex system is two computers connected to each other. MITSUBISHI. ELECTRIC. CTC-FX RS-232 COMMS Page 5 of 35. TECHNOLOGY FOR LIFE. Issued by: Mitsubishi Electric Europe - UK Branch Document issue: Ver B, August 1998. Produced by : - Customer Technology Centre (UK) (CTC UK). Travellers Lane, Hatfield, Herts, AL10 8XB, UK. Author: Alex Kew TYPES OF TRANSMISSION. There are two types of transmission; synchronous and asynchronous. Synchronous Transmission The transmitted data contains clock information that is used to synchronise the Communication at both devices.

7 This means that transmission overheads ( start/stop bits) can be greatly reduced, as the transmission occurs at a specific time determined by the clock. Asynchronous Transmission The transmitted data does not contain clock information, and the receiver knows only the approximate speed of the transmission. Because the Communication is not synchronised by a common clock signal, extra bits are required to signify the start and end of each character. These are called, unsurprisingly, the start bit and the stop bit. This document will deal mainly with the asynchronous method, as it is the method used by the FX PLC. WHAT IS RS-232 ? RS-232 is the most common of the standards defining the physical and electrical interface of a serial port. Physical interface definition The physical interface defines the layout of the port and cable type. Below is the pin configuration for the 25-pin RS-232 port (there is also a 9-pin port). The maximum cable length is 15m.

8 13. 25. DTR: Data Terminal Ready 8 CD: Carrier Detect 20 7 SG: Signal Ground 6 DSR: Data Set Ready 5 CTS: Clear To Send 4 RTS: Request To Send 3 RD: Receive Data 2 SD: Send Data 14. 1 FG: Frame Ground Figure 1-2 25-pin RS-232 port MITSUBISHI. ELECTRIC. CTC-FX RS-232 COMMS Page 6 of 35. TECHNOLOGY FOR LIFE. Issued by: Mitsubishi Electric Europe - UK Branch Document issue: Ver B, August 1998. Produced by : - Customer Technology Centre (UK) (CTC UK). Travellers Lane, Hatfield, Herts, AL10 8XB, UK. Author: Alex Kew The following table describes the operation of the signal pins of the RS-232 port. Pin Signal Description 1 FG Frame Ground Used to provide grounding for the cable 2 SD Send Data Used to send data to the other device 3 RD Receive Data Used to receive data from the other device 4 RTS Ready To Send Indicates the device has data it wants to send 5 CTS Clear To Send Indicates the other device is ready to receive data 6 DSR Data Set Ready Indicates the other device is ready to receive data 7 SG Signal Ground All signals sent or received are relative to this pin 8 CD Carrier Detect Indicates that the carrier for transmission is on 20 DTR Data Terminal Ready Indicates the device has data it wants to send Electrical interface definition The electrical interface defines the voltage levels used to represent the 1s and 0s which make up the data.

9 For logic 0: +3 to +12V. For logic 1: -3 to -12V. (To allow for any noise in the channel, voltage signals between -3 to +3V are ignored.). CONFIGURING Communication . Both devices in a serial communications system need to be configured with the same Communication parameters so that data flows effectively. This section will explain each parameter. Data length Transferred data is usually characters in an asynchronous transmission system. In most cases, these characters are in ASCII (American Standard Code for Information Interchange) format. The ASCII character set includes all the letters of the alphabet (upper and lower case), numbers 0 to 9, and other symbols such as +, =, % and so on (see Appendix 1 for the standard ASCII set). Each ASCII character is encoded as a binary number so they can be tranmsitted through the serial channel. The number of bits that make up this binary number is referred to as the data length, and can be set as 7 bits or 8 bits.

10 When the standard ASCII set is used, the most significant bit in the number is redundant. So, by setting the data length as 7 bits, transmission overheads can be reduced (especially when lots of data needs to be transferred). Baud rate The baud rate is the speed of transmission, given in bits per second (bps). The baud rate can be set between 300 and 19200 bps. MITSUBISHI. ELECTRIC. CTC-FX RS-232 COMMS Page 7 of 35. TECHNOLOGY FOR LIFE. Issued by: Mitsubishi Electric Europe - UK Branch Document issue: Ver B, August 1998. Produced by : - Customer Technology Centre (UK) (CTC UK). Travellers Lane, Hatfield, Herts, AL10 8XB, UK. Author: Alex Kew Start bit The start bit, usually a 1, signifies the beginning of a character to the receiving device in an asynchronous system. This parameter is not usually configurable by the user. Stop bit/s Either one or two stop bits, usually a 0, is used to signify the end of a character in an asynchronous system. The user can choose whether one or two stop bits is added.


Related search queries