The abstract in the industrial control and the expense electron domain, many equipment requests to have the ethernet at present or and the Internet correspondence function. This article discusses one kind based on the TINI ethernet turning on plan. This system may expand very conveniently to other communication protocol transformation, such as CAN, the 1-Wire network and so on, adapts the different equipment to turn on ethernet’s need. Using this system may well the solution and the automation production equipment, the network switch and sensor’s long-distance correspondence question, as well as realizes the remote diagnosis and the control. Moreover, introduced develops the serial port using Java as the development kit to the ethernet data conversion signal procedure.
The key word network data transforms TINI Java DP83846A DS80C400
In order to achieve uses the Internet formidable network function, realizes the long-distance monitoring goal, needs to study the reasonable net connect person plan. The use based on the TINI platform’s embedded system, the build different equipment meets the person computer network’s bridge. Uses the embedded system formidable software and hardware function, may support the different equipment, realizes the turning on plan versatility. Because the embedded system has the good data-handling capacity, not only may take the simple network interface, but may also expand meets the person equipment’s network function, even may also carry on processing and so on encryption to the correspondence data.
The embedded system including the special-purpose hardware and the software part, the hardware provides the performance the support, but the software provides the widespread flexibility for the user. Embedded system’s software including its own operating system and programming environment. Java has each characteristic causes it to become the embedded equipment ideal software development tool. Has the free opening resources in view of Java, the Java independence in the hardware platform, has the probability. All these may reduce the embedded equipment development and the use cost. And the TINI platform is one kind has the Java development function embedded system.
1 system hardware composition
Based on TINI data conversion system’s hardware system as shown in Figure 1. The system and the outside connection is mainly the RS232 serial port and the RJ45 ethernet connection, its function is meets the serial port equipment the human to confined network even Interne.


2 network data transition system’s Java procedure
2.1 software development tool bag - - TlNI SDK
For realizes in the programming visit to the hardware, Dallas Corporation develops TINI SDK the DS80C400 in hardware part hypothesized is the Java kind. Realizes through the transfer related method to hardware’s operation. In SDK contains the embedded operating system which Dallas Corporation develops. It is the multi-duties, the multithreading, has the cross platform ability, to have highly the optimized Java movement environment operating system.
Develops the application procedure under the TINI SDK support, mainly uses Java to carry on, usually faces the assembly language not directly, but the TINI movement environment has provided the use local method mechanism. In order to optimize the strict request speed the channel or visits the first floor hardware, may use the local language (is mainly assembly language) compiles the subroutine, like this increased system’s flexibility.
In use SDK provides API may simplify the programming. In use SDK provides tools and so on JavaKit and TINIConvertor, carry on the procedure on PC the development debugging work, the production are suitable for the TINI movement environment goal application procedure. Loads TINI through JayaKit to the TINI hardware memory in the movement environment (including the TINI operating system), disposes the good network parameter, then through downloading user programs and so on FTP, TELNET and controls the movement to the TINI hardware on. The TINI Java virtual machine transforms the code which into the Java byte code the machine hardware system can carry out.
2.2 system program design methods
In order to realize the serial port data and between the ether network data exchange, has designed based on the TINI system’s network data conversion routine. This procedure’s major function is, from the serial port equipment read data, the data which will obtain carries on the TcP/IP agreement seal, transmits through the RJ45 connection to the superior machine, carries on with the superior machine server procedure alternately; At the same time, retransmits the superior machine transmission for the TINI data to the RS232 serial port, then may through the network long-distance monitoring scene serial port equipment. In this design, on the TINI printed wiring board has two serial ports, defines separately as serial port O and the serial port 4. The monolithic integrated circuit internal integrates UART, the serial port 0 uses for the serial port to start TINl, downloads the TINI movement environment, as well as TINI output terminal. In this procedure, the use serial port 4 and the superior machine server procedure is interactive.
The data conversion realizes by two advancements, they respectively are SerialWriter and SerialReader. The SerialWritel function is from the superior machine server read data stream, writes about again the data the serial port output data stream; The SeriaReader function is reads the serial port buffer in available data the input buffer, through writes the data to the network output class to transmit the serial port data to the network server, and renewal serial port data quantity; Whether there is simultaneously monitors these two advancements exceptionally. If catches exceptionally, then closed the data stream and interrupts the maintenance thread, the termination routine.
SerialToEthernet itself has inherited a thread class. It is a maintenance thread, the function is the judgment system communication condition. If normal, then every other 6 s printout data current capacity; If connects the server is shut down, then closure serial port socket and related class. In its thread procedure, is one has the systems operation status flag control circulation, the maintenance program run, in each circulation first causes this advancement sleep 6 000 ms, then printout this time’s data current capacity. Procedure flow like chart 2, chart 3, shown in Figure 4.


3 system debugging plan
The system debugging’s main purpose is simulates between the field apparatus and ethernet’s data conversion, is connected PC machine through the serial port and the ethernet connection and the system, wiring way as shown in Figure 5; With the PC machine simulation scene’s equipment, simultaneously, takes the superior machine supervisory system movement using PC machine.
In the experiment besides moves SerialToEthernet, but also has prepared two simple user programs, uses in the system debugging, respectively is HelloWorld and Blinky.
First step, downloading moves HelloWorld. Its function is in (is similar by JavaKit as the TINI system output terminal to the PC machine monitor), printout “Hello World” the string of character, uses in examining serial port O.
Second step, downloading moves Blinky. Its function does not stop the twinkle with P3.5 connected LED, uses in examining the I/0 mouth the function.
Third step, downloading moves SerialToEthernet, simultaneously moves in superior machine server procedure TINlServer. On the TINI system moves Serial-ToEthernet, uses in realizing the data repeater function. In order to confirm the serial port correspondence which the superior machine and TINI asked that in the superior machine moves the serial port debugging routine, thus uses the superior machine simulation actual scene serial port equipment. When movement serial port debugging routine, in supposes the serial port for is the same with the TINI serial port parameter, the transmission pattern supposes to transmit continuously. In such simulation situation, from the serial port debugging routine window input’s data, through the serial port transmission for the TINI system, passes through TINI the repeater, through RJ45 connection sending-out superior machine. Superior machine movement server procedure TINIServer, it the data which sends in TINI not after processing directly through the output class transmission for TINI. After the TINI repeater, the data by the serial port returns superior machine, demonstrates once more in the serial port debugging routine “the receive area”. The data flows to as shown in Figure 6.


4 conclusions
Compares with the traditional industrial control data conversion system, TINI is more inexpensive, is more compact, the consumed power is lower, and easy to maintain. In addition, TINI also supports many first floors the correspondence connections, has the enough flexibility, may adapt the different networking request. Is the low cost moreover is reliable based on the TINI network data transition system plan. May enhance the embedded system software development using the Java programming the efficiency. In this system’s performance history. Realizes very conveniently using the Java software visit to first floor hardware’s; Using Java own characteristic, may realize the formidable network function.
Regarding the equipment, may use the existing network through this system to expand its function; Simultaneously may also realize using the ether network to equipment’s remote diagnosis control, realizes in the more widespread significance network.