The abstract turns on ethernet’s question in view of the traditional supervisory system. Uses the low cost Rs232yi the ethernet module is a very good choice. This article introduced inlays eight type fierce too network supervisory system’s hardware composition, the module disposition and the network service terms using the RS232- ethernet module constitution, and has given system’s master routine flow.
Key word supervisory system ethernet embedded monolithic integrated circuit
Introduction
In recent years, along with networking’s development, the network engulfed the entire world. To observe and control instruments and the equipment turning on Internet and so on system how in the industry scene, realizes topic which the information sharing and the remote control into people pay attention. The traditional industry observes and controls the bussing technique which the scene uses (for example RS232 and RS485 and so on) can solve the instrument and equipment’s interconnection intercommunication question well, and obtained the widespread application. But this kind of main line is specially, cannot solve Internet’s turning on problem which designs for the industry. Uses the monolithic integrated circuit coordination ethernet control chip constitution observation system, may solve the observation system and Internet’s turning on question, but actually needs to spend the massive time asked that carries on the development with the energy. Uses commercialized the serial port server or the network server carries on the network interconnection, although may realize the network interconnection, but the software and hardware cost is very high. In view of these situations, we use the low cost the RS232 ethernet to transform the module to take the network interconnection medium, has designed based on the American Cygnal Corporation’s C8051F020 embedded ethernet supervisory system. The result indicated that this supervisory system has used the existing ethernet resources fully, has realized the long-distance observation terminal and the monitoring center correspondence function, thus has realized redundant reliable, the low cost real-time monitoring, has served the industry scene safe operation purpose.
1 RS232- ethernet module and C8051F020 synopsis
ZNE-100PT was the week renders meritorious service a section of RS232- ethernet module module which the company developed, the interior integrated the TCP/IP agreement stack, uses network function which its user might with ease realize embedded has not prepared. Its main feature is:
◆ in inlays 32 ARM7 CPU;
◆ supports the TCP/IP agreement (including Ethernet, ARP, IP, ICMP, IGMP, UDP, TCP, HTTP and DHCP), the working may choose is TCP Server, TCP Client, UDP, Real COM driver and GroupMode.TCP Auto multicast address work port goal IP and the port may establish supports PairConnection to continually the way work;
◆10M the ethernet connection use removes the acupuncture needle the way to draw out;
◆RS232 or the RS485 serial port, the TTL level way, the baudrate is 300~115200 bps.
Uses the RS232 ethernet module to carry on the network interconnection, but reduces the software development time large scale, and the cost is very low.
Monolithic integrated circuit C8051F020 is the composite signal system-on-a-chip which a section integrates completely, is completely compatible with 8051 sets of instructions. It has the following characteristic:
◆ the high speed assembly line structure’s 8051 compatible CIP-5l essence (may reach 25 MIPS);
◆ high speed non-invasion-like online system debugging connection (internal);
◆ true 12 100Ksps 8 channel ADC, brings PGA and the simulation multiway switches;
◆2 12 DAC;
◆64 KB may in the system programming Flash memory;
◆4352 (4096 256) byte internal memory;
◆ addressable 64 KB address space exterior data-carrier storage connection;
◆ the hardware realizes SPI, SMBus/I2C and 2 UART serial interface;
◆5 general 16 timer;
◆5 capture comparison module programmable counter/timer array;
◆ internal watch-dog timer, VDD monitoring device and temperature sensor.
C8051 F020 is on a section of true independent working piece the system, uses in the embedded ethernet supervisory system C8051F020, but reduces the periphery component massively, displays C8051F020 fully the high velocity characteristic, enhanced system’s integration rate greatly.
2 embedded ethernet supervisory system’s specification and the hardware realize the plan
2.1 specifications
The user is as follows to the embedded ethernet supervisory system’s request:
◇8 position entire isolation digital input connection;
◇8 position entire isolation digital output connection;
◇8 the road 12 simulation/digital input connection, input voltage DC is O~12 V:
◇2 the road 12 digit/analog output connection, output voltage DC is O~5 V;
◇RS232 the serial interface, the highest baudrate is 19.2 khps;
◇RJ45 10M network interface.
2.2 realize the plan
Specification which proposed according to the user, take monolithic integrated circuit C8051F020 as the core, auxiliary by RS232- ethernet module ZNE-100PT and few peripheral circuit, constitutes the embedded ethernet supervisory system’s hardware circuit, as shown in Figure 1.

In Figure 1, because C8051F020 has 2 standard serial interfaces, thus assigns for the ZNE-100PT module, as the ethernet connection, another assigned has given the RS232 connection, took and the superior machine correspondence connection (its correspondence speed may act according to the user request in 300~19200 bps adjustments.
Regarding 8 group simulated signal input connection, requests its highest input voltage is 12V, but the C8051F020 internal A/D switch highest input voltage is 3V. Regarding the 12V input voltage, may use the resistance differential pressure damping circuit, reduces to 3 V inputs 12 V input voltages; But regarding 8 group O~5 V analog output voltage, then may enlarge the output directly using the operational amplifier, electric circuit as shown in Figure 2.

The digital input part uses the electro-optical coupler to isolate the digital input signal with this system, thus reduced the external interference to the system the influence; The digital output part also uses the electro-optical coupler to carry on the isolation, as shown in Figure 3.

3 ZNE-100PT module use and network service terms
Before using RS232- ethernet module ZNE-100PT, must defer to ZNE-100PT the request to carry on the software disposition to the module. The prime task has the disposition module IP address, module subnet mask, module gateway and serial interface parameters and so on baudrate. After the disposition completes, the module then uses. What needs to pay attention, when establishment module attribute, might suppose spatially to the frame outset byte and the frame end byte. Thus, when module to correspondence data partitioning TCP/IP data packet, may take the subpackage condition according to the serial port data frame gap.
According to supervisory system’s request, supposes between the definitive text system and ethernet’s communication protocol.
Correspondence data format prefix order character data length data body
①Prefix: START.
②Order character: Total 1 character.
The 1st byte: Expresses the direction of data transfer. By the monolithic integrated circuit -> ethernet is U; By the ethernet -> monolithic integrated circuit is P.
The 2nd byte: For order character.
Orders l: When by monolithic integrated circuit -> ethernet, indicated that the following data is 8 group A/D input values and 8 group digital I/O input value; When by ethernet -> monolithic integrated circuit, indicated that the following data is 2 group D/A values of exports and 8 group digital I/O value of exports.
Orders 2: When by monolithic integrated circuit -> ethernet, indicated that the following data is the RS232 connection receives and retransmits the ethernet, the data body length is smaller than 255 bytes; When by ethernet -> monolithic integrated circuit, indicated that the following data must send out after supervisory system’s RS232 connection, when data transfer conclusion the supervisory system returns to OK, indicated that the transmission ended.
③Data length: the >999 byte, indicates the following data body’s length.
④Data body: Must transmit data.
4 supervisory system software flow
Because the supervisory system needs and must carry on the related operation by way of the ZNE-100PT two-way transmission data, therefore supervisory system software flow as shown in Figure 4.

In Figure 4, CPU first carries on the initialization. Afterward gathers on the ethernet to transmit the data as well as this aircraft’s A/D and the I/O data-in separately. After gathering completes, what if receives is D/A and the I/O output data, then carries on D/A and the I/O output data renewal. If is ethernet’s RS232 output data, then starts the RS232 connection and transmits the data; Otherwise, fixed time transmits this aircraft’s A/D and the I/O data-to the ethernet. If is the RS232 connection data, carries on the repeater to the ethernet.
Conclusion
This article designs based on SoC the monolithic integrated circuit C8051F020 embedded ethernet supervisory system, has used the RS232 ethernet module, thus causes the software development the work load big reduction, enables the supervisory system to depend on the ethernet to realize the long-distance survey and the control. This system has used in the Japanese some company’s production line, and receives the user the high praise. Revise suitably this system’s certain parameters, may also use in other industrial control situation.