Realization of serial communication between the ho

2022-07-27
  • Detail

The realization of serial communication between microcomputer and multiple machining centers

1 preface

RS-232C and RS-422/485 standards are generally used for serial data communication between microcomputer and machining centers. RS-232C adopts unbalanced voltage line circuit. Its distributed capacitance limits its transmission distance and communication rate, and has no ability to resist common mode interference. It can only be used in short-distance point-to-point communication. RS-422/485 is a differential balanced line circuit, which has strong anti common mode interference ability. The communication distance can reach 1200m, and the maximum transmission rate can reach 10Mbps. It can realize multi-point transmission. It is very suitable for reliably interconnecting multiple scattered manufacturing equipment in the harsh environment of the production site

Jincheng Group imported several OSP7000 horizontal machining centers from Okuma company of Japan. When introducing the machining center, it did not consider the integration with CIM system, so the machining center was not equipped with NDC (DNC: direct digital control) interface and its software. In the actual production, the operators temporarily input the NC program of the parts to be machined into the machining center with a notebook computer, which is not only troublesome, but also does not meet the requirements for the integration of the bottom manufacturing equipment of the workshop and the upper CIM system. In the second phase of jc-cims project, in order to connect multiple machining centers of flexible manufacturing cell and realize the integration with CIM system, the author uses it and then starts normal operation Advantech ADAM module constructs an Adam data acquisition network based on RS-4 to distinguish between joint oil leakage and cylinder plug oil leakage. It realizes the efficient, stable and reliable serial communication between the unit control microcomputer and multiple machining centers in the flexible manufacturing unit. The hardware implementation method and software design of the system are discussed in detail

2 hardware implementation of the system

2.1 hardware implementation of the system

in order to realize the connection between microcomputer and multiple machining centers, Advantech ADAM module is used to construct the equipment layer communication network, as shown in Figure 2-1. Among them, adam4520 module realizes RS-232C signal. The input end of rs-adam4521 module is directly connected to the data bus of Adam network, and the output end is connected to the RS-232C port of machining center. The numerical control system of OSP7000 series horizontal machining center provides BTR mode and DC code control mode to realize data communication between the machining center and external communication equipment. The system adopts DC code control mode. Since OSP7000 series machining center is equipped with 25 pin serial communication interface (socket) and adam4520 is equipped with 9-pin serial communication interface (socket), the two cannot be directly connected. Therefore, the two must be connected by self-made cable (connecting cable 2 in Figure 2-1). When making the connecting cable, it should be noted that the serial port of adam4521 module uses pin 2 to represent the TXD signal, and pin 3 to represent the RXD signal. The OSP machining center is a 25 pin serial interface, using pin 2 to represent the TXD signal, and pin 3 to represent the RXD signal. The wiring of the connecting cable between the machining center and adam4521 is shown in Figure 2-1

it is difficult to directly connect adam4520 module to rs-233c serial port of unit control microcomputer, so a communication cable (connecting cable 1 in Figure 2-1) is made to extend the serial port of unit control computer to realize the connection between unit control microcomputer and adam4520 module. The cable adopts three wire non cross connection method

it should be noted that each ADAM module adopts DC power supply. According to the actual situation, multiple modules can share one power supply. Considering the wire voltage drop, the voltage must be between + 10V and + 30V. In order to prevent the transmission signal from distortion due to discontinuous impedance during signal transmission on the bus, 120 Ω terminal matching resistance is added at both ends of the bus. The address of the machining center connected to the Adam data acquisition network data bus is determined by the adam4521 module connected to it. Its address can be set by initializing the adam4521 module

2.2 system initialization

a) Adam series module initialization can only be accessed to Adam data collection network after ADAM module initialization. The initialization method is to connect an adam4520 module with the adam4521 module that needs to be addressed as shown in Figure 2-1, short-circuit the GND end and init * end of the adam4521 module (the functional composite material market is expected to grow from US $28.62 billion to US $43.35 billion in 2016 to restore the factory setting), then turn on the power supply and run the initialization software attached to the module on the control computer. The initialization software can set the module address, data transmission format (data bit, stop bit, verification method) and communication baud rate. After setting, remove the short-circuit wires of GND and init * to make the setting effective, and the setting will be written into EPROM in the module

b) initialization of machining center parameter setting OSP machining center CNC system has many control parameters, which must be set correctly to realize DNC communication. The NC optional parameters of the OSP NC system are divided into three types: optional parameter bit (bit), optional parameter number (word) and optional parameter long word (L result displays ong word). The No. 8 parameter controlled by the NC optional parameter bit controls the system communication mode selection and communication parameters. The DC control mode is selected. The communication parameters are set to 8 data bits, 1 stop bit, even check and DC code control. In this way, the No. 8 parameter controlled by the NC optional parameter bit is set to, After setting the parameter, restart the machining center to make the parameter setting effective. In addition, the NC optional parameter number 6 parameter is set to the system communication baud rate, which is set to 9600bps; NC optional parameter bit No. 1 Parameter bit 0 is set to 1 and bit 3 is set to 1 to ensure that ISO ASCII characters are used during data transmission. NC machining files must conform to the following format: the first line of the file is "%", the second line is the file name represented by capital letters "O" and 4 digits, the third line is followed by NC instructions, and the last line uses "%" as the end mark of the NC program

3 system software design

the author uses Visual Basic 6 under Windows platform to develop the communication software between the unit control microcomputer and the machining center. The MSComm serial communication control provided by VisualBasic 6 is used to access the computer serial port to realize the serial communication with the machining center

adam data acquisition network adopts master-slave network structure. The communication protocol refers to ISO's OSI protocol hierarchy model and adopts a simplified three-layer structure, namely, the physical layer, the data link layer and the application layer. The network protocol is Xon/XOFF protocol of OSP CNC system

adam module provides a good programming interface. By sending the control instruction set to the module, the

Copyright © 2011 JIN SHI