UC-7400-CE User’s Manual First Edition, March 2006 www.moxa.com/product Moxa Systems Co., Ltd. Tel: +886-2-8919-1711 Fax: +886-2-8919-1722 Web: www.moxa.com MOXA Technical Support support@moxa.com.tw Worldwide: The Americas support@moxa.
UC-7400-CE 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 of that agreement. Copyright Notice Copyright © 2006 Moxa Systems Co., Ltd. All rights reserved. Reproduction without permission is prohibited. Trademarks MOXA is a registered trademark of The Moxa Group. All other trademarks or registered marks in this manual belong to their respective manufacturers.
Table of Contents Chapter 1 Introduction ..................................................................................................1-1 Overview.................................................................................................................................. 1-2 Model Descriptions and Package Checklist ............................................................... 1-2 UC-7400 Product Features .........................................................................................
Example #2—Buzzer ............................................................................................................... 5-5 Example #3—Digital I/O......................................................................................................... 5-6 Example #4—LCM Display .................................................................................................... 5-8 Example #5—Function Keys .............................................................................................
1 Chapter 1 Introduction Microsoft® Windows® CE 5.0 is an open, scalable, 32-bit operating system (OS) that allows you to build a wide range of innovative, small footprint devices. A typical Windows® CE-based device is designed for a specific use, and often runs disconnected from other computers, or distributed as a front-end to a centralized host.
UC-7400-CE User’s Manual Introduction Overview The MOXA UC-7400-CE Series (herein after referred to as UC-7400-CE) includes UC-7420-CE, UC-7410-CE, and UC-7408-CE. These RISC-based ready-to-run embedded computers are ideal for embedded applications.
UC-7400-CE User’s Manual Introduction UC-7400 Product Features y y y y y y y y y y y y Intel XScale IXP-422 266 MHz Processor On-board 128 MB RAM, 32 MB Flash ROM Eight RS-232/422/485 serial ports 8 digital input channels and 8 digital output channels (UC-7408 only) Dual 10/100 Mbps Ethernet USB 2.0 host for mass storage devices (UC-7420 only) PCMCIA, wireless LAN expansion (supports 802.11b/802.
UC-7400-CE User’s Manual Introduction Product Hardware Specifications CPU RAM Flash LAN Serial Port Serial Protection Data Bits Stop Bits Parity Flow Control Speed Serial Console DI/DO USB 2.0 Hosts USB 1.1 Client PCMCIA Storage Expansion LCM Keypad Real Time Clock Buzzer Rest Button UC-7420 UC-7410 UC-7408 Intel XScale Intel XScale Intel XScale IXP-422 266MHz IXP-422 266MHz IXP-422 266MHz 128 MB 128 MB 128 MB 32 MB 32 MB 32 MB Auto-sensing 10/100 Mbps × 2 with built-in 1.
UC-7400-CE User’s Manual Introduction Applications Development Environment To make UC-7400-CE an easy-to-use programming environment, its Windows® CE environment provides the following common, popular application development features that make programming convenient and easy as in a PC environment. y y y y y y y C Libraries and Run-times - Compared to the C libraries and run-times used on a desktop PC running Windows®, the C libraries and run-times on a UC-7400-CE is a subset of the WIN32 APIs.
UC-7400-CE User’s Manual Introduction Supporting Servers and Daemons In addition to the development and communication capability, UC-7400-CE embeds the services and daemons as stated next. These common and easy-to-use application servers help users to migrate the UC-7400-CE embedded computer to the industrial communication application very easily and conveniently. y y y y Telnet Server - A sample server that allows remote administration through a standard telnet client.
UC-7400-CE User’s Manual Introduction Hive-Based Registry—Contrast to RAM-Based Registry The registry for the UC-7400-CE is a hive-based registry in contrast to a RAM-based registry. The hive-based registry stores registry data inside files, or hives, which can be kept on any file system. This removes the need for performing backup and restore on power off.
2 Chapter 2 Getting Started In this chapter, we explain how to operate a UC-7400-CE computer via a PC near you. For clarity, this PC is called a development workstation and the UC-7400-CE computer is called a target computer. In addition, manual steps are described to facilitate operations such as system time adjustment, troubleshooting network connectivity, etc.
UC-7400-CE User’s Manual Getting Started Starting Your UC-7400-CE Computer Connect the SG wire to the shielded contact located at the upper left corner of the target computer, and then power on it by connecting it to the power adaptor. It takes about 30 to 60 seconds for the system to boot up. Once the system is ready, the “Ready” LED will light up and stay on till you shutdown the computer.
UC-7400-CE User’s Manual Getting Started Normally, you are required to change them because they are located on a different local network from that of your development workstation. Without changes, you cannot connect to them directly. Use the netconfig utility to complete the task. Type netconfig -h to get help on this utility.
UC-7400-CE User’s Manual Getting Started User/Group Management User Group: You should assign specific services, such as ftp and telnet, to defined user groups such that these services are accessible only by the users within the permissible user group. Three user groups, namely “ftpd”, “telnetd”, and “httpd”, are already created by default for your convenience. Adding a Group: Use the command useradd –g to create a user group. \> useradd –g yyyy group yyyy has been added.
UC-7400-CE User’s Manual Getting Started Adjusting System Time and RTC Time The UC-7400-CE computer has two time settings, the system time (or CPU clock) and the RTC (Real Time Clock) time. The system time regulates the execution of instructions and the RTC keeps track of the time even when the computer is turned off. RTC time runs on a special battery that is not connected to the normal power supply. Do not confuse a computer's real-time clock with its CPU clock.
UC-7400-CE User’s Manual Getting Started Troubleshooting Network Connectivity The ipconfig tool prints the TCP/IP-related configuration data of a host including the IP addresses, gateway and DNS servers. \> ipconfig /all Windows IP configuration Ethernet adapter Local Area Connection: IP Address: 192.168.4.127 Subnet Mask: 255.255.255.
UC-7400-CE User’s Manual Getting Started To delete a routing item, \> route DELETE 192.168.0.0 Simple Network Management Protocol (SNMP) SNMP is the Internet Standard protocol for network management and part of the TCP/IP protocol suite. SNMP was developed to monitor and manage networks. It uses a distributed architecture that consists of agents and managers: SNMP agent The SNMP agent is an SNMP application that monitors network traffic and responds to queries from SNMP manager applications.
3 Chapter 3 Web-based Management System Note: Internet Explorer 5.5 and above is required to use the web based management system. The UC-7400-CE series ready-to-run embedded computers are network-centric platforms and are designed to serve as excellent front-ends for data acquisition and industrial control. Due to the distributed characteristics of the devices, that these computers control, they often reside in harsh areas as the devices themselves and are away from system administrators.
UC-7400-CE User’s Manual Web-based Management System System Information After you logon successfully, the main page displays the system information of the target UC-7400-CE computer, including the firmware version of the computer, the RTC time, the CPU system time, and system resources including main memory and file system usage (RAM and Flash). Networking/Server Configuration The UC-7400-CE computer has two network interfaces. To view or change their settings, click the Networking item on the menu bar.
UC-7400-CE User’s Manual Web-based Management System Launching Processes Automatically To have your application start on boot, do the following: Step 1: Click the “Processes” item on the main menu bar. At the lower part of the page, there is an area marked as “Automatic Launching”. Step 2: Fill in the full path of the application in the first text field and its arguments in a separate text field if there are any. Step 3: Click “Add”.
UC-7400-CE User’s Manual Web-based Management System Binary/Text File Management On a PC, it is certainly convenient to have a friendly window-based file manager to browse, delete, and organize files and directories. On the UC-7400-CE computer, such a convenient feature is simulated by the web-based management system. Just click “File Manager” to view the directory tree of your target UC-7400-CE computer.
4 Chapter 4 Application Development Application development on the UC-7400-CE computer is catered to by a number of well-known tools that are provided by the Windows® environment in programmers’ workstations. These tools are trouble-free to use for Windows® programmers. This chapter presents the development tools for Windows® Embedded Application Development. The following topics are covered in this chapter: Installation of Development Tools (IDEs) ¾ VB.
UC-7400-CE User’s Manual Application Development Installation of Development Tools (IDEs) Building applications for the UC-7400-CE computer can be done with a number of friendly Integrated Development Environments (IDE) tools. Choose the tools based on the application language you plan to use and install them onto your development workstation. VB.NET/C# Applications: Use Visual Studio 2005 Microsoft® Visual Studio 2005 is a complete set of development tools for building ASP.
UC-7400-CE User’s Manual Application Development If an error message appears, the appropriate versions of the application development tools required by the SDK are not installed. Choose Close to continue the installation process, even if you do not need these tools. Otherwise, cancel the process and download appropriate files from the Microsoft® site. For example, if a dialog like the following pops up, download two files from: Microsoft® .NET Framework Version 2.
UC-7400-CE User’s Manual Application Development Assuming that you have saved these two files as dotnetfx and setup, do the following to install the tools: y Execute the program “dotnetfx”. y Install .Net Framework by executing the program “setup”. Then, reinstall the MOXA SDK. Read the “License Agreement” dialog, and if you accept the terms of the end-user license agreement (EULA), choose Accept, and then click Next.
UC-7400-CE User’s Manual Application Development Type your name for User Name, and the name of your company for Organization. After that, click Next. To install all functionality provided with the SDK, click Complete and then click Next.
UC-7400-CE User’s Manual Application Development If you have a folder preference where you want the SDK to reside, click Change and browse to the folder. Otherwise, place it in the default folder. After that, click Next. To install the SDK, click Install.
UC-7400-CE User’s Manual Application Development Wait for the installation to be complete. Once the installation is complete, click Finish to close the installer. Steps to Develop Applications with IDEs Windows® CE 5.0 with the MOXA SDK you have just installed offers application developers the familiar Windows® IDE and application programming interface (API) with the versatility of scripting languages. We use eVC 4.0 and Visual Studio .
UC-7400-CE User’s Manual Application Development To develop an eMbedded Visual C++ 4.0 application with an imported SDK y y y Open Microsoft® eMbedded Visual C++ 4.0. From the File menu, choose New. Choose the Projects tab and then select the type of application that you want to build. y y Fill in the project name and click OK. Choose the type of application that you want to create and then click Finish.
UC-7400-CE User’s Manual y y Application Development From the Build toolbar, choose the SDK (UC7400CE1.0 in this example), the type of run-time image (Release or Debug), and the target device (UC7400CE1.0 Device in the example). Write your code. y y From the Build menu, choose Rebuild All to compile your application. Ignore the following dialog if it pops up. This is generated by ActiveSync while developing a mobile application. The UC-7400-CE computer is not a mobile device.
UC-7400-CE User’s Manual y y y y y Application Development Write your application code. From the Device toolbar, choose Windows CE.Net Device. From the Build menu, choose Build Project or Rebuild Project. When you complete your application, use the web-based management system to upload it to the target computer. Logon the target computer. At the console prompt, execute it directly if it is a C# one. Otherwise, if it is a VB script or java script, execute the via the program wcescript.exe.
5 Chapter 5 Programming Examples The following examples are designed to ease application development on the UC-7400-CE computer. Find and copy useful code segments to your C/C++ programs. In addition, to simplify application development with the eVC4.0 tool, we provide you with a device library (mxdev.lib). This library covers the APIs for the buzzer, LCM, function key, and digital I/O devices. To link the library with your eVC4.0 compilation environment, perform the following steps from your eVC4.
UC-7400-CE User’s Manual Programming Examples Example #1—MOXA UART Supporting RS-232/422/485 The following C/C++ code shows a sample application transmitting data from port “COM3” to port “COM4” using the RS-232 operation mode. After these ports have been opened, the application generates a thread to receive data from port “COM3” and then the application itself executes as a main thread to transmit data to port “COM4”. #include "stdafx.h" #include #include
UC-7400-CE User’s Manual Programming Examples CloseHandle(hCom); return NULL; } return hCom; } //================================================================= static DWORD comReadThread(LPVOID param) { HANDLE hCom = (HANDLE)param ; DWORD rtn; unsigned char buffer[MAX_DATA_LEN+1]; while(1) { if (ReadFile(hCom, buffer, MAX_DATA_LEN, &rtn, NULL)==0) { printf("read data fail\n"); return 0; } buffer[rtn] = '\0'; printf("Data = %s\n", buffer); } CloseHandle(hCom); } int comPair(WCHAR *wComPort, WCHAR *rComP
UC-7400-CE User’s Manual Programming Examples rCom = createComHandle(sPort, baudrate); if (rCom == NULL) { printf("Fail to create read port\n"); CloseHandle(wCom); return 2; } /* for a thread to handle receiving */ if (CreateThread( NULL, 0, comReadThread, (LPDWORD) rCom, NULL, 0 )==NULL) { printf("Fail to create a receiving thread\n"); CloseHandle(wCom); CloseHandle(rCom); return 3; } for (i=0; i< MAX_DATA_LEN;i++) buffer[i] = (unsigned char) ('a'+i%26); PurgeComm(wCom,PURGE_TXCLEAR | PURGE_TXABORT); whi
UC-7400-CE User’s Manual Programming Examples Windows® API function CreateFile(…) opens a named file corresponding to a serial port. For any serial port from “COM10” or after, the file name must be prefixed by “$device\\”. For “COM1” to “COM9”, the name can be either prefixed by “$device\\” or not. API function GetCommState(..) is the standard function to get the current parameters of a serial port, including its baudrate, data bits (bytesize),parity and stop bits.
UC-7400-CE User’s Manual Programming Examples Example #3—Digital I/O The UC-7408-CE computer supports 8 programmable digital input channels and 8 programmable digital output channels for your applications. These IO channels can be accessed at run-time via the following APIs. /* this function initialize a connection to the devices. It must be called before you call other functions On success, it returns a handle.
UC-7400-CE User’s Manual Programming Examples /* this function gets the current digit level of a specified port handle created by mxdio_init port number 0~7 Return DIN_EVENT_LOW_TO_HIGH or DIN_EVENT_HIGH _TO _LOW (0 or 1) */ int mxdio_get_dout(HANDLE hndl, unsigned int port); To use the library mxdev.lib, include file moxa/devices.h in your program. The following example shows a simple mechanism to use the library. #include
UC-7400-CE User’s Manual Programming Examples Example #4—LCM Display Every UC-7420-CE and UC-7410-CE computer is equipped with LCM hardware with a display area of 8x16. This device offers a simple eye-catching interface for your applications. An internal service is pre-installed to manage a set of English text fonts for your applications. As an example, the following program transmits text to the service. #include #include
UC-7400-CE User’s Manual Programming Examples /* write text to the LCM device at a specify coordinate the open handle text the length of the text and pointers to the coordinate of the starting position of the text, the function would output the ending coordinate of the text to these pointers.
UC-7400-CE User’s Manual Programming Examples All you need to do is register your callback function to an associated keypad with the function in the format (unsigned int key, void* param). The argument param is used to transfer your private data to the callback function. #include #include
A Appendix A Operating Programmable Function Keys and LCM Notice: Only UC-7420 and UC-7410 support LCM and Keypad functions In this appendix, we show you an internal service that is built around function keys. This mechanism is designed to aid your applications to access these I/Os without being aware of the complexity of I/O controls. Though this service gains controls on these programmable I/Os, it does not prevent you from developing on them.
UC-7400-CE User’s Manual Operating Programmable Function Keys and LCM To assist you in using this function key service for I/Os, the web-based management system also implements a utility to configure action items. To configure a plain text item, please follow the steps: Step 1: Logon the web-based management system and select the “keypad-LCM” in the function area. The browser opens a page which shows five current sets of action items.
B Appendix B Firmware Upgrade Procedure To upgrade the UC-7400-CE firmware, you can use the upfirm utility. This utility on the software CD; you can also download it from the MOXA Download Center, URL is listed below. MOXA Download Center http://web4.moxa.com/support/download_center.asp For firmware upgrade procedure, please refer to the following steps. 1. 2. 3.
UC-7400-CE User’s Manual Firmware Upgrade Procedure 4. Navigate to the path of the firmware file. The default “path\filename” is “\USBDisk\UCV1.0.bin”. Make sure you select the correct target path and actual file name. For example, the new firmware file “nk7420.bin” is put under root path”\”, enter the entire path\filename and press “ENTER” to begin upgrade the firmware. 5. Wait for the upgrade to complete; it will take about 5 minutes to finish it.
UC-7400-CE User’s Manual Firmware Upgrade Procedure 6. Next, press “Y” to reboot the target UC-7400-CE. 7. After system restart, you will find the new firmware ready and running.
C Appendix C Service Information This appendix shows you how to contact MOXA for information about this and other products, and how to report problems. The following topics are covered in this appendix.
UC-7400-CE User’s Manual Service Information MOXA Internet Services Customer satisfaction is our primary concern. To ensure that customers receive the full benefit of our products, MOXA Internet Services has been set up to provide technical support, driver updates, product information, and user’s manual updates. The following services are provided E-mail for technical support...….............................support@moxa.com.tw World Wide Web (WWW) Site for product information: ...........................
UC-7400-CE User’s Manual Service Information Problem Report Form MOXA UC-7400-CE Series Customer name: Company: Tel: Fax: Email: Date: 1. Moxa Product: UC-7420-CE 2. Serial Number: UC-7410-CE UC-7408-CE _________________ Problem Description: Please describe the symptoms of the problem as clearly as possible, including any error messages you see. A clearly written description of the problem will allow us to reproduce the symptoms, and expedite the repair of your product.
UC-7400-CE User’s Manual Service Information Product Return Procedure For product repair, exchange, or refund, the customer must: Provide evidence of original purchase. Obtain a Product Return Agreement (PRA) from the sales representative or dealer. Fill out the Problem Report Form (PRF). Include as much detail as possible for a shorter product repair time. Carefully pack the product in an anti-static package, and send it, pre-paid, to the dealer.