Moxa Technologies UC-7420/7410 user manual Developing Your First Application, Testing Environment

Models: UC-7420/7410

1 106
Download 106 pages 2.64 Kb
Page 35
Image 35

UC-7420/7410 User’s Manual

Getting Started

Uploading “Hello” to UC-7420/7410 and Running the Program

Use the following command to upload hello-releaseto the UC-7420/7410 via FTP.

1.From the PC, type:

#ftp 192.168.3.127

2.Use bin command to set the transfer mode to Binary mode, and the put command to initiate the file transfer:

ftp> bin

ftp> put hello-release

3.From the UC-7420/7410, type:

#chmod +x hello-release

#./hello-release

The word Hello will be printed on the screen.

root@Moxa:~# ./hello-release Hello

Developing Your First Application

We use the tcps2 example to illustrate how to build an application for UC-7420/7410. The procedure outlined in the following subsections will show you how to build a TCP Server program plus serial port communication that runs on the UC-7420/7410.

Testing Environment

The tcps2 example demonstrates a simple application program that delivers transparent, bi-directional data transmission between UC-7420/7410’s serial and Ethernet ports. As illustrated in the following figure, the purpose of this application is to transfer data between PC 1 and the UC-7420/7410 via an RS-232 connection. At the remote site, data can be transferred between UC-7420/7410’s Ethernet port and PC 2 over an Ethernet connection.

PC 1

PC 2

RS-232

LAN

Read serial data

Write data to PC1

tcps2.c

Serial Rx

Buffer

LAN Rx

Buffer

Send data to PC2

Receive LAN data

2-15

Page 35
Image 35
Moxa Technologies user manual Developing Your First Application, Uploading Hello to UC-7420/7410 and Running the Program