UC-7408 User’s Manual Sixth Edition, February 2009 www.moxa.com/product © 2009 Moxa Inc. All rights reserved. Reproduction without permission is pro
UC-7408 User’s Manual Introduction 1-5Dimensions 197 mm [7.76"]125 mm [4.92"]44 mm[1.73"] Hardware Block Diagram The following block
UC-7408 User’s Manual Introduction 1-6LED Indicators UC-7408 has 12 LED indicators on the top panel. Refer to the following table for information ab
UC-7408 User’s Manual Introduction 1-7Real Time Clock UC-7408’s real time clock is powered by a lithium battery. We strongly recommend that you do n
UC-7408 User’s Manual Introduction 1-8DIN-Rail Mounting The aluminum DIN-Rail attachment plate is included in the package. If you need to reattach t
UC-7408 User’s Manual Introduction 1-9You should also observe the following common wiring rules: y Use separate paths to route wiring for power and
UC-7408 User’s Manual Introduction 1-10Connecting to the Network Connect one end of the Ethernet cable to one of UC-7408’s 10/100M Ethernet ports (8
UC-7408 User’s Manual Introduction 1-11CompactFlash UC-7408 provides one CompactFlash slot that supports CompactFlash type I/II card expansion. Curr
UC-7408 User’s Manual Introduction 1-12User APUser Directory(User Configuration)Mini Root File SystemConfigurationLinux Kernel & RootHWBoot Load
UC-7408 User’s Manual Introduction 1-13Although JFFS2 is a journaling file system, this does not preclude the loss of data. The file system will rem
22 Chapter 2 Getting Started In this chapter, we explain how to connect UC-7408, turn on the power, and then get started using the programming and
UC-7408 User’s Manual The software described in this manual is furnished under a license agreement and may be used only in accordance with the terms
UC-7408 User’s Manual Getting Started 2-2Powering on UC-7408 Connect the SG wire to the Shielded Contact located in the upper left corner of the UC-
UC-7408 User’s Manual Getting Started 2-3Telnet Console If you know at least one of the two IP addresses and netmasks, then you can use Telnet to co
UC-7408 User’s Manual Getting Started 2-4 ATTENTION Serial Console Reminder Remember to choose VT100 as the terminal type. Use cable CBL-RJ45F9-150,
UC-7408 User’s Manual Getting Started 2-5Linux Users From a Linux machine, use the “ssh” command to access UC-7408’s Console utility via SSH. #ssh 1
UC-7408 User’s Manual Getting Started 2-6 Dynamic IP addresses: By default, UC-7408 is configured for “static” IP addresses. To configure one or bot
UC-7408 User’s Manual Getting Started 2-73. After the boot settings of the LAN interface have been modified, issue the following command to activate
UC-7408 User’s Manual Getting Started 2-8 3. Configure the Wireless LAN card’s default SSID setting profile. (Default SSID is “any”) #vi /etc/wlan/
UC-7408 User’s Manual Getting Started 2-9IEEE802.11g The following IEEE802.11g wireless modules are supported: y ASUS—WL-107g y CNET—CWC-854 (181D
UC-7408 User’s Manual Getting Started 2-103. Additional WLAN parameters are contained in the file RT2500STA.dat. To open the file, navigate to the R
UC-7408 User’s Manual Getting Started 2-11 NetworkType—Sets the wireless operation mode Setting Explanation Infra Infrastructure mode (uses access
Table of Contents Chapter 1 Introduction...1-1 Overvi
UC-7408 User’s Manual Getting Started 2-12 TurboRate—Enables or disables TurboRate Setting Explanation 0 disable 1 enable BGProtection—Sets 11b/11
UC-7408 User’s Manual Getting Started 2-13Test Program—Developing Hello.c In this section, we use the standard “Hello” programming example to illust
UC-7408 User’s Manual Getting Started 2-14Checking the Flash Memory Space If the flash memory is full, you will not be able to save data to the Flas
UC-7408 User’s Manual Getting Started 2-15NOTE Be sure to type the #make command from within the /tmp/example/hello directory, since UC’s tool chai
UC-7408 User’s Manual Getting Started 2-16RS-232 LANPC 2PC 1Write data to PC1Receive LAN dataRead serial dataSend data to PC2tcps2.cSerial RxBufferL
UC-7408 User’s Manual Getting Started 2-17 root@server11:/home/uc7400/1st_application [root@server11 1st_application]# pwd /home/uc7400/1st_applic
UC-7408 User’s Manual Getting Started 2-18 root@server11:/home/uc7400/1st_application [root@server11 1st_application]# ftp 192.168.3.127 Connected
UC-7408 User’s Manual Getting Started 2-194. The program should start running in the background. Use either the #jobs or #ps –ef command to check i
UC-7408 User’s Manual Getting Started 2-20 158 root 1532 S /sbin/getty 115200 ttyS1 162 root 3652 S /usr/sbin/sshd 163 root
UC-7408 User’s Manual Getting Started 2-21NOTE The tcps2.c application is a simple example designed to give users a basic understanding of the conc
Compiling tcps2.c... 2-16 Uploading tcps2-release a
33 Chapter 3 Managing Embedded Linux This chapter includes information about version control, deployment, updates, and peripherals. The informatio
UC-7408 User’s Manual Managing Embedded Linux 3-2System Version Information To determine the hardware capability of your UC-7408, and what kind of s
UC-7408 User’s Manual Managing Embedded Linux 3-3Since different Flash disks have different sizes, it’s a good idea to check the size of your Flash
UC-7408 User’s Manual Managing Embedded Linux 3-4local: UC7420-1.5.frm remote: UC7420-1.5.frm 200 Port command successful. 150 Opening data connecti
UC-7408 User’s Manual Managing Embedded Linux 3-5Loading Factory Defaults The easiest way to load factory defaults is to update the firmware (follow
UC-7408 User’s Manual Managing Embedded Linux 3-6Type the command “ps –ef” to list all processes currently running. 192.168.3.127 – PuTTY root@Mo
UC-7408 User’s Manual Managing Embedded Linux 3-7Then you will find the enabled daemons after you reboot the system. 192.168.3.127 – PuTTY root@M
UC-7408 User’s Manual Managing Embedded Linux 3-8Setting the Run-Level In this section, we outline the steps you should take to set the Linux run-le
UC-7408 User’s Manual Managing Embedded Linux 3-9Adjusting the System Time Setting the Time Manually UC-7408 has two time settings. One is the syste
UC-7408 User’s Manual Managing Embedded Linux 3-10NTP Client UC-7408 has a built-in NTP (Network Time Protocol) client that is used to initialize a
Network... A-1 Process...
UC-7408 User’s Manual Managing Embedded Linux 3-11Cron—daemon to Execute Scheduled Commands Start Cron from the directory /etc/rc.d/rc.local. It wil
44 Chapter 4 Managing Communications In this chapter, we explain how to configure UC-7408’s various communication functions. The following topics
UC-7408 User’s Manual Managing Communication 4-2Telnet / FTP In addition to supporting Telnet client/server and FTP client/server, the UC-7408 syste
UC-7408 User’s Manual Managing Communication 4-3Web Service—Apache The Apache web server’s main configuration file is /etc/apache/httpd.conf, with t
UC-7408 User’s Manual Managing Communication 4-4 To open the default CGI test script report page, type http://192.168.3.127/cgi-bin/test-cgi in you
UC-7408 User’s Manual Managing Communication 4-5Saving a Web Page to the CF Card Since some applications will have web pages that take up a lot of m
UC-7408 User’s Manual Managing Communication 4-6Step4: Open your browser and connect to the UC-7408 by typing the current LAN1 IP address in the bro
UC-7408 User’s Manual Managing Communication 4-7other computers that connect to this host can connect to the Internet when it the computer does not
UC-7408 User’s Manual Managing Communication 4-8UC-7408 supports the following sub-modules. Be sure to use the module that matches your application.
UC-7408 User’s Manual Managing Communication 4-9 Examples: # iptables -L -n In this example, since we do not use the -t parameter, the system uses
11 Chapter 1 Introduction Welcome to Moxa UC-7408, a data acquisition embedded computer that features 8 RS-232/422/485 serial ports, dual 10/100 M
UC-7408 User’s Manual Managing Communication 4-10Examples: Example 1: Accept all packets from lo interface. # iptables –A INPUT –i lo –j ACCEPT Exam
UC-7408 User’s Manual Managing Communication 4-11NAT Example The IP address of all packets leaving LAN1 are changed to 192.168.3.127 (you will need
UC-7408 User’s Manual Managing Communication 4-12/sbin/iptables -F -t nat /sbin/iptables -X -t nat /sbin/iptables -Z -t nat /sbin/iptables -P INP
UC-7408 User’s Manual Managing Communication 4-13Dial the modem, and then ... CONNECT Wait for an answer. “ “ Send a return (null text followed by t
UC-7408 User’s Manual Managing Communication 4-14lo Link encap Local Loopback inet addr 127.0.0.1 Bcast 127.255.255.255 Mask 255.0.0.0 UP L
UC-7408 User’s Manual Managing Communication 4-15The first star (*) lets everyone login. The second star (*) lets every host connect. The pair of do
UC-7408 User’s Manual Managing Communication 4-165. Edit the file /etc/ppp/pap-secrets and add the following: “[email protected]” * “password” *
UC-7408 User’s Manual Managing Communication 4-177. Add one of two files: /etc/ppp/options.ixp0 or /etc/ppp/options.ixp1. The choice depends on whi
UC-7408 User’s Manual Managing Communication 4-18NOTE Click on the following links for more information about NFS: http://www.tldp.org/HOWTO/NFS-HO
UC-7408 User’s Manual Managing Communication 4-19Example 2 /home/public 192.168.0.0/24(rw) *(ro) In this example, UC-7408 shares the directory /home
UC-7408 User’s Manual Introduction 1-2Overview UC-7408 data acquisition embedded computers are ideal for embedded applications. UC-7408 has 8 RS-232
UC-7408 User’s Manual Managing Communication 4-20To send an email message, use the ‘smtpclient’ utility, which uses SMTP protocol. Type #smtpclient
UC-7408 User’s Manual Managing Communication 4-21NOTE Click on the following links for more information about MIB II and RS-232 like group: http://
UC-7408 User’s Manual Managing Communication 4-222. Generate a preset shared key by typing the command: # openvpn --genkey --secret secrouter.key C
UC-7408 User’s Manual Managing Communication 4-23 if [ “$FOUND” = “no” ]; then modprobe $mname fi } start() { ifcfg_vpn if [ ! \( -d “/dev/n
UC-7408 User’s Manual Managing Communication 4-24 i=`expr $i + 1` if [ $i -ge $maxtap ]; then break fi done brctl delif br0 $iface b
UC-7408 User’s Manual Managing Communication 4-25#!/bin/sh # value after “-net” is the subnet behind the remote peer route add -net 192.168.2.0 netm
UC-7408 User’s Manual Managing Communication 4-26Setup 2: Ethernet Bridging for Private Networks on the Same Subnet 1. Set up four machines as show
UC-7408 User’s Manual Managing Communication 4-272. Create a configuration file named “A-tun.conf” and an executable script file named “A-tun.sh”.
55 Chapter 5 Programmer’s Guide This chapter includes important information for programmers. The following functions are covered in this chapter:
UC-7408 User’s Manual Programmer’s Guide 5-2Flash Memory Map Partition sizes are hard coded into the kernel binary. To change the partition sizes, y
UC-7408 User’s Manual Introduction 1-3Product Features y Intel XScale IXP422 266 MHz Processor y On-board 128 MB RAM, 32 MB Flash ROM y Eight RS-
UC-7408 User’s Manual Programmer’s Guide 5-3Obtaining help Use the Linux man utility to obtain help on many of the utilities provided by the tool ch
UC-7408 User’s Manual Programmer’s Guide 5-4Uninstalling the Linux Tool Chain Use the command rpm –qa|grep mxscaleb to query if the Moxa tool chain
UC-7408 User’s Manual Programmer’s Guide 5-5Debugging with GDB First compile the program must with option -ggdb. Use the following steps: 1. To deb
UC-7408 User’s Manual Programmer’s Guide 5-6Buzzer The device node is located at /dev/console. UC-7408 supports Linux standard buzzer control, with
UC-7408 User’s Manual Programmer’s Guide 5-7int swtd_enable(int fd, unsigned long time) Description Enable application sWatchDog. And you must do ac
UC-7408 User’s Manual Programmer’s Guide 5-8int swtd_ack(int fd) Description: Acknowledge sWatchDog. When the user application enable sWatchDog. It
UC-7408 User’s Manual Programmer’s Guide 5-9 swtd_close(fd); exit(0); } The makefile is shown below: all: mxscaleb-gcc –o xxxx xxxx.c –lmo
UC-7408 User’s Manual Programmer’s Guide 5-10 exit(1); } The makefile is shown below: all: mxscaleb-gcc –o xxxx xxxx.c –lmoxalib UART The no
UC-7408 User’s Manual Programmer’s Guide 5-11Example to get the baud rate #include <moxadevice.h> #include <termios.h> struct termios
UC-7408 User’s Manual Programmer’s Guide 5-12The definition for DIN and DOUT: #define DIO_HIGH 1 #define DIO_LOW 0 int set_dout_state(int dopor
UC-7408 User’s Manual Introduction 1-4Regulatory Approvals EMC: FCC Class A, CE Class A Safety: UL, CUL, TÜV Warranty 5 years Hardware Introduction
UC-7408 User’s Manual Programmer’s Guide 5-13duration - Not 0 > detect the din event DIN_EVENT_HIGH_TO_LOW or DIN_EVENT_LOW_TO_HIGH with duration
UC-7408 User’s Manual Programmer’s Guide 5-14#ifdef DEBUG #define dbg_printf(x...) printf(x) #else #define dbg_printf(x...) #endif #define MIN_DUR
UC-7408 User’s Manual Programmer’s Guide 5-15 } else if ( i == 5 ) { // set high data printf("Please keyin the DOUT number : ");
UC-7408 User’s Manual Programmer’s Guide 5-16#include <unistd.h> #include <pthread.h> #include <moxadevice.h> #ifdef DEBUG #defi
UC-7408 User’s Manual Programmer’s Guide 5-17 // configure the dout frequency. When the timer timeouts, dout_control() will be called to chang
UC-7408 User’s Manual Programmer’s Guide 5-18 act.sa_flags=0; sigemptyset(&act.sa_mask); sigaction(SIGALRM,&act,NULL); } int main(int arg
AA Appendix A System Commands Linux normal command utility collection File manager 1. cp copy file 2. ls list file 3. ln make
UC-7408 User’s Manual System Commands A-2Process 1. kill kill process 2. ps display now running process Other 1. dmesg dump kern
Comentários a estes Manuais