Programmer’s Guide for Moxa’s Windows CE Embedded Computers Third Edition, March 2008 www.moxa.com/product © 2008 Moxa Inc., all rights reserved.
Windows CE Programmer’s Guide Installing Development Tools 1-7http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15
Windows CE Programmer’s Guide Installing Development Tools 1-82. Type your name for User Name, and the name of your company for Organization. Click
Windows CE Programmer’s Guide Installing Development Tools 1-94. To change the name of the folder in which the SDK will reside, click Change and br
Windows CE Programmer’s Guide Installing Development Tools 1-106. Wait patiently while the software is installed. 7. When the installation is com
22 Chapter 2 Application Development Application developers that are familiar with Windows® IDE tools and application programming interfaces (API
Windows CE Programmer’s Guide Application Development 2-2Developing an Application with Visual Studio 2005 • Open Microsoft® Visual Studio .Net 200
Windows CE Programmer’s Guide Application Development 2-3 6. Click Device Option. 7. Click Properties….
Windows CE Programmer’s Guide Application Development 2-48. Click Configure…. 9. Click the Use specific IP Address radio button and enter the net
Windows CE Programmer’s Guide Application Development 2-511. Wait for the connection to be made. 12. You may now start the debugging process. Dev
Windows CE Programmer’s Guide Application Development 2-65. Choose the type of application that you would like to create and then click Finish. 6.
Programmer’s Guide for Moxa’s Windows CE Embedded Computers The software described in this manual is furnished under a license agreement and may be
Windows CE Programmer’s Guide Application Development 2-77. Write your code. 8. From the Build menu, choose Rebuild All to compile your applicatio
Windows CE Programmer’s Guide Application Development 2-85. Back to eMbedded Visual C++ 4.0 and open or create a project. 6. Select the right SDK
Windows CE Programmer’s Guide Application Development 2-910. Paste the copied string to the Telnet window, and then press Enter. 11. Return to th
33 Chapter 3 Programming Examples In this chapter, we present Before You Begin Programming ¾ Understanding the File System ¾ Use the Flash Memo
Windows CE Programmer’s Guide Programming Examples 3-2Before You Begin Programming Understanding the File System Before you begin programming your e
Windows CE Programmer’s Guide Programming Examples 3-3Storing Data in RAM vs. Flash Memory Although data saved in RAM will be deleted when the syste
Windows CE Programmer’s Guide Programming Examples 3-4NOTE The programming examples for Moxa embedded computers are frequently updated. The latest e
Windows CE Programmer’s Guide Programming Examples 3-5OPEN_EXISTING, 0, IntPtr.Zero); if (comPort == INVALID_HANDLE_VALUE) return false; int nBytes
Windows CE Programmer’s Guide Programming Examples 3-6 private void ErrorEvent(object sender, SerialErrorReceivedEventArgs e) { Console.WriteLine(“e
Windows CE Programmer’s Guide Programming Examples 3-7 using System; using System.Collections.Generic; using System.Text; using moxa; namespace tes
Table of Contents Chapter 1 Installing Development Tools ...1-1 Visual Studio 200
Windows CE Programmer’s Guide Programming Examples 3-8sdout = System.Console.ReadLine(); port = int.Parse(sdout); System.Console.Write(“DOut value=
Windows CE Programmer’s Guide Programming Examples 3-9C# Example—Function Keys (UC-7410-CE, UC-7420-CE) For embedded computers with programmable fun
Windows CE Programmer’s Guide Programming Examples 3-10{ // close function key object fkey[i].stop(); } } ~Program() { System.Console.WriteLine(“~P
Windows CE Programmer’s Guide Programming Examples 3-11try { if (args.Length == 0) { System.Console.WriteLine(“e.g. tcpsvr [port]\n”); return; } //
Windows CE Programmer’s Guide Programming Examples 3-12C# Example—TCP Client using System; using System.Collections.Generic; using System.Text; usin
Windows CE Programmer’s Guide Programming Examples 3-13myNetworkStream.Write(myReadBuffer, 0, myReadBuffer.Length); } } // Close the NetworkStream m
Windows CE Programmer’s Guide Programming Examples 3-14C++ Example—Moxa UART (RS-232/422/485) The following C/C++ code shows a sample application th
Windows CE Programmer’s Guide Programming Examples 3-15} CloseHandle(hCom); } int comPair(WCHAR *wComPort, WCHAR *rComPort, unsigned int baudrate) {
Windows CE Programmer’s Guide Programming Examples 3-16Windows® API function CreateFile(...) opens a named file corresponding to a serial port. For
Windows CE Programmer’s Guide Programming Examples 3-17returns 0. <hndl> handle created by mxdio_init <port> port number 0~7 <handler
11 Chapter 1 Installing Development Tools A number of well-known Integrated Development Environments (IDE) tools can be used to ease the developme
Windows CE Programmer’s Guide Programming Examples 3-18In the example shown above, the dispatcher checks digit level changes every 20 milliseconds a
Windows CE Programmer’s Guide Programming Examples 3-19C++ Example—Function Keys (UC-7410-CE, UC-7420-CE) For embedded computers with programmable f
Windows CE Programmer’s Guide Programming Examples 3-20hEvent = CreateEvent( NULL, FALSE, FALSE, NULL ); WaitForSingleObject( hEvent,20000 ); mxfkey
Windows CE Programmer’s Guide Programming Examples 3-21global_t global; #ifndef _WIN32_WCE /* --------- client program -------------------- */ stat
Windows CE Programmer’s Guide Programming Examples 3-22argv: <host> <port>... */ void clients_post_init(int argc, char **argv, HINFO *ho
Windows CE Programmer’s Guide Programming Examples 3-23#endif unsigned int lookup_ip (const char *host) { struct hostent *he; unsigned int ip; ip
Windows CE Programmer’s Guide Programming Examples 3-24return f; } /* bind a socket on a specific interface */ static int bind_interface (int fd,
Windows CE Programmer’s Guide Programming Examples 3-25if (bind_interface (sockfd, iface, port) == -1) return 0; if (listen (sockfd, 5) < 0) retu
Windows CE Programmer’s Guide Programming Examples 3-26p = cmdline; argc=1; while (argc < 32) { while(isspace(*p)) p++; if (*p==0) break; argv[
Windows CE Programmer’s Guide Programming Examples 3-27 /* handle connection requests */ for (i = 0; i < global.server_num; i++) { fd = global.s
Windows CE Programmer’s Guide Installing Development Tools 1-2Visual Studio 2005 Microsoft® Visual Studio 2005 is a complete set of development tool
Windows CE Programmer’s Guide Programming Examples 3-28 while (TRUE) { // waiting for data goes into the Message Queue switch ( WaitForSin
Windows CE Programmer’s Guide Programming Examples 3-29 // close message queue CloseMsgQueue(hTask); return 0; } int getRand(int nID) { Enter
AA Appendix A Frequently Asked Questions Q: I have an eVB3.0 program. Can I run it on the embedded computer? A: The old version of Embedded Window
Windows CE Programmer’s Guide Frequently Asked Questions A-2Q: What is the Moxa WinCE SDK? What can I do with it? A: This SDK allows you to write pr
Windows CE Programmer’s Guide Installing Development Tools 1-32. Click Remove to confirm that you would like to remove the software. 3. Wait pati
Windows CE Programmer’s Guide Installing Development Tools 1-4Installing the .Net Compact Framework 2.0 with Service Pack 1. Wait while the Windo
Windows CE Programmer’s Guide Installing Development Tools 1-54. Select Complete and click Next to proceed. 5. Click Install to begin installing
Windows CE Programmer’s Guide Installing Development Tools 1-67. Click Finish to complete the installation procedure. eMbedded Visual C++ (eVC) 4.
Comments to this Manuals