1. Introduction A programmable controller is an electronic system designed for digital operations and is specifically tailored for industrial environments. It uses programmable memory to store internal programs, which perform user-defined instructions such as logic operations, sequence control, timing, counting, and arithmetic calculations. These controllers interface with various types of machinery through digital or analog input/output signals, allowing them to manage production processes effectively. Programmable controllers are engineered to integrate seamlessly with industrial control systems and offer scalability for future enhancements. Early PLCs were primarily based on digital sequencing and provided limited communication capabilities, typically supporting only RS232, RS485, and Modbus protocols. Modern PLCs have evolved significantly, offering advanced functions like A/D and D/A conversion, numerical computation, data processing, and even analog control. Additionally, they now support communication networking features, such as host computer link communication, enabling efficient interaction with PCs, programmers, and other peripherals. This project focuses on the communication between a host computer and an OMRON PLC using the Host Computer Link Communication protocol. The communication was developed using Visual C++ to establish reliable and real-time data exchange between the two systems. 2. OMRON PLC Communication Protocol With the rapid development of PLC technology, more manufacturers have integrated communication functions into their systems, often utilizing serial ports for data transfer. In this paper, the C200HE PLC is used as a reference to explain the Host Computer Link Communication protocol. Host Computer Link Communication operates by exchanging command and response frames between the host computer and the PLC. Each frame can contain up to 131 characters. The command format begins with the '@' symbol, followed by the node number, command code, address information, and a Frame Check Sequence (FCS). The frame ends with a '*' and a carriage return. The response frame contains the result of the command execution, including status codes that indicate success or errors such as FCS failure, format issues, or data mismatch. If the response exceeds 132 characters, it must be split into multiple frames using the carriage return as a delimiter. For example, a read command might look like: @01RR0100000141*+CH R$(13), which tells the host computer to read the contents of IR0100 in a PLC with node number 1. A write command would be similar but use WR instead of RR to indicate writing data. 3. System Structure Diagram The following diagram illustrates the communication architecture between the host computer and multiple PLCs. To connect multiple PLCs via RS232/422, a level converter is necessary. RS422 supports balanced transmission, offering long-distance communication, strong noise immunity, and multi-point connectivity, allowing up to 32 PLCs to be connected simultaneously. Each PLC must be equipped with a COM06 unit for RS422 connection. All communication follows the Host Computer Link Communication protocol, ensuring consistent and reliable data exchange. 3.1 Hardware Settings The RS232/422 converter should be set to 422 mode, and the COM06 communication board on the OMRON PLC must also be configured to 422 and four-wire mode. 3.2 Parameter Setting The baud rate between the host and the PLC is set to 9600, with a data format of E, 7, 2 (even parity, 7 data bits, 2 stop bits). 3.3 Node Setting The node numbers in the DC6558 unit of the PLC can be set from 00 (default) to 31, depending on the specific configuration. 4. Writing Serial Communication Program Using Visual C++ 6.0 The communication program was developed using Visual C++ 6.0, focusing on implementing serial communication through the MFC framework. The application was built using the MFC AppWizard (exe), creating a dialog-based interface that supports ActiveX controls. Microsoft Communications Control was added to the dialog box, and its properties were configured accordingly. The communication port was set to COM1, with data received as text. The receive threshold was set to 1 character, triggering an event each time a character was received. 5. Adding Code to the Program The program included additional code to handle sending and receiving commands. Variables and response functions were added using the ClassWizard, linking UI elements like text boxes and buttons to their respective functions. Controls such as the communication address text box, DM area text box, and others were mapped to corresponding variables. The Send Command button was linked to the OnSend() function, enabling users to initiate communication manually. Overall, this system enables real-time data exchange between the host computer and the PLC, facilitating efficient control and monitoring of industrial processes.
FAKRA Automotive High Frequency Connectors
Fakra Automotive High Frequency Connectors,Multi-Port Rf Connectors,Fpc Automotive Connector,Automotive Terminals Connector
Dongguan Zhuoyuexin Automotive Electronics Co.,Ltd , https://www.zyx-fakra.com