Home
Microsoft Windows Embedded CE Touch Controller User`s Manual
Contents
1. ee eee eere nene 27 lnstalling Visual Studio 2008 vetri ner ore REA e RECHNER EIU ERE 27 Installing the CUWIN Software Development Kit SDK seeeeeeeeeeeeerenenn 32 Creating OUPPIESEOGUVWINTFOGESETEos o e teosttoteai xenon E um ubM E eun Epit maed Urso DU eun ud 37 Interfacing the CUWIN to Other Devices eee eeusee 45 poo MP 45 Vninedodhe Gc DWINS Sela FOL sacs iet dub iode peri Hire testen ietti tre mee HE MEE 45 Reading from the CUWIN s Serial POM sosna aa EEE EEEE 54 MODUS ec 58 Using Modbus to Interface the CUWIN to the CUBLOXC 1 esses eene 59 SEUNG UOTE B2B DENM Dm 62 Programming the CUWIN scccccseccccecccssececssesessseesssueesseueessaeeesseeeessueeessueeesaueeesausessaesessaaess 64 Comfile Technology Inc CUWIN User s Manual 2 of 72 Preface This document was created to help our customers quickly explore and enjoy the CUWIN without having to spend much effort reading documentation and experimenting beforehand This document will help users connect the CUWIN to a PC transfer files to and from the CUWIN and a PC program the CUWIN and interface the CUWIN to other digital devices like the CUBLOC The exercises in this document will make use of Visual Studio 2008 the C programming language and the Net Compact Framework but the CUWIN can be programmed in any programmi
2. Comfile Technology Inc CUWIN User s Manual 47 of 72 Properties Formi System Windows Forms Form ki DataBindings Activated Click Closed cosa a Deactivate b Doubleclick EnabledChanged GotFocus HelpRequested v Closing Occurs whenever the user clases the Form before the Farm has been closed 5 Go back to the Form1 cs Design tab Select the form and in the Properties window click the lightning bolt icon This will display all of the events that you can attach event handlers to Double click the Closing event and a Forml_Closing event handler will be created private void Forml Closing object sender CancelEventArgs e Close the serial port _port Close 6 Add code to this event handler exactly as pictured above private void buttonl1 Click object sender EventArgs e Send Hello to HyperTerminal _port Write Hello r n 7 Go back to the Form1 cs Design tab and double click the Say Hello button This will add a buttonl_Click event handler Add code to this event handler exactly as pictured above Comfile Technology Inc CUWIN User s Manual 48 of 72 HelloHyperTerminal Formi cs Formi cs Design Start Page rx Application Build Deployment Options Build Events oes Target device Debug CUWINZ450 ARMY4 Device v 9WCSIDL PROGRAM FILES HelloHyperTerminal lal Reference Paths C Deploy the latest version of the NET Compact F
3. CUWIN Microsoft Windows Embedded CE Touch Controller Windows Embedded CE 6 0 User s Manual 2011 12 13 Everything for Embedded Control COMPILE TECHNOLOGY Comfile Technology Inc www cubloc com Copyright 1996 2010 Comfile Technology Comfile Technology Inc CUWIN User s Manual 1 of 72 Table Of Contents m citn ert esa cess eaesten soy ai deue det duct saaaiune scinsaeorueceanes acd antwanksn secaseesdenadesegueueunesastunece 3 NV CM c 4 Powering On the CUWIN for the First Time ss 6 Setting the CUWIN s Operating MOde ccccccsecccceseeeceeceeseeeeceeeeeseeeeeseeeesseusesseueesseeessneeesaaeees 6 POWERING OM THe GU WIN sudden idt oed pete eese be encore eng ae d e d e td rtt vare lie ru 7 Connecting the CUWIN to a Personal Computer PC 9 installing the USB Driver WIDOOWS T sssecstesscnzidexe desi dest dec dev Gn a CLA EREMO RT NO Doe BS 9 Installing the USB Driver Windows XP ccccccceeecseecceeeceeeeeeeseeeseeeeeeeseueeeueesaeeseeeseueeseeeseeetans 9 PAGCUVESYV IC QVIDdOWSUSP s dioiiexivod ivre ER PG en Ee etus v Det ato em par t a o etd ar e t 13 Windows Mobile Device Center Windows Vista 7 cccssccccseeeeceeeeeseeeeeseeeesseeeesseeeesseeeesaeees 21 Developing Software for the CUWIN
4. Click Next to install to this Folder ar click Change to install to a different Folder Install Microsoft Activesyne 4 5 bo CiProgram Files Microsoft ActiveSync volume Disk Size Available Required Differences EC 3906 3606 34MEB 366 7 On the Destination Folder dialog accept the default or change the destination folder Then click the Next button Comfile Technology Inc CUWIN User s Manual 15 of 72 i Microsoft ActiveSync 4 5 Ready to Install the Program The wizard is ready to begin installation Setup is ready to begin installing Microsoft ActiveSync 4 5 8 A dialog will appear telling you that you are ready to install the program Click the Install button i Microsoft ActiveSync 4 5 Installing Microsoft ActiveSync 4 5 The program Features vou selected are being installed Please wait while the Setup Wizard installs Microsoft ActiveSync 4 5 This may take several minutes Status Writing system registry values 9 A new dialog with a progress bar will then appear showing the status of the installation Wait for it to complete Comfile Technology Inc CUWIN User s Manual 16 of 72 ig Microsoft ActiveSync 4 5 Microsoft ActiveSync 4 5 Setup is complete The Setup Wizard has successfully installed Microsoft ActiveSync 4 5 Click Finish to exit the wizard 10 When installation is complete a dialog will appear saying Microsoft ActivSync 4 5
5. Ctl H Del CtilH Space CtrloH Emulation Backscroll buffer lines Play sound when connecting or disconnecting Input Translation ASCII Setup 1 In HyperTerminal with the CUWIN connection open select File 2 Properties from the menu The CUWIN Properties dialog will appear On the Settngs tab click the ASCII Settup button Comfile Technology Inc CUWIN User s Manual 55 of 72 ASCII Setup ASCII Sending Send line ends with line feeds Line delay rollizecords Character delay milizeconds ASCII Receiving _ Append line feeds to incoming line ends Force incoming data to 7 bit ASCII wrap lines that exceed terminal width 2 Check the Echo typed characters locally checkbox This will ensure that as we type in HyperTerminal our keystrokes will appear on the screen Click the OK button then click the OK button on the CUWIN Properties dialog amp CUWIN HyperTerminal Sele File Edit view Call Transfer Help Connected 0 00 41 uto detect 19200 8 N 1 3 Hyperterminal will not accept keyboard input until the Scroll Lock is turned off Press the Scroll Lock key on your keyboard until the status bar shows Scroll in gray disabled Now if we type in HyperTerminal what we type will display on the screen and will be sent to the CUWIN Running the Program We are now ready to run the program 1 Once again execute the C
6. _evt WaitOne and examine the response If the response frame s data is 0 then the LED is off and this method will return false Otherwise the LED is on and this method will return true Comfile Technology Inc CUWIN User s Manual 68 of 72 If turnOn is true turn on LED Otherwise turn off LED private void ChangeLEDState bool turnOn slave address 0x01 function code 0x05 write bit register address 0x00 0x00 On or Off OxFF 0x00 on 0x00 0x00 Off crc 0x8C Ox3A on OxCD OxCA off byte request if turnon request new byte 0x01 0x05 0x00 0x00 OxFF 0x00 Ox8C Ox3A else request new byte 0x01 0x05 0x00 0x00 0x00 0x00 OxCD OxCA send request _port Write request 0 request Length Wait for a response _evt WaitOne evt Reset 7 Add a function called ChangeLEDState that sends a Modbus frame to the CUBLOC to turn the LED on or off and waits for a response frame from the CUBLOC _evt WaitOne The response frame from the CUBLOC is not needed so it is ignored Comfile Technology Inc CUWIN User s Manual 69 of 72 private void buttonl1 Click object sender EventArgs e Is LED on or off bool isOn ReadLEDState Toggle LED ChangeLEDState isOn Confirm Is LED on or off isOn ReadLEDState Update label if isOn labell Text On else labell Text Off 8 We now have functions f
7. right hand corner of the screen Comfile Technology Inc CUWIN User s Manual 41 of 72 HelloWorld Microsoft Visual Studio File Edit view Project Build Debug Data Tools Test Window Help v Any CPU Solution Helloworld d project J qi HelloWorld H md Properties H E References amp E Formi cs o Program cs Properties x GenerateMember True Location 70 265 Locked False Modifiers Private Size 497 123 TabIndex 0 TabStop True Tag Say Hello Visible True mainMenut The text contained in the control 11 In the Properties Window change the Text property to Say Hello and press the Enter key You ll see the button s label change to Say Hello Formi cs m Formi cs s Design Start Page a i o eene ra Formi bal gi button _Clickfobject sender EvenkArgs e bal ig using System using System Ling i 3 using System Collections Generic 4 using System CcComponentModel 5 using System Data 5i using System Drawing 7 using System Text E 8 using System Windows Forms 7 a IH mda HelloWorld 11 12 13 Pee HP PB M c m in b Mone void buttonl Click object sender EventArgs ej p B He o MessageBox Show Hello p Di G DO B M partial clase Formi i Form nae Formi ii J Initializecomponenti bo E 12 Now double click on the button and you will be taken to the button
8. HelloHyperTerminal 1 project wg HelloHyperTerminal Sa Properties 3 References EE Formt cs E Form Designer cs 1 Formi resx aay a d B 4 3575 gt Debug Any CPU 2 QF m x Boe CUWIN2450 ARMY4I Device 3 fal EH 4E ONCNE RUN TN j 3 A 7 X Start Page Formi cs Formi cs Design HelloHyperTerminal X Solution Explorer HelloHyperT M X E mM E o e00000000400000000000000000000000000060000000000000000000000000000000000000000000000000000000000 0000008 g peoensuesesessootesncsnboutesceqooonssessossssoenine nbonsescoensnsbomsnsensooensvetoseoseseoszesesoets a ao in H Program cs g padannntebe Gent cnnshdnbeedesinnansabnetsoeedshinnshtabtpeatinhshsehestsoostaniassaboeteiabiabsesainett O IONOISDRRUIURRINNRDOH UNDO SERES REVUDUUNDUROEKUNUORUIPONUUPIENUPSUUSST g lt gt Properties Ix labeli System Windows Forms Label es ll al Font Tahoma 10pt Say Hella ForeColor Bl controlText y GenerateMember True Location 176 93 Locked False Modifiers Private Size 421 20 Tag s Text PC v lt gt TextAlign TopLeft v Command Window 4X Text gt The text contained in the control de Error List 5 Command Window Ready l Add a Label from the Toolbox to the form and label it PC by changing its Text property private void Forml Load object sender EventArgs e Eon i h owe nie lbore Conley Com pore 19200 Baud Rate popa oe Parity F Data Bales COP
9. To configure the CUWIN to automatically start a program when the system boots create a folder the folder Flash Disk AutoRun and copy the exe file to execute into that folder Then configure the device for AutoRun mode by setting DIP switch positions 1 and 2 to ON and positions 3 through 6 Off Comfile Technology Inc CUWIN User s Manual 6 of 72 Powering On the CUWIN Now that the CUWIN s operating mode has been set we are ready to power on the CUWIN for the first time It is not necessary to make any connections to the CUWIN except the power cable Connect the power cable and power on the CUWIN by depressing the power switch Comfile Technology Inc CUWIN User s Manual 7 of 72 t My Device Internet Explorer d MaclUtil e Media Player SaveRegs Dem y Windows Embedded CE 6 C F Qi gt 5 04 PM Gls After a few seconds the Windows Embedded CE desktop will appear To complete the exercises in this document it is not necessary to understand each of these features For now a simple overview will suffice Item Description 1 My Device Opens the file explorer 2 Recycle Bin Storage for deleted files before permanent deletion 3 Internet Explorer Internet browser 4 MacUtil Utility to change the Network Interface Card NIC s Media Access Control MAC address 5 Media Player Windows CE Media player for playing audio and video files 6 S
10. Tools Browse aw Ic Visual C Run Time Libraries E Ia Visual C Class amp Template Librarie a IT Visual Basic Disk space requirements acr Smart Device Programmability Volume Disk Size Available Required Remaining NU Visual Studio Tools for Office C 400GB 76 6 GB 40GB PEGE wes Visual Web Developer wa Dotfuscator Community Edition su Mick Tools for Redistibuting Applications fe ce Unit Testing Tools mez Microsoft SOL Server 2005 Express Edit m ah nm m LI m T os me a7 ill gt Restore Defaults Install 7 n order to program for the Net Compact Framework you must choose the Smart Device Programmability option And since we will be programming in C be sure to check the Visual C option Then click the Install button LO Microsoft Visual Studio 2008 Setup Install Page Microsoft Visual Studio 2008 Setup Installing Components Enable great Web experiences that Microsoft NET Framework 3 5 have AJAX support Microsoft Document Explorer 2008 c Web developers can quickly Microsoft Visual Studia Web Authoring build applications that have FPE TE broadest possible reach and a Micrasaft Visual Studia 2008 rich browser based client Microsoft MET Compact Framework 2 0 experience SP2 Expressive and standards Microsoft NET Compact Framework 3 5 compliant Microsoft Visual Studia Tools for the Better collaboration between Microsoft Office system version 3 0 designer and de
11. che dec CR RIP CUWIN2450 ARMV4I Device gt 95 fal E l2 m zoo al J j du j xb X Formi cs Formi cs Design Start Page x Solution Explorer HelloHyperT M X 3 k i s E El S Lax Solution HelloHyperTerminal 1 project 43 HelloHyperTerminal Sa Properties 3j References E5 Form1 cs 3 Form Designer cs 3 Form resx c Program cs lt gt Properties lx button1 System Windows Forms Button 1 i Sele ForeColor ControlText i GenerateMember True q EM d Location 94 294 Locked False Modifiers Private Size 427 116 z TabIndex 0 TabStop True Error List Ix Tag Description File Line Column Project Uses The text contained in the control Ready 3 Add a large button to the form and label it Say Hello just as we did for the HelloWorld project using System using System ComponentModel using System Windows Forms using System IO Ports namespace HelloHyperTerminal puysuaeso cub ad ecce cmd o i public Formi i InitializeComponent private SerialPort port private void Forml Load object sender EventArgs e port new SerialPort Com1 Com port 19200 Baud Rate Parity None Parity 8 Data Bits StopBits One Stop Bits _port Open i 4 Double click in any blank space on the form and Visual Studio will create a Form1_OnLoad event handler for you Add code to this event handler exactly as pictured above
12. the Formi Closing event handler This event handler closes the CUWIN s serial port Comfile Technology Inc CUWIN User s Manual 71 of 72 Running the Program We are now ready to run the program 1 Execute the CUWIN program from Visual Studio ag d a ae a 3 4 hu l mo HM pa fee Gag I Sie mE _ L a emo STUDY BOARD 1 a n B m id d az d bh E wv d a hk k b ms n m p m h b BH H H NH VF B B h B b yp wu mr b w m w mm m 2 When the form loads you will see the LED State label update to the current state of the LED When you click the Toggle button the LED s state will change and the LED State label will update accordingly Final Thoughts In an effort to keep this exercise simple for the purpose of learning we have made several concessions To name a few we are not generating the request frame s CRC dynamically we are not checking the response frame s CRC for transmission integrity and we are waiting indefinitely for a response after issuing a request Please keep this in mind as you explore the design of your own programs Comfile Technology Inc CUWIN User s Manual 72 of 72
13. turn the LED on if the LED was off or off if the LED was On Comfile Technology Inc CUWIN User s Manual 59 of 72 The following Modbus frames are listed here to help you understand the exercise to follow To keep this exercise simple for the purpose of learning we will hard code these frames in our program Reading the State of the LED To ask the CUBLOC what the state of the LED is we issue the following Modbus frame Value Description Ox01 Slave Address 1 0x02 Read Bit 0x0000 Register Address O Port 0 0x0001 Read only 1 bit OxB9CA CRC If the LED is off the CUBLOC will respond with the following Modbus frame Value Description 0x01 Slave Address 1 0x02 Read Bit 0x01 1 Bit Read 0x00 LED is off 0xA188 CRC If the LED is on the CUBLOC will respond with the following Modbus frame Value Description 0x01 Slave Address 1 0x02 Read Bit 0x00 1 Bit Read 0x01 LED is on 0x6048 CRC Comfile Technology Inc CUWIN User s Manual 60 of 72 Turning the LED On To have the CUBLOC turn the LED on we issue the following Modbus frame Value Description 0x01 Slave Address 1 0x05 Write bit 0x0000 Register Address O Port 0 OxFFOO Turn the LED on Ox8C3A CRC The CUBLOC will respond with the following Modbus frame an echo of the request Value Description Ox01 Slave Ad
14. 10 17 55 00 Z Learn about common obfuscation techniques For NET applications Parallel Programming in NET Framework 4 Getting Started Wed 02 Jun 2010 17 45 00 Z An easy introduction to the new Task Parallel Library learn how to parallelize a long running console application and add a responsive WPF UI Back to Basics Tips for greater developer productivity Thu 20 May 2010 16 55 00 Z Let s take a look at some of the default behavior in Visual Studio and the quickest path to modifying those defaults to suit your standards New IDE Features in isual Studio 2010 for C Developers Wed 12 May 2010 19 15 00 2 An overview of the new C IDE features in Visual Studio 2010 Call Hierarchy Mavigate To Highlight References Generate Fram I Izane and TntelliSence iranrnvement lt v 3 Visual Studio will open to the Start Page Now we need to create a project Start Page Microsoft Visual Studio Edit Save All Export Template Page Setup Print Exit View Tools Test Window Help Project Ctrl Shift y Web Site File Project From Ctrl Shirk 5 Ctrl F 4 Select File gt New gt Project from the menu ShiFE Alc M Ctrl h Existing Cade C 4 0 the Dynamic E Fri 18 Jun 2010 17 35 01 programmer who struggle objects that are beyond the burden by going dyn Featured Resour
15. CRC to verify the integrity of the transmission The ASCII format encodes each fram as a set of ASCII characters and uses a Longitudinal Redundancy Check LRC to verify the integrity of the transmission Modubus request frames vary but typically they contain the following 1 Slave Address The address of the slave device the request is intended for 2 Function Code The function to performed on the slave device read write etc 3 Data Information needed to perform the given function 4 Error Code CRC for RTU or LRC for ASCII to verify the transmission integrity Modbus reply frames also vary but typically they contain the following 1 Slave Address The address of slave device the reply is from 2 Function Code The function performed by the slave device 3 Data Information about the function performed 4 Error Code CRC for RTU or LRC for ASCII to verify the transmission integrity This very brief introduction to Modbus is all that is needed to understand the exercises to follow It is out of the scope of this document to explain Modbus in detail so to learn more please see The Modbus Organization Comfile Technology Inc CUWIN User s Manual 58 of 72 Using Modbus to Interface the CUWIN to the CUBLOC In this exercise we will interface the CUWIN to a CUBLOC to toggle an LED on and off First the CUWIN must ask the CUBLOC if the LED is on or off What s Your Status Then the CUWIN will tell the CUBLOC to
16. EI E Ome i ey s ODE S Listen for incoming data _port DataReceived new SerialDataReceivedEventHandler _port_DataReceived HOt Coen void _port_DataReceived object sender SerialDataReceivedEventArgs e Update labell with the data read string dataRead port ReadExisting labell Invoke new Action gt labell Text dataRead 2 Go to the Form cs tab and add the port DataReceived event handler exactly as pictured above Comfile Technology Inc CUWIN User s Manual 54 of 72 How the Code Works 1 When data is received on the CUWIN s serial port the DataReceived event is fired which executes the port DataRecieved event handler 2 Inthe port DataRecieved event handler we read the data from the CUWIN s serial port and append the data to the PC label NOTE The Invoke method is necessary because the port DataRecieved event handler will be running on a different thread than the one used to create the label Also the code inside the Invoke method is a lambda expression which is new to CZ 3 0 See the Microsoft Development Network MSDN documentation for Control I nvoke and Lambda Expressions for more information Configuring HyperTerminal to Accept Keystrokes Now we must configure HyperTerminal to accept keystrokes show them on the screen and send them to the CUWIN CUWIM Properties Connect Ta Settings Function arrow and ctrl keys act as C Windows keys Backspace key sends
17. Setup is complete Click the Finish button File View Tools Help show Details L ActiveSync is now installed and you should see the ActiveSync icon in your system tray If you double click the system tray icon the ActiveSync window will display showing a status of Not Connected Comfile Technology Inc CUWIN User s Manual 17 of 72 12 Using a USB cable connect the CUWIN to the PC pr User Authenticated Hide this message Cancel connection 13 You will probably hear a few sounds from the PC and the CUWIN and a small dialog will briefly appear on the CUWIN Comfile Technology Inc CUWIN User s Manual 18 of 72 New Partnership Set Up a Partnership mobile device and this computer you must set up a partnership between them Would you like to set up a partnership O Yes Set up a partnership so that can synchronize information between my device and this computer dont want to synchronize information Set up my device as a quest so that can copy or move information between my device and this computer 14 ActiveSync will then prompt you to create a partnership between the PC and the CUWIN Make your selection If you re not sure just choose No Then click the Next button Microsoft ActiveSync Pao GA 4 54 PM 15 ActiveSync will now show a status of Connected and the ActiveSync system tray icon will chang
18. UWIN program from Visual Studio Comfile Technology Inc CUWIN User s Manual 56 of 72 2 When the form appears on the CUWIN touch the Say Hello button and Hello will appear in HyperTerminal Then type Hi in HyperTerminal and the CUWIN will display Hi in the PC label Comfile Technology Inc CUWIN User s Manual 57 of 72 Modbus We ve now seen how we can program the CUWIN to send and receive data over the its serial port using RS 232 However in that program we transmitted only human readable character data Most digital devices probably don t know what Hello and Hi mean If we want to communicate with electronic devices we must speak their language Enter Modbus Modbus is a protocol created by Modicon in 1979 to communicate with industrial electronic devices and has proliferated to become the de facto standard in the industry Modbus uses a request reply protocol with a single master device and one or more slave devices The master sends a request to a single slave and that slave replies with a response to the master s request A slave can only respond to requests from the master it cannot initiate communication on its own These requests and replies are called frames Modbus supports two frame formats Remote Terminal Unit RTU and American Standard Code for Information Interchange ASCII The RTU format encodes each frame in a compact binary form and uses a Cyclic Redundancy Check
19. WIN to Other Devices The CUWIN has several different interfaces with which it can interface to other devices In the exercises to follow we will make use of the Recommended Standard 232 RS 232 interface also known as a serial port or com port We will use RS 232 to have the CUWIN communicate with a PC and the CUBLOC RS 232 RS 232 has been around for many years and is commonly used in the HMI industry as a way for devices to communicate with one another To illustrate how the CUWIN can use RS 232 to communicate with other devices we will program the CUWIN to send messages to a PC The PC will display the received messages in HyperTerminal HyperTerminal is an application included in all the latest versions of Windows and is well suited for RS 232 communication Finally we will modify this program to read keystrokes in HyperTerminal and display them on the CUWIN Writing to the CUWIN s Serial Port For this exercise you will need to connect an RS 232 cable from CUWIN s COMI serial port to a PC s serial port The CUWIN and most PCs have more than one serial port so be aware which serial port you are using For this exercise we will assume that both the CUWIN and the PC will use their COMI serial port You should now have two connections between the CUWIN and the PC USB and RS 232 Comfile Technology Inc CUWIN User s Manual 45 of 72 New Project Project types Templates MET Framework 3 5 w Ee re Visual Cat Visual Studi
20. ZABU Date Modified amp z1 2010 1 28 PM Size 5 70 MB 2 Execute the downloaded file to begin the installation ig CUWIN2450 Setup Welcome to the CUWIN2450 Setup Wizard The Setup Wizard will install CUWIN2450 on your computer Click Next to continue or Cancel to exit the Setup Wizard Cancel 3 When the welcome screen appears click the Next button Comfile Technology Inc CUWIN User s Manual 32 of 72 ig CUWIN2450 License Agreement End User License Agreement Be sure to carefully read and understand the Following end user license agreement and then indicate whether you accept or da not accept the terms of the agreement This software will nat be installed an your development workstation unless vau accept the berms of Ehe end user license agreement For your Future reference vou can print the text of the end user license agreement by clicking the PRINT button SOFTWARE LICENSE TERMS WINDOWS EMBEDDED CE 6 0 CUSTOMIZED OEM SOFTWARE DEVELOPMENT KIT for CUVWIN2Z450 1 0 0 Press the PAGE DOW key bo see more text 4 Read the license agreement and if you agree choose Accept and click the Next button i CUWIN2450 Setup Customer Information Please enter your customer information User Name Comfile Technology Organization Comfile Technology 5 On the Customer Information dialog enter the appropriate information the in User Name and Organization text boxe
21. alog box appears click the Run button Comfile Technology Inc CUWIN User s Manual 13 of 72 4 5 i Microsoft ActiveSync 4 5 Microsoft ActiveSync 4 5 Welcome to Microsoft Activesync 4 5 Setup Click Next to install Microsoft Activesync 4 5 en your computer On the following screen click the Next button ig Microsoft ActiveSync 4 5 License Agreement Please read the Following license agreement carefully MICROSOFT SOFTWARE LICENSE TERMS MICROSOFT ACTIVESYNC 4 5 These license terms are an agreement between Microsoft Corporation or based on where you live one af its affiliates and vou Please read them They apply to the software named above which includes the media an which you received it if any The terms also apply to any Microsoft x 3 I accept the terms in Ehe license agreement COIdo nat accept the terms in the license agreement Read the license agreement and if you agree accept the license agreement and click the Next button Comfile Technology Inc CUWIN User s Manual 14 of 72 ie Microsoft ActiveSync 4 5 Customer Information Please enter your information User Mame Comfile Technology Organization Comfile Technology 6 On the Customer Information dialog enter the appropriate information in the User Name and Organization text boxes Then click the Next button ig Microsoft ActiveSync 4 5 Destination Folder
22. an understand and receives signals from those electronic devices translating them to colorful output that the user can understand Thus the CUWIN serves as a Human Machine Interface HMI Using the CUBLOC TinyPLC or other Programmable Logic Controllers PLC the CUWIN can provide a human interface to electronic and mechanical systems such as robots monitoring systems environment control systems and automation equipment just to name a few The CUWIN has been used in all kinds of applications from solar energy systems that track the sun to beauty appliances for styling hair The possibilities are endless Comfile Technology Inc CUWIN User s Manual 5 of 72 Powering On the CUWIN for the First Time Setting the CUWIN s Operating Mode The CUWIN is very flexible and can operate in many modes depending on the CUWIN s final purpose The following table lists the CUWIN s different operating modes Position Position Function Mode 1 2 3 4 5 6 l SDCard Off 1 Boot Device NAND Flash On Reserved On On Auto Run M On Off 2 and 3 Boot Mode ene 2 Development Mode Off Off OS Image Download Mode Off On 4 5 and5 Reserved Reserved Development Mode For the exercises in this document we need to set the CUWIN s operating mode to Development Mode To set the CUWIN s operating mode to Development Mode set position 1 to ON and positions 2 through 6 OFF as shown above AutoRun Mode
23. ation File origin Downloaded from the Internet v Show details Change when these notifications appear 3 If you are presented with a User Account Control dialog click the Yes button Comfile Technology Inc CUWIN User s Manual 21 of 72 a Driver Update Windows Mobile Device Center will begin installing Wait for it to finish Windows Mobile based device support X k Device driver software installed successfully EN mo eb Default Programs PS Desktop Gadget Gallery E Internet Explorer 5S Korea Media Player Center EF Korea Messenger Center amp Windows Anytime Upgrade E Windows DVD Maker kag Windows Fax and Scan windows Media Center Windows Media Player id LA Te Windows Update 9 XPS Viewer di Accessories Mi Games Maintenance Startup Search programs and files When the installation is finished a message will appear in the system tray telling you that the installation was successful Mike Documents Pictures Music Computer Control Panel Devices and Printers Default Programs Help and Support Run Windows Media Device Center from the Windows Start Menu Comfile Technology Inc CUWIN User s Manual 22 of 72 MICROSOFT SOFTWARE LICENSE TERMS MICROSOFT WINDOWS MOBILE DEVICE CENTER 6 1 These license terms are an agreement between Microsoft Corporation or based on where you live one of its affiliates and you Please
24. atus Copying new Files Cancel 9 The SDK will begin installing Wait for it to finish Comfile Technology Inc CUWIN User s Manual 35 of 72 i CUWIN2450 Setup Completing the CUWIN2450 Setup Wizard Click the Finish button En exit Ehe Setup Wizard Cancel 10 When the installation is finished a dialog will display saying Completing the CUWIN2450 Setup Wizard Click the Finish button Comfile Technology Inc CUWIN User s Manual 36 of 72 Creating Our First CUWIN Program Now that the development environment is installed we are ready to develop programs for the CUWIN In this section we will create a very simple Hello World program Although this program is very simple it will illustrate the process that we must go through to develop deploy and debug any CUWIN program E d E bO Miei ente e 3 e G tet l Grat 34 l A Microsoft Security Essentials Faint AI Files and Settings Tr b Wizard Microsoft Silverlight Microsoft SQL Server 2005 visual Studio Remote Tools fim Visual Studio Tools fag Microsoft visual Studio 2008 k All Programs Microsoft Windows SDK v6 04 pel Log Orr 0 Turn OFF Compute Microsoft Visual Studia 2008 Documentation 1 Start Visual Studio 2008 by selecting it from the Start Menu 9 Choose Default Environment Settings APA jeta a Visual Studio 2008 Before vou begin using Visual Studio For the Fi
25. aveRegs Utility to permanently save any changes to the device s registry 7 Start Button Opens the Windows CE Start Menu 8 System Tray Windows CE System Tray 9 Show Desktop Minimizes any open windows and shows the Windows CE desktop 10 Input Panel Opens the Windows CE Input Panel onscreen keyboard Comfile Technology Inc CUWIN User s Manual 8 of 72 Connecting the CUWIN to a Personal Computer PC In order to customize the CUWIN for your needs you will likely need to transfer data and programs to the CUWIN Typically this is done by connecting the CUWIN to a Personal Computer PC In order for a PC to communicate with the CUWIN a USB device driver must be installed on the PC Once the driver is installed ActiveSync Windows XP or Windows Mobile Device Center Windows Vista and Windows 7 can be used to copy data and programs to and from a PC and the CUWIN Installing the USB Driver Windows 7 Windows 7 already includes a driver for the CUWIN Simply connect the CUWIN and the PC via a USB cable and Windows will download a driver from Windows Update It will appear as Anchor USB EZ Link Cable After the driver is installed the CUWIN will appear in the list of portable devices Installing the USB Driver Windows XP The following instructions describe how to install the CUWIN s USB driver on the PC activesync us b cuwin5000 Size 115 KB Files secbulk inf secbulk sys wceusbsh inf wceusbsh sys L D
26. ces f mu 44 MoM d 40 4o sr Comfile Technology Inc CUWIN User s Manual 38 of 72 New Project Project types Templates MET Framework 3 5 v EJ B Visual C isual Studio installed templates Windows l Web g2 Smart Device Project Smart Device l Office My Templates Database Reporting Test zi Search Online Templates WF 5 Workflow E Other Languages Other Project Types Test Projects A project For Smart Device applications Choose target platform Framework version and template in the next dialog box Mame Hello warld Location C Documents and Settings 4dministratoriMy Documents visual Studia 2008 Projects Ww Browse Solution Marne Hello warld Create directory For solution he Cancel 5 Select Visual C gt Smart Device from the Project Types tree and Smart Device Project from the Templates list Makes sure Net Framework 3 5 is selected from the top right hand corner and change the Name of the project to HelloWorld Then click the OK button Add New Smart Device Project HelloWorld EJE3 Target platform Windows CE NET Compact Framework version Ns gem TEN Templates Fr igo e a as Device Class Library Console Control Library Emptv Project 4 project For creating a WET Application Application PU Compact Framework 3 5 Forms application For windows CE Platform Download additonal emulator imag
27. comes with the Net Compact Framework 3 5 pre installed so if you don t have any updates uncheck the Deploy the latest version of the Net Compact Framework including Service Packs checkbox Comfile Technology Inc CUWIN User s Manual 43 of 72 15 To execute the program ensure the CUWIN in powered on and is connected to the PC and click the Start Debugging button on the toolbar Deploy HelloWorld Choose where to deploy your application Deploy Device Cancel CLIWINZA3B50 ARINIVAT Device Pocket PC 2003 Device Pocket PC 2003 SE Emulator Pocket PC 2003 SE Square Emulator Pocket PC 2003 SE Square YGA Emulator Pocket PC 2003 SE YGA Emulator USA Windows Mobile 5 0 Pocket PC Rz Emulator USA Windows Mobile 5 0 Pocket PC Rz Square Emulator USA Windows Mobile 5 0 Smartphone RZ QG Emulator Windows CE Device Windows Mobile 5 0 Pocket PC Device Rz Windows Mobile 5 0 Smartphone Device R2 Show me this dialog each time I deploy the application 16 Ifa Deploy HelloWorld dialog is displayed choose CUWIN2450 ARMV4I Device from the Device options and click the Deploy button The program will compile upload to the CUWIN and begin executing e x ok Say Hello 17 The program s main window will then appear on the CUWIN Touch the Say Hello button and a message box will appear saying Hello Comfile Technology Inc CUWIN User s Manual 44 of 72 Interfacing the CU
28. cted that the following required components are already installed Microsoft Windows Installer 3 1 ij Setup will install the following components Microsoft MET Framework 3 5 Microsoft Document Explorer 2006 Microsoft Visual Studio Web Authoring Component Microsoft Visual Studio 2008 To install you must accept the End User License Agreement and enter your product key etup Be sure to carefully read and understand all the rights and restrictions described in the license berms You must accept the license terms before vou can install the software MICROSOFT SOFTWARE LICENSE TERMS MICROSOFT VISUAL STUDIO 2008 PROFESSIONAL EDITION AND TRIAL EDITION These license terms are an agreement between Microsoft Corporation or based on where you live one of its affiliates and you Please read them They apply to the software named above which includes the media on which Press the Page Down key bo see more text 31 have read and accept the license terms I do not accept the license terms Product key XPWKE KODGM 3BgwYw FOS Name Camfile Technology amp Previous 5 Read the license agreement and if you agree check the have read and accept the license terms Enter an appropriate name in the Name text box and click the Next button F Microsoft Visual Studio 2008 Setup Options Page Microsoft Visual Studio 2008 Select features to install Default Installs th
29. dress 1 0x05 Read Bit 0x0000 Register Address O Port O OxFFOO The LED was turned on Ox8C3A CRC Turning the LED Off To have the CUBLOC turn the LED off we issue the following Modbus frame Value Description 0x01 Slave Address 1 0x05 Write bit 0x0000 Register Address O Port 0 0x0000 Turn the LED off OxCDCA CRC The CUBLOC will respond with the following Modbus frame an echo of the request Value Description 0x01 Slave Address 1 0x05 Read Bit 0x0000 Register Address O Port 0 0x0000 The LED was turned off OxCDCA CRC Comfile Technology Inc CUWIN User s Manual 61 of 72 Setting Up the CUBLOC Now that we have a general idea what Modbus is we need to set up the CUBLOC to perform the task at hand Follow the following procedures to program the CUBLOC connect one of its I O ports to an LED and connect it to the CUWIN Cubloc Studio C Documents and Settings Mike My Docu Sie File Edit Device Run Setup Help Bad g 4BAA mui B E F1 BASIC F2 LADDER Ladder Mnemonic 1 Const Device CB2E0 Using CUBLOC CB280 2 Opencom 1 19200 3 50 50 Serial Port Settings iSetr Modbus 1 1 20 Modbus Settings 4 5 Ramclear Make sure our memory is clean 7 Usepin 0 O0ut Use PO to light the LED 3 Set Ladder On Needed to make PO light LED 10 11 Do Keep Running don t exit 12 Loop F W Id 6233538 AXE A 1 Using Cub
30. e 10 Finally adjust the project properties as we did in the previous exercises How the Code Works 1 When the form loads the form s Load event fires calling the Formi Load event handler This event handler configures the CUWIN s serial port attaches the _port_DataReceived event handler opens the port and initializes the LED State label with the current state of the LED On or Off 2 When the Toggle button is clicked the button s Click event fires calling the button1_Click event handler This event handler reads the state of the LED reverses the LED s state confirms the new state of the LED and updates the LED State label with the LED s new state 3 The ReadLEDStatus function sends a Modbus frame to the CUBLOC asking for the value in register 0x0000 the value of port 0 then waits for a response from the CUBLOC 4 The ChangeLEDStatus function sends a Modbus frame to either set the value in register 0x0000 to 1 turn on the LED or set the value in register 0x0000 to O turn off the LED depending on the value of the turnOn parameter NOTE The Modbus protocol requires us to send a value of OxOOFF to change register 0x0000 s value to 1 5 The port DataReceived event handler receives a Modbus response frame from the CUBLOC stores the frame in the response buffer then notifies the form that the response has been received 6 Finally when the form closes the form s Close event fires calling
31. e indicating the CUWIN is connected to the PC Click the Explore icon Comfile Technology Inc CUWIN User s Manual 19 of 72 E Mobile Device File Edit View Favorites Tools Help Q JS p2 Search Folders Address Mobile Device Other Places Application Flash Disk My Documents Wetwork Program Files Data Details D 0 go rj Recycled Windows ControlPanel Printer swap 16 Using Windows Explorer you will now be able to view the CUWIN s file system and transfer files to and from the CUWIN just as you would on the PC Comfile Technology Inc CUWIN User s Manual 20 of 72 Windows Mobile Device Center Windows Vista 7 If you are running Windows Vista or Windows 7 please perform the following procedure to install Windows Mobile Device Center L Download Windows Mobile Device Center At the time of this writing the latest version was 6 1 and could be downloaded from http www microsoft com downloads details asox Familyld 46F72DF1 E46A 4A5F A791 O9FO7AAA1914 amp displaylang en File description Win32 Cabinet Self Extractor Company Microsoft Corporation File version 5 0 5824 16387 Date created 6 23 2010 1 42 PM Size 12 0 MB 2 Run the downloaded file b Sa SSS ay User Account Control e Do you want to allow the following program to make 7 changes to this computer Program name Windows Mobile Device Center Verified publisher Microsoft Corpor
32. e recommended features for the product Full Installs all features for the product e Custom Select features to include and exclude from the product Setup Feature description This option allows you to select which features you want to install Product install path C Program Files Microsoft Visual Studio 9 0 Disk space requirements Volume Disk Size 40 0 GE Avallable 36 6 GE Remaining 32 6 GB Required 4 0 GB z Previous i Cancel 6 Choose an appropriate setup option for your needs Default and Full will both install the necessary components for this document but we will use Custom so you can see exactly what we will need Comfile Technology Inc CUWIN User s Manual 29 of 72 F amp Microsoft Visual Studio 2008 Setup Options Page Microsoft Visual Studio 2008 Select features to install Feature description amd Microsoft Visual Studio 2008 Professioni oO L Tool Visual C Smart Device Programmability E as adel ia Use your existing Visual C skills to build applications for a CH the NET Compact Framework extending your software skills to the rapidly growing world of mobile devices Visual C Smart Device Programmability provides everything you ll need to build smart device applications including zd as Visual C apes Smart Device Pragrammability co X 64 Compilers and Tools Feature install path oe lc Visual C
33. ent k e Network Conrecticns J Outlook Express Te Incernet Explorer fa System Tools 9 Network Setup Wizard wi MSN QJ Address Bcok a New Connection Wizard W Faint GP Microsoft visual Stud 1 MSN windcws Media Play 33 windews Messenger Tour Windows xP All Programs e Qutlaak Express a Calculator 3 Wireless Network Setup Wizard Remote 45sstance Command Prompt f wndows Media Flayer hobepad ib Widows Messenger Paint W wndows Movie Maker Program Compacibility Wizard Microscft Activetyne h Mizroscrt Security Essentials ir MizroscFE Silverlicht LU Mizroscft SOL Sever 2005 F7 Microscft Visual Studio 2003 MizrascfE Windows SCK v6 D ld Log FF Ko Tarn FF iCompuzer Remote Desktop Cornection fe cee Synch onizs 43 Tour windows XP Lg Windows Explorer 3 WordPad Lj sg Start F HelloH perTerminal 1 Start HyperTerminal by selecting Start gt All Programs Accessories Communications gt HyperTerminal in the Windows start menu Location Information Before vau can make any phone or modem connections Windows needs the following information about your current location What country region are you in now United States Ww What area code ar city code are you in now AAS IF you need ta specify a carrier code what is IE IF pou dial a number to access an outside line what is it The pho
34. es and smart device SDKs 6 Another dialog will display asking for more project configuration Select Windows CE from the Target Platform list and Net Compact Framework 3 5 from the Net Compact Framework Version list Then select Device Application from the Templates list and click the OK button Comfile Technology Inc CUWIN User s Manual 39 of 72 HelloWorld Microsoft Visual Studio 1 Elz L2 Debug gt Any CPU Pocket PC 2003 SE Emulator be Rh CC NE 3 Formis Design Start Page Li ek OR J AN L amp 3 h ooo HE DUe oh LQ pion it M wt S3 2 R ex 35 Ch dal wx i a inda fe el ax Solution Helloworld 1 project B 5 Properties 5 References amp EE Formi cs i e Program cs 7 Finally the project will open and we are ready to start programming HelloWorld Microsoft Visual Studio 3l eJ Pocket PC 2003 SE Emulator 33 9 wf Gl E Debug Any CPU lus k eh Lid if he rmi i O hed i Toolbox i ih d ax Solution Helloworld 1 project 3 Helloworld E Properties g References amp Ef Form1 cs e Program cs 8 Move your mouse over the Toolbox tab on the left side of the screen and the Toolbox menu will open Select or drag a Button to the form A new button labeled button1 will appear on the form Comfile Technology Inc CUWIN User s Manual 40 of 72 HelloWo
35. for c Samsung LS USB Sync Click Finish to close the wizard 7 The driver will then install When it is finished the window above will appear Click the Finish button Comfile Technology Inc CUWIN User s Manual 12 of 72 ActiveSync Windows XP After the USB driver has been installed ActiveSync Windows XP or Windows Mobile Device Center Windows Vista or Windows 7 can be installed If you are running Windows XP please perform the following procedure to install ActiveSync l Download ActiveSync At the time of this writing the latest version was 4 5 and could be downloaded from http www microsoft com windowsmobile en us downloads microsoft activesync download mspx setup N Type Windows Installer Package Author Microsoft Corporation Title Installation Database Subject Microsoft Activesync This installer database contains the logic and data required to install Microsoft Activesync Date Modified 6 16 2010 3 36 PM Size 7 52 MB 2 Run the downloaded file Open File Security Warning Do you want to run this file Name setup msi Publisher Microsoft Corporation Type Windows Installer Package From C Documents and Settings 4dministrator Desktop Always ask before opening this File While files from the Internet can be useful this file type can potentially harm your computer Only run software from publishers wou trust What s the risk 3 If a Security Warning di
36. g on the serial port _port DataReceived new SerialDataReceivedEventHandler _port_DataReceived Open the serial port porti Open private void Forml_Closing object sender CancelEventArgs e Close the serial port port lose void port DataReceived object sender SerialDataReceivedEventArgs e Read data into response buffer port Read response 0 _port BytesToRead Notify that a response was received evt Set 5 Attach an event handler to the serial ports DataReceived event This event handler will store the frame received from the CUBLOC in the response buffer and notify the the form s thread See ManualResetEvent for more information that the frame was received Comfile Technology Inc CUWIN User s Manual 67 of 72 sete Ms e Erie Ir LED T19 on role ln LED meson private bool ReadLEDState slave address 0x01 function code 0x02 read bit register address 0x00 0x00 read only 1 bit 0x00 0x01 crc OxB9 OxCA byte request 0x01 0x02 0x00 0x00 0x00 0x01 OxB9 OxCA send request _port Write request 0 request Length Wait for a response _evt WaitOne evt Reset byte 3 contains the LED s status if response 3 0 return false else return true 6 Add a function called ReadLEDState that sends a Modbus frame to the CUBLOC to read the state of the LED This function will wait for a response frame from the CUBLOC
37. h CAactivesync usb cuwinb DU Dont search will choose the driver to install Choose this option to select the device driver from a list Windows does not guarantee that the driver you choose will be the best match for your hardware 4 Select Search for the best driver in these locations radio button and the Include this location in the search checkbox Then browse to the folder containing the drivers that were downloaded in step 1 and click the Next button Found New Hardware Wizard Please wait while the wizard searches B Samsung LS USB Sync 9 The PC will begin searching for a suitable driver Wait for it to finish Comfile Technology Inc CUWIN User s Manual 11 of 72 Hardware Installation A The software you are installing for this hardware Samsung LSI USB Sync has not jase is loge pit DE E ot ell n hi otant Continuing your installation of this software may impair or destabilize the conect operation of your system either immediately or in the future Microsoft strongly that you stop this installation now and contact the hardware for software that has passed Windows Logo testing f Continue Anyway STOP Installation 6 When it locates the driver it will display a dialog box as shown above Click the Continue Anyway button Found Hew Hardware Wizard Completing the Found New Hardware Wizard The wizard has finished installing the software
38. loc Studio program the CUBLOC as shown above This will configure the CUBLOC to communicate via Modbus over its serial port and enable port O to apply voltage to an LED Itis not necessary to fully understand this program If you want to learn more about programming the CUBLOC see the CUBLOC s user manual Jumper PO to LEDO CUBL OC STUDY BOARD Sotto E C3 Ela NJ kJ Li L Veg eee 2 Connect the CUBLOC s I O port O to an LED The image above illustrates how to accomplish this using the CUBLOC Study Board Comfile Technology Inc CUWIN User s Manual 62 of 72 PC CUWIN CUBLOC Study Board 3 Connect the CUBLOC s serial port to the CUWIN s COMI serial port The image above illustrates how to accomplish this using the CUBLOC Study Board There will now be two connections to the CUWIN a USB connection to the PC and an RS 232 connection to the CUBLOC Study Board Comfile Technology Inc CUWIN User s Manual 63 of 72 Programming the CUWIN Now that the CUBLOC has been programmed to process Modbus frames configured to light an LED and connected to the CUWIN we need to program the CUWIN to send Modbus frames to the CUBLOC New Project Project types Templates ET Framework 3 5 v E E Visual Cx Visual 5tudio installed templates Windows web j 5mart Device Project MIB ri Office My Templates Database Reporting Test WCF WorkFlow Other Languages Other Project Types Tes
39. nagement click Browse the contents of your device Comfile Technology Inc CUWIN User s Manual 25 of 72 c r re f X J Computer CUWINY sss SearchCuwN 3 Search CUWIN pl Ff Favorites zs A gt LOO O Flash Disk E Desktop c 9 52 MB free of 9 65 MB gp Downloads as Recent Places 7 Network 153 Libraries Ls a 3 items 13 Using Windows Explorer you will be able to view the CUWIN s file system and transfer files to and from the CUWIN just as you would on the PC Comfile Technology Inc CUWIN User s Manual 26 of 72 Developing Software for the CUWIN In order to develop software for the CUWIN a software development environment must be installed This document will make use of Microsoft s Visual Studio 2008 as a development environment but any software development environment capable of producing Windows Embedded CE programs compatible with the CUWIN s processor can be used Visual Studio supports several programming languages primarily Visual C C and Visual Basic Net and can produce two kinds of programs managed and unmanaged native programs Managed programs rely on the Net Framework while unmanaged programs do not Visual C can produce either managed or unmanaged programs but C and Visual Basic Net are primarily used to produce managed programs For this document we will be programming in C so our programs will be managed and will thus rely on the Net Frame
40. ne system at this location uses Tone dialing Pulse dialing 2 You may be prompted to configure your Location information You only need to select your country region and enter you area code These settings are not necessary for this exercise but HyperTerminal requires it After you are finished click the OK button Comfile Technology Inc CUWIN User s Manual 50 of 72 Phone and Modem Options Dialing Rules 3 7 The list below displays the locations you have specified Select the location fram which You are dialing Locations Location Area Code Ol My Location 355 3 You may then be prompted to edit dialing rules Again this is not necessary for this experiment Just click the OK button New Connection HyperTerminal Help File Edit View Call Transfe Connection Description NP New Connection Enter a name and choose an icon for the connection Name CUWIN Disconnected Auto detect Auto detect 4 HyperTerminal will open and display a Connection Description dialog It is here we need to Comfile Technology Inc CUWIN User s Manual 51 of 72 Connect To Enter details for the phone number that you want to dial Country regiory Connect using WE 5i configure the PC s serial port Enter CUWIN in the Name textbox and click the OK button 5 In the Connect Using drop down list select the serial port you wish
41. ng language and development environment that is compatible with Windows Embedded CE 6 0 and the CUWIN s processor This includes but is not limited to Visual Basic and C This document will make use of the CUWIN5200 but all examples can be easily adaptable to any CUWIN model with little or no modification We hope this document will reveal just how easy it is to quickly begin using the CUWIN develop software and interface the CUWIN to almost any digital device Comfile Technology Inc CUWIN User s Manual 3 of 72 Overview The CUWIN is a Windows Embedded CE touch controller primarily targeted for use as a Human Machine Interface HMI The CUWIN s front panel features an 800x480 color touch screen capable of receiving input from a human user by touching the screen and displaying colorful information SD card Power The CUWI N s rear and side panels feature several interfaces RS232 485 USB Ethernet Audio SD Card for communicating with many different electronic devices Comfile Technology Inc CUWIN User s Manual 4 of 72 T windows Embedded CE 6 0 23 2103 L TCP IP UDP RS232 RS485 e 2 Internet Hyperterminal other RS232 other TCP UDP ActiveSync other USB SD Card Speakers CUBLOC PLC other audio Web browser Server HTTP database FTP other server The CUWIN translates input from a human user to signals that electronic devices c
42. o installed templates 000 0 Windows Web j 5mart Device Project Smart Device E Office My Templates Database Reporting Test WCF Workflow Other Languages al Search Online Templates i Other Project Types Test Projects 4 project For Smart Device applications Choose target platform Framework version and template in the next dialog box Name HelloHyperTerminal Location C Documents and Settings 4dministrator My Documents visual Studio 2008 Projects we Solution Mame HelloHyperTerminal Create directory For solution E l Create a new smart device project as we did for HelloWorld and name it HelloHyperTerminal Add New Smart Device Project Hellodyper Terminal F x Target platform windows CE NET Compact Framework version NET Compact Framework version 3 5 v Templates gg M g elle ca aT c m Description Class Library Console Control Library Empty Project 4 project Far creating a WET Application Application pral g Compact Framework 3 5 Forms application For Windows CE Platform Download additonal emulator images and smart device SDKs 2 Make the project a Device Application just as we did for the HelloWorld project Comfile Technology Inc CUWIN User s Manual 46 of 72 23 HelloHyper Terminal Microsoft Visual Studio File Edit View Project Build Debug Data Format Tools Test Window Help Gl 5 72 d B amp 3a Gl P Debug Any CPU gt dE
43. odel using System Windows Forms using System IO Ports namespace ToggleLED eveleubikie 6 cuu a eec cie Tum DX M i public Formi InitializeComponent private SerialPort _port private void Forml_Load object sender EventArgs e Configure the serial port port new SerialPort _port PortName COM1 _port BaudRate 19200 _port DataBits 8 _port Parity Parity None _port StopBits StopBits One Open the serial port _port Open private void Forml_Closing object sender CancelEventArgs e Close the serial port _port Close 4 Add the code above to the form s Load and Closing event handlers This will configure the CUWI N s serial port and open it when the form loads When the form closes the the serial port will be closed Comfile Technology Inc CUWIN User s Manual 66 of 72 using System using System ComponentModel using oyst tem NWindows Pormes ucang oyar om LO Eus using System Threading namespace ToggleLED publve por aa eae orn om public Formi i InitializeComponent Privato DerlalPOrh port private byte response new byte 8 private ManualResetEvent evt new ManualResetEvent false private void Forml Load object sender EventArgs e Configure the serial port port new SerialPort Spork Baudkare 19700 LIO BS eles 9 comu cM ems coop ore Siccojels hes Cie Listen for data arrivin
44. on of the NET Compact Framework this gt project targets Ready 13 Weare finished editing the code necessary to build this program Now we need to make some project configuration changes in order to build the program for the CUWIN Right click the Hello World project node in the Solution Explorer window and choose Properties 3 HelloWorld Microsoft Visual Studio File Edit View Project Build Debug Data Tools Test Window Help ial gt dy GF d a LD mG b Debug gt Any CPU 1d 8 88 29 Rl 6 CUWIN2450 ARMY4I Device r5 Gal 42 Sh Z Xx HelloWorld Formi cs Formi cs Design Start Page x Solution Explorer Helloworld x 3 LS e 5 S Application oe Solution Helloworld 1 project x FE HelloWorld Build H a Properties Deployment Options Gd I References Build Events pas gt H EE Form1 cs Target device Program cs Panig CUWIN2450 ARMV4 Device v Resources Output file folder CSIDL_PROGRAM_FILES Helloworld Reference Paths C Deploy the latest version of the NET Compact Framework including Service Packs Signing Authenticode Signing Devices C Sign the project output with this certificate Properties lx s 2 E Provision certificate to device Ready 14 Choose the Devices tab on the left hand side of the screen Under Deployment Options change the Target Device to CUWIN2450 ARMV4I Device The CUWIN
45. or reading and changing the state of the LED We now need to add attach an event handler to the button s Click event to toggle the state of the LED After the state is changed the program will read the state of the LED and update the LED State label private void Forml Load object sender EventArgs e Configure the serial port port new SerialPort pork BaudRavce 19200 core Dee IS IE Spori Pariin pau c Tones ERO OUI Ioa E EDI Ones Seen Tor data arriving On Ene Serial pore _port DataReceived new SerialDataReceivedEventHandler _port_DataReceived Open the serial port Port Open Is LED on or off bool isOn ReadLEDState Update label if isOn labell Text On else labell Text OFE 9 When the form loads we should update the LED State label with the LED s initial state To do this modify the Forml_Load event handler as shown above Comfile Technology Inc CUWIN User s Manual 70 of 72 ToggleLED Formi cs Design Start Page Formi cs TX Application Build Deployment Options Build Events Set p Target device Debug CUWIN2450 ARMVATI Device Resources Qutput File Folder S amp CSIDL PROGRAM FILESS amp ATaggleLED Lu C Deploy the latest version of the MET Compact Framework including Service Packs Reference Paths Signing 4uthenticode Signing Devices Sign the project output with this certificate Provision certificate to devic
46. ownload the ActiveSync USB Driver CUWI N5000 series file from the Comfile Technology website at http www cubloc com data 07 php and unzip the file to a folder of your choosing Comfile Technology Inc CUWIN User s Manual 9 of 72 2 Using a USB cable connect the CUWIN to the PC Found New Hardware Wizard Welcome to the Found New Hardware Wizard This wizard helps you install software for Samsung LS USB Sync If your hardware came with an installation CD lt 4 or floppy disk insert it now What do you want the wizard to do CO Install the software automatically Recommended Install from a list or specific location Advanced ummumamumamuuamuuamuuuamuuauuuauuuanuuanuuanuusH HruukR RRRRRRRRRRRRERRRERRRERRRERRRRRRR RRRERRSRSEERSEESEENZEEEEEEAM Click Next to continue 3 After connecting the CUWIN to the PC the Found New Hardware Wizard will appear Select Install from a list or specific location Advanced and click the Next button Comfile Technology Inc CUWIN User s Manual 10 of 72 Found New Hardware Wizard Please choose your search and installation options E S Search for the best driver in these locations Use the check boxes below to limit or expand the default search which includes local paths and removable media The best driver found will be installed Search removable media floppy CD ROM Include this location in the searc
47. ramework including Service Packs Signing E Authenticode Signing Devices Sign the project output with this certificate Provision certificate to device 8 Finally adjust the project properties just as we did in the HelloWorld project How the Code Works 1 When the form opens the form s Load event fires executing the Forml_Load event handler This event handler configures the COMI serial port and opens it so we can write to it 2 When we close the form the form s Closing event fires calling the Formi Closing event handler This event handler closes the COMI serial port 3 When we touch the Say Hello button the button s Click event fires calling the button1 Click event handler This event handler writes Hello to the serial port The r and n characters are a carriage return and line feed so each Hello we send appears on a new line Comfile Technology Inc CUWIN User s Manual 49 of 72 Displaying our Hello Message on the PC We now need some device to read and display the Hello being sent from the CUWIN For this we will use the program HyperTerminal which is included in Windows XP r Set Program Access and Defaults mee w wndows Catalog Je Administt aie ne A wndows Update TRIN fy Accessories r ani Accessibility k Interret Explorer Tj Games T a HyperTermind ni E mail fm Startup I Fa Entertainm
48. read them They apply to the software named above which includes the media on which you received it if any The terms also apply to any Microsoft e Internet based services and am 7 Read the license agreement and if you agree click the Accept button SR bG As L O Not Connected 8 Windows Mobile Device Center will open and will indicate a status of Not Connected Comfile Technology Inc CUWIN User s Manual 23 of 72 9 Using a USB cable connect the CUWIN to the PC IM Your device is ready to use X A Device driver software installed successfully 10 Windows will begin installing a driver for the CUWIN When it is finished a message will display in the system tray saying Your device is ready to use gne t Comfile Technology Inc CUWIN User s Manual 24 of 72 Windows U ta gt 2 di f T On you Lnd cts Ca f Jf Connected 11 Windows Mobile Device Center will begin connecting with the CUWIN When it is finished it will display a status of connected At this time you can use Windows Mobile Device Center to do many things with the CUWIN You are encouraged to read the Windows Mobile Device Center documentation for more information For this exercise however we just want to transfer files so click Connect without setting up your device Windows Mobile w Connected Q Mobile Device Settings 12 Under File Ma
49. rld Microsoft Visual Studio JG i Pocket PC 2003 SE Emulator Fie Edi Buld Debug Data Format Tools Test window Help Formi cs Start Page rel 5 A Solution HelloWorld 1 project B 33 HelloWorld E Properties g References 4 E Formt cs GE Program cs 9 Position the button to the bottom of the form and resize the button so it is easy to touch on the touch screen HelloWorld Microsoft Visual Studio Debug Data Format Tools Test Window Help Debug gt Any CPU Pocket PC 2 Shift F7 xoqjoo i4 Server Explorer Solution Explorer Class View Ctrl W L Ctri W S Ctrl C Code Definition Window Ctri W D Object Browser Tab Order Error List Output Properties Window Task List Toolbox Find Results Other Windows Toolbars Full Screen Navigate Backward Navigate Forward Next Task Previous Task Property Pages Ctrl W J Ctrl W E Ctrl W O Ctrl W P Ctrl T Ctrl W X Shift Alt Enter Ctri4 Ctrl Shift Shift F4 d Solution Helloworld 1 project 3 Helloworld E Sa Properties E References i E Formt cs e Program cs Properties x button1 System Windows Forms Button True 70 265 False Modifiers Private Size 497 123 TabIndex 0 TabStop True Tag Text button1 10 If the Properties window is not yet displayed select View Properties Window from the menu and it should appear in the bottom
50. rst time vau need to specify Ehe type of development activity vau engage in the most such as Visual Basic or Visual Cx Visual Studia uses this information to apply a predefined collection of settings to the development environment that is designed Far your development activity You can choose to use a different collection of settings at any time From the Tools menu choose Import and Export Settings and then choose Reset all settings Allow Visual Studia to dawnload and display online R55 content Choose your default environment settings General Development Settings Description Visual Basic Development Settings Customizes the environment to maximize code Visual Cx Development Settings editor screen space and improve the visibility of Visual C Development Settings commands specific Ea C Increases productivity Web Development Settings with keyboard shortcuts that are designed to be easy to learn and use Start Visual Studio Exit Visual Studio 2 If this is your first time to run Visual Studio it will ask you to choose your primary development environment For the exercises in this document it is recommended that you choose Visual C Development Settings Then click the Start Visual Studio button Comfile Technology Inc CUWIN User s Manual 37 of 72 Start Page Microsoft Visual Studio File Edit View Tools Test Window Help Y ij F 1 a 33 Start Page Microsoft xodqjoo
51. s Then click the Next button Comfile Technology Inc CUWIN User s Manual 33 of 72 iy CUWIN2450 Setup Choose Setup Type Choose the setup type that best suits your needs Allows users to choose which program features will be installed and where they will be installed Recommended for advanced users All program features will be installed Requires most disk space i CUWIN2450 Setup Custom Setup Select the way you want features to be installed Click on the icons in the tree below to change the way features will be installed Native Development Support Documentation of the WinCE Microsoft NET Compact Framev platform APIs Mr Documentation Eg Will be installed on local hard drive EB Entire feature will be installed on local hard drive Entire feature will be unavailable 7 Remove the Documentation feature from the installation If you don t do this the installation may fail Comfile Technology Inc CUWIN User s Manual 34 of 72 ie CUWIN2450 Setup Ready to Install The Setup Wizard is ready to begin the Complete installation Click Install to begin the installation IF you wank bo review or change any of your installation settings click Back Click Cancel to exit the wizard 8 We are now ready to begin the installation Click the Install button to begin ig CUWIN2450 Setup Installing CUWIN2450 Please wait while the Setup Wizard installs CUWINZ450 This may take several minutes St
52. s event handler It is here you you tell the program what to do when the button is clicked Add the line MessageBox Show Say Hello Comfile Technology Inc CUWIN User s Manual 42 of 72 2 HelloWorld Microsoft Visual Studio File Edit View Project Build Debug Data Tools Test Window Help ERARA A 3 Mv gt p Debug z Any CPU 2 dE che dcc S a Pocket PC 2003 SE Emulator x Se 834 PERS h as iE PETIRI dii S GS x Formi cs Formi cs Design Start Page X insi eel Ix mM FopeenDEORR wi LEAL 2114 o t HelloWorld Form1 v 3 button Click object sender EventArgs e x E e J using System z lod a HelloWorld 1 project using System Linq i B 83 Build using System Collections Generic m l using System ComponentModel J Rebuild using System Data i d Deploy using System Drawing clean using System Text tusing System Windows Forms Add d Add Reference namespace HelloWorld Add Web Reference El public partial class Formi Form a View Class Diagram f Set as StartUp Project E public Formi f Debug gt InitializeComponent Properties X Cut F Hellowor i private void buttoni Click object sender Event rgs e gi X Remove i M Box Show Hello e ET L ain Unload Project Project 1 Open Folder in Windows Explorer Change Target Platform Target I ij Properties Framework Version ww The Versi
53. soft w Visual Studio 2008 Setup CP Install Visual Studio 2008 features and required components m ra a rh p f r pm mo Jj L Install Product Documentation Install the MSDNM Library which includes Helo far Visual SEU Check for Service Releases ck si tho latast Coa Tem Des re ex ae MECE TOF ne latest Service releases To i a p mir LEE T lity View Reade Comfile Technology Inc CUWIN User s Manual 27 of 72 3 Click the Install Visual Studio 2008 link to begin the installation F Microsoft Visual Studio 7008 Microsoft ICE Studio 2008 Setup Welcome to the Microsoft Visual Studio 7008 installation wizard This wizard guides you through installing this program and all required components Help Improve Setup You can submit anonymous information about your Visual Studio setup experiences to Microsoft To participate check the box below Yes send information about my setup experiences to Microsoft Corporation AjFor more information click Data Collection Policy Microsoft Visual Studio 2008 Loading completed Click Next to continue 4 A welcome screen will appear Click Next to continue Comfile Technology Inc CUWIN User s Manual 28 of 72 F amp Microsoft Visual Studio 2008 Setup Start Page Microsoft Visual Studio 2008 Please exit all applications before continuing with the installation dj Setup has dete
54. t Projects zi Search Online Templates 4 project For Smart Device applications Choose target platform Framework version and template in the next dialog box Mame ToggleLED Location C Documents and Settings 4dministrator My Documents Wisual Studio 2008 Projects v Solution Mame ToggleLED Create directory For solution 1 Create a new smart device project just as we did in the previous exercises and name it ToggleLED Add New Smart Device Project TopeleLED Target platform NET Compact Framework version MET Compact Framework version 3 5 w Templates elle Description Device Class Library Console X Control Library Empty Project A project Far creating a WET Application Application D i Compact Framework 3 5 Farms application Far Windows CE Platform Download additonal emulator images and smart device SDKs 2 Make the project a Device Application project just as we did in the previous exercises Comfile Technology Inc CUWIN User s Manual 64 of 72 ToggleLED Microsoft Visual Studio ale ES 60 ution ToggleLED 1 project W Properties W References E EE Formt cs o Program cs Tahoma 10pt ForeColor B Controltext GenerateMember True False Private 3 Add a label and a button to the form Label the button Toggle and the label LED State Comfile Technology Inc CUWIN User s Manual 65 of 72 using System using System ComponentM
55. to use Note that this is the PC s serial port not the CUWIN s serial port they may be different Then click the OK button COM1 Properties Part Settings Bits per second 19200 Data bits 8 edd None Stop bits 1 Flow control detent Restore Defaults seb 6 A new dialog will appear asking for your port settings These settings must match those settings made in the Formi Load event handler of the CUWIN program or the PC and the CUWIN will not be able to communicate with one another Adjust the settings appropriately then click the OK button Comfile Technology Inc CUWIN User s Manual 52 of 72 Start Debugging F5 7 Execute the CUWIN program from Visual Studio 8 The form will display on the CUWIN Click the Say Hello button CUWIN HyperTerminal E lranstt HoR 9 Take a look at the PC s HyperTerminal window You will see the Hello message sent from the CUWIN Comfile Technology Inc CUWIN User s Manual 53 of 72 Reading from the CUWIN s Serial Port We have successfully built an program that writes data to the CUWIN s serial port sending it to HyperTerminal on the PC but communication is usually bi directional We will now modify this program to read input from HyperTerminal and send it to the CUWIN 23 HelloHyperTerminal Microsoft Visual Studio File Edit View Project Build Debug Data Tools Test Window Help od Solution
56. u can download and install MSDN documentation and other updates from this screen Make your choice or click the Finish button i Visual Studio 2008 Setup Microsott Visual Studio 2008 Setup Repair reinstall or install additional Visual Studio 2008 features You can also uninstall Visual Studio 2008 Install Product Documentation Install the MSDNM Library which includes Help for Visual Studia Check for Service Releases Check for the latest Service Releases to ensure optimal functionality of Visual Studio 2008 ccs 10 The above screen will then appear From this screen you can modify your Visual Studio installation install MSDN documentation and or check for updates At this time it is recommended that you update your computer by clicking the Check for Service Releases link or by using Windows Update Make your choice or click the Exit button Comfile Technology Inc CUWIN User s Manual 31 of 72 Installing the CUWIN Software Development Kit SDK IMPORTANT You must install Visual Studio before installing the SDK or the installation may fail In order for Visual Studio to build and debug applications specific to the CUWIN you must download and install the CUWIN Software Development Kit SDK 1 Download the SDK from http www cubloc com data 07 php Ld ns rel NESO Type Windows Installer Package Author Camfile Technalgoy Title Installation Database Subject CUWIN2Z4 50 CLIVIN
57. veloper Runtime E Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System Runtime Microsoft SOL Server Compact 3 5 Microsoft SQL Server Compact 3 5 Design Tools Microsoft SQL Server Compact 3 5 For Dey 1c ES Window Ws Mobile 5 0 SOK Rz for Pocket PC Initializing Microsoft MET Framework 3 5 Previous 8 Visual Studio 2008 will begin installing Wait for the installation to complete It may take some time Comfile Technology Inc CUWIN User s Manual 30 of 72 F amp Microsoft Visual Studio 2008 Setup Finish Page Microsoft Visual Studio 2008 setup d Success Visual Studio Setup is complete Visual Studio 2008 has been i Documentation installed To install MSDN Library for Visual Studio 2008 run setup exe in the MSDN folder on the installation media or download MSDN Library Express Edition G Security Notes It is highly recommended that you update this computer with the latest security patches for your operating system See the Windows Update web site http windowsupdate microsoft com for the latest updates You can also get updates for Windows XP Windows Server 2003 and Vista It is also recommended that you choose to opt in to the Microsoft Update service to make sure you receive all the available updates for this and other Microsoft products 9 When the installation is complete the above screen will appear No further action is necessary but if you wish yo
58. work The Net Framework is an extremely large collection of libraries and application programming interfaces APIs for Windows operating systems It is much too large for embedded systems that are intended to be small and light like the CUWIN Therefore Microsoft has created the Net Compact Framework to suit the small and light needs of the embedded systems market The CUWIN comes with the Net Compact Framework 3 5 pre installed and the example programs produced in this document will be built to make use of it Installing Visual Studio 2008 Visual Studio Express editions don t support smart device development Visual Studio 2010 also doesn t yet support smart device development Only Visual Studio 2008 Professional or higher supports smart device development for the Net Compact Framework 3 5 so Visual Studio 2008 Professional will be our development environment of choice for this document This document will only show the installation process for Windows XP but the installation process for Windows Vista and Windows 7 is quite similar 1 If you don t yet own Visual Studio 2008 you can download a 90 day trial version at http www microsoft com downloads details aspx Familyl D283c3alec ed72 4a79 8961 25635db0192b The downloaded file must be burned to a DVD Use a DVD burner to burn the iSO image to a DVD disc 2 Insert your Visual Studio 2008 DVD into your DVD drive to begin the installation fy Visual Studio 2008 Setup Micro
59. x Recent Projects Project Project Getting Started What s new in Visual C Create Your First Application How Dol Learn Visual C Download Additional Content MSDN Forums Visual C Developer Center Extend Visual Studio isual Studio Headlines Microsoft SDL Team Releases the MSF Agile SDL Process Template for isual Studio 2008 Ready MQ o E Visual Studio 2008 MSDN Visual Cz Headlines Featured Resources from TechEd North America 2010 Mon 14 Jun 2010 19 35 00 2 Download videos and slides From Visual Studio Language IDE sessions at TechEd North America 2010 System Collections Generic SortedSet who needs another colle Mon 14 Jun 2010 18 10 00 Z The NET 4 0 library includes an additional collection class The SortedSet T At First glance it doesn t seem to provide anything new You may wonder why we need yet another way to store objects In this article Ill explain the drivers behind creating a new collection type how the SortedSet T stores its objects Using IntelliTrace to debug Windows Azure Cloud Services Thu 10 Jun 2010 18 30 00 Z Jim Nakashima tells about new features in Windows Azure Tools For Microsoft Visual Studio Visual Studio 2010 Pro Power Tools Tue 08 Jun 2010 05 25 00 Z Download a set of Microsoft Visual Studio 2010 extensions with Features to enhance your productivity Protecting Intellectual Property with NET Obfuscation Mon OF Jun 20
Download Pdf Manuals
Related Search
Related Contents
AVANT DE COMMENCER MODE D`EMPLOI Method and apparatus for management of an automated license Scarica manuale d`uso 具取扱説明書 Catálogo de Rosewill RCT03BP chair RS 170 取扱説明書のダウンロード Modelo 2622Descargar Pdf UU7F-MI - マスプロ電工 Gebrauchsanleitung Instruction manual Mode d`emploi Handleiding Copyright © All rights reserved.
Failed to retrieve file