Home
        CUWIN manual - Comfile Technology
         Contents
1.    Date Modified  6 21 2010 1 28 PM  Size  5 70 ME       2  Execute the downloaded file to begin the installation        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 33 of 73    i  CUWIN2450 Setup    A Welcome to the CUWIN2450  Setup Wizard    The Setup Wizard will install CUWIN2450 on your computer   Click Next bo continue or Cancel to exit the Setup Wizard     Cancel       3  When the welcome screen appears  click the    Next    button     ig CUWIN 450 License Agreement    End User License Agreement    Be sure to carefully read and understand the Following end user license agreement   and then indicate whether vou accept or do not accept the terms of the agreement              This software will not be installed on your development workstation unless you accept the  berms of the end user license agreement  For your Future reference  you 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    CUVWINA450  1 0 0    Press the PAGE DOWN key to see more text              Ceea tee        4  Read the license agreement and  if you agree  choose    Accept    and click the    Next    button        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 34 of 73    ig  CUWIN2450 Setup    Customer Information    Please enter your customer information    User Mame     Comfile Technology  Organization        Comfile Technology       5  On 
2.   22  23  24  25  26  27  28  29  30  31  39  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47  48  49  50  51  52      public oat biel ass Porm FOr              publio korm      InitializeComponent              ori e E a eke  1616  private byte   _response   new byte 8    private ManualResetEvent evt   new ManualResetEvent  false      Se iveieS Wome Monemill heel  elenjioce seiCle   vist eiece SS         Configure the serial port   Poe ctl re mei  yy   Ome  eeulelveice   Ibe 2100     SOc  DTA   3    SOE eeiemioy   ke ic iie ye INeie   SOOme  uO PE e a a Omid  Ole       Listen for data arriving on the serial port  _port DataReceived    new  SerialDataReceivedEventHandler  port DataReceived         Open the serial port  POOLEL OPEN       oE a Menem oa a e e a Na vemce eee Se         Close the serial port   NOOwE Cesc         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 PDU received from the CUBLOC in the response buffer  and notify the the form s thread   See ManualResetEvent for more information  that the PDU was received        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 67 of 73    52  53  54  55  56  57  58  59  60  6l  62  63  64  65  66  67  68  69  70  71  72  73  74    ARo u
3.   W Microsoft visual Studio 2008 Documentation       te Visual Studio Tools    ts Start    1  Start Visual Studio 2008 by selecting it from the Start Menu      9 Choose Default Environment Settings    Microsoft        Visual Studio 2008    Before vou begin using Visual Studio For the First time  you need bo specify the type of  development activity you engage in the most  such as Visual Basic or Visual C   Visual Studio  uses this information to apply a predefined collection of settings bo the development  environment that is designed For your development activity     You can choose to use a different collection of settings at any tine  From the Tools menu   choose Import and Export Settings and then choose Reset all settings        Allow Visual Studio ta download 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 C  Development Settings editor screen space and improve the visibility of  Visual C   Development Settings commands specific to C   Increases productivity  Web Development Settings with keyboard shortcuts that are designed to be  easy to learn and use        Start Visual Studio Ns 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
4.   a e  LOGIC  a E O E Oe      GESEeM or Cake arrivino ohn ene cerid port  SOI   Dae o Recervedi h TTEN  o e e e e a o D e R      Open the serial port  JOSIE COSI       Is LED on or off   bool isOn   ReadLEDState          Update label  if  isOn    labell Text    On    else   labell Text    Off      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 CUWIN 5000 6000 CWV Series   User s Manual 70 of 73    ToggleLED Formi cs  Design     Start Page   Formi cs  Xx    Application   Build   Build Events  Debug  Resources  Reference Paths  Signing    Devices             Deployment Options    Target device     CUWIN2450 ARMY Device                   Gutput file Folder       CSIDL_PROGRAM_FILES   ToggleLED    r                C  Deploy the latest version of the ET Compact Framework  including Service Packs     4uthenticode Signing       Sign the project output with this certificate                   Provision certificate to device           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 Forml 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       
5.  2  When the    Toggle    button is clicked  the button s Click event fires  calling the buttonl 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     y The ReadLEDStatus function sends a Modbus PDU to the CUBLOC asking for the value in  register 0x0000  the value of port 0   then waits for a response from the CUBLOC     y The ChangeLEDStatus function sends a Modbus PDU to either set the value in register  Ox0000 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     y The port DataReceived event handler receives a Modbus response PDU from the  CUBLOC  stores the PDU in the response buffer  then notifies the form that the response  has been received     3  Finally when the form closes  the form s Close event fires  calling the Forml Closing event  handler  This event handler closes the CUWIN s serial port        Comfile Technology    CUWIN 5000 6000 CWV Series   User s Manual 71 of 73    Running the Program    We are now ready to run the program                                      1  Execute the CUWIN program from Visual Studio         O  x    Form1    Toggle    ac      re  oe ie nate    OUTPUT   A D N  Ta TOGGLE N   PUSH S W    T      a e     E    Et
6.  8  We are now ready to begin the installation  Click the    Install    button to begin        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 36 of 73    ie CUWIN2450 Setup    Installing CUWIN2450    Please wait while the Setup Wizard installs CUWIN2Z450  This may take several  minutes     Status  Copying new Files    Cancel       9  The SDK will begin installing  Wait for it to finish     ie CUWIN2450 Setup    Completing the CUWIN2450  Setup Wizard    Click the Finish Button bo exit the 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 CUWIN 5000 6000 CWV Series   User s Manual 37 of 73    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 ee Bo Miei ee Hd    7   g   Microsoft Security Essentials  Paint    Hi Files and Settings Tr   Wizard         Microsoft Silverlight          T  Microsoft SQL Server 2005 b                in Microsoft Visual Studio 2008 j Visual Studio Remote Tools j    All Programs     fin Microsoft Windows SDK v6 04    pal Lag Orr       Turn OFF Compute  im    
7.  Backward  Navigate Forward  Next Task  Previous Task    Property Pages    Ctrl Ww  L  Ctrlew  5  Ctrlew  C  Ctrl w  D  Ctrl w  J    Ctrl W  E  Ctrl W  O  Ctrl W  P  Ctrl  T  Ctrl  X    Shift 4lt Enter    Ctrl      Ctrl  Shift      Shift  F4       Ss 3    FS  4     A Solution  Helloworld   1 project      47  Helloworld   He Properties   5  References   H E  Formi cs     ey Program cs    Properties Ix    aooo    GenerateMember True  Location 70 265  Locked False  Modifiers Private  497  123  0  True    button1  True    Visible    10  If the    Properties    window is not yet displayed  select    View     gt    Properties Window    from the  menu  and it should appear in the bottom  right hand corner of the screen        Comfile Technology    CUWIN 5000 6000 CWV Series   User s Manual    42 of 73    23 HelloWorld   Microsoft Visual Studio       File    Edit view Project Build Debug Data Tools Test Window Help    Bid  el gw    fa  9    gt  Debug   Any CPU         Pocket PC 2003 SE Emulator    SA       Q     t  EE   ee    Ki    Ee ie E a BLE a          X       Form1 cs  Design   Start Page 2    A       Say Hello            mainMenu1       Ready    A 7   Solution Explorer   HelloWorld   HX    SB SAEs  od Solution  HelloWorld   1 project      2  HelloWorld  H  Sa  Properties  H  g References  H  EE  Formi cs  c   Program cs    Properties  I X    button1 System  Windows  Forms  Button X    EEA  GenerateMember True A  Location 70  265  Locked False  Modifiers Private  Size 497 123  T
8.  CUBLOC     g    New Project   Ea    Project types  Templates     NET Framework 3 5 b   E      E  Visual C    isual Studio installed templates  Windows  Web FE Smart Device Project          Smart Device       Office My Templates       Database   Reporting   Test   WLP   workflow  WH  Other Languages       okher Project Types      Test Projects    2  Search Online Templates          Solution Mame  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   ToggleLED    Target platform        NET Compact Framework version    MET Compact Framework Version 3 5 s    a 2s    Description     Templates     Device Class Library Console Control Library Empty Project    4 project For creating a  WET  Application Application pro  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    project just as we did in the previous exercises        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 64 of 73    eLED   Microsoft Visual Studio  it t Build Debug Data Format Tools Test Window Help    Any CPU       ael     FS  60  Solution    ToggleLED   1 project     ToggleLED  H Properties  H  E References  H  E  Formi cs  PA    Program cs    Tahoma  10pt  ForeColor HB Controltext  GenerateMember True  Location  Locked False  Modifiers Private 
9.  H Size  Tag  Text          Error List  5  Command Window         3  Add a label and a button to the form  Label the button    Toggle    and the label    LED State           Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 65 of 73    38 using System    39 Deming System  ConponentMedell   40 using System Windows Forms   4  using System IO  Ports     a eee ToggleLED   44     45 public partial class Eor ET Eor   46     47 Public Formi    48     49 InLtializeComponent Q    50     51   52 private SerialPort port    34 private void Forml Load object sender  EventArgs e   55     56   Configure the serial port   57 _port   new SerialPort      58 _port BaudRate   19200    59 _port DataBits   8    60 _port Parity   Parity None    61 _port StopBits   StopBits One   2   63   Open the serial port   64 _port Open        65     66   67 private void Forml Closing object sender  CancelEventArgs e   68     69   Close the serial port   70 _port Close       71     I2     NE    4  Add the code above to the form s Load and Closing event handlers  This will configure the  CUWIN s serial port and open it when the form loads  When the form closes  the the serial port  will be closed        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 66 of 73    1 Weare   2using  3 Uen  4using  5 using    6    System   System ComponentModel   System Windows Forms   oyo tem  TO  POLES   System  Threading     7 namespace ToggleLED    8     9  10  11  12  13  14  15  16  17  18  19  20  21
10.  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 you received it  if any  The terms also apply to any  Microsoft      updates     supplements       Internet based services  and       7  Read the license agreement and  if you agree  click the    Accept    button     O Not Connected       8  Windows Mobile Device Center will open  and will indicate a status of    Not Connected           Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 23 of 73    e                 opd  Eg    a  ay          9  Using a USB cable  connect the CUWIN to the PC     kA        0 Your device is ready to use        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           Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 24 of 73    Windows      Mobile    Q      Q   Set up your device   f    ang j A B    pery  ee aar  e mal aoda    3 tr   Y wr 1   J  information on your device     Connect without setting up your device       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 rea
11.  Settings     Then click the    Start Visual Studio    button        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 38 of 73         Start Page   Microsoft Visual Studio  File Edit View Tools Test Window Help           fd wits  E E  i a   A v O e  amp     5 a ga       Start Page       Microsoft     Visual Studio 2008    Recent Projects MSDN    isual C  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 doesnt seem to provide  anything new  You may wonder why we need yet another way to store  objects  In this article  I l explain the drivers behind creating a new  Project    collection type  how the SortedSet T  stores its objects   Project     Using IntelliTrace to debug Windows Azure Cloud Services  Thu  10 Jun 2010 18 30 00 Z   Jim Nakashima tells about new Features in  Getting Started Windows Azure Tools for Microsoft visual Studio   f   isual Studio 2010 Pro Power Tools  What S ISW n Visual CF  a Tue  08 Jun 2010 05 25 00 Z   Download a set of Microsoft Visual Studio  Create Your igs Application 2010 extensions with Features to enhance your productivity   peaa a Protecting Intellectual Property with  NET Obfuscation  Downlo
12.  Signing     C  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 Form1 Load event handler        This event handler configures the COM1 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 Form1 Closing event  handler  This event handler closes the COM1 serial port     3  When we touch the    Say Hello    button  the button s Click event fires calling the    buttonl 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    CUWIN 5000 6000 CWV Series   User s Manual    50 of 73    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 all recent versions of Windows                  fy Set Program Access and Defaults      EMS    Windows Catalog  Jej   Administr  fot to windows Update                   a E a Accessories d fm  Accessibility d    Internet Explorer     Games J fa Communications    Se HyperTerminal                          g a E mail Startup F fm  Entertainme
13.  Technology CUWIN 5000 6000 CWV Series   User s Manual 10 of 73    Found New Hardware Wizard    Please wait while the wizard searches         Samsung LS  USB Sync     lt Back   Next  gt  Cancel       5  The PC will begin searching for a suitable driver  Wait for it to finish     Hardware Installation    A The software you are installing for this hardware     Samsung LSI USB Syne    has not passed Windows Logo testing to venty its compatibility  with Windows XP   Tell me why this testing is important      Continuing your installation of this software may impair  or destabilize the comect operation of your system  either immediately or in the future  Microsoft strongly  recommends that you stop this installation now and  contact the hardware vendor for software that has    passed Windows Logo testing     STOP Installation       6  When it locates the driver  it will display a dialog box as shown above  Click the    Continue  Anyway    button        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 11 of 73    Found New Hardware Wizard    Completing the Found New  Hardware Wizard    The wizard has finished installing the software for       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 CUWIN 5000 6000 CWV Series   User s Manual 12 of 73    ActiveSync  Windows XP     After the USB driver has been installed  Activ
14.  a Ra ar   E E mer dS eh Ss  x Formi cs Form1 cs  Design    Start Page  x Bese eee IX      lf a      fi D  ai   Ag Helloworld Form1 v 3 button _Click object sender  EventArgs e  v   SME 2  ca   5 J using System     od ee HelloWorld   1 project   j indri   aj ET  using System Ling  a  E      Build  using System Collections Generic  a  H    using System  ComponentModel  Ex d Rebuild  using System Data  H q Deploy  using System Drawing  clean  using System Text   tusing System  Windows  Forms  Add a  Add Reference       namespace HelloWorld  i R Add Web Reference     E public partial class Formi   Form a View Class Diagram        Set as StartUp Project  E public Formi        Debug  gt     InitializeComponent     Properties  4  Cut  E    HelloWor      Ss private void buttoni_Click object sender  EventArgs e       ezg Li X  Remove         MessageBox Show  Hello     Output      Unload Project    Rename       Project    Open Folder in Windows Explorer    Change Target Platform     Target        iz Properties       Framework   ersion    w  The Version of the  NET Compact Framework this   lt   gt      project targets        Ready    13  We are 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 Projec
15.  formats  Remote Terminal Unit  RTU  and American Standard Code for  Information Interchange  ASCII   The RTU format encodes each PDU in a compact  binary form and  uses a Cyclic Redundancy Check  CRC  to verify the integrity of the transmission  The ASCII format  encodes each PDU as a set of ASCII characters and uses a Longitudinal Redundancy Check  LRC  to  verify the integrity of the transmission     Modubus request PDUs 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 PDUs 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     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 o
16.  if amaai       a   Fp Pl       E  sk  E       LITT TTAR  j  PEEEECECELEHEES ress  br       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     72 of 73       Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual    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 PDU s CRC dynamically  we are not  checking the response PDU 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 CUWIN 5000 6000 CWV Series   User s Manual 73 of 73    
17.  screen and will be sent to the    CUWIN     Running the Program    We are now ready to run the program        1  Once again  execute the CUWIN program from Visual Studio        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 57 of 73       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 CUWIN 5000 6000 CWV Series   User s Manual 58 of 73    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 Protocol Data Units  PDUs      Modbus supports two PDU
18. 0x01  0x05  0x00  0x00  0x00  0x00  OxCD  OxCA              send request  _port Write  request  0  request Length         Wait for a response  _evt WaitoOne       _evt Reset        Otherwise turn off LED    7  Add a function called ChangeLEDState that sends a Modbus PDU to the CUBLOC to turn the LED  on or off  and waits for a response PDU from the CUBLOC   evt WaitOne     The response  PDU from the CUBLOC is not needed  so it is ignored        Comfile Technology    CUWIN 5000 6000 CWV Series   User s Manual    69 of 73    104  105  106  107  108  109  110  111  112  113  114  115  116  117  118  119  120    20  21  22  23  24  25  26  7  28  29  30  31  32  33  34  35  36  a7  38  39  40  41  42  43  44    private void buttonl Click object sender  EventArgs e                 Is LED on or off   bool isOn   ReadLEDState          Toggle LED  ChangeLEDState   isOn         Confirm  Is LED on or off   1sOn   ReadLEDState           Update label   if  isOn   labell Text    On     else  labell Text    NOE       8  We now have functions for 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     Ivers VWeieuiol Moremi    Ine  OlewSee SSiNClos  li Vemeeings    S          j      Configure the serial port  JOOS WS Seige lS erec  SOc Ba Udar on   i S2z0 0     omc  DELLS   8    JOOISE eee 
19. 2  Use your favorite terminal program  in this case PuTTY  to establish a serial connection at  115200 baud  8 data bits  1 stop bit  no parity  and no flow control     3  On the right side of the CUWIN set dip switch 3 to ON and the rest OFF        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 27 of 73                4  Reboot the CUWIN and a configuration menu will appear                 5  Type    C    to bring up the    Bootloader Configurations    menu                 6  Type    7    to configure the MAC address  Enter a hexadecimal MAC address of your choice  In  this example    00 00 12 34 ab cd        7  Reset the dip switch on the right side of the CUWIN and reboot        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 28 of 73    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 
20. 4 Head       Ctrl Shift 5       Save All       Export Template           C  4 0  the Dynamic k    Fri  18 Jun 2010 17 35 01  programmer who struggle  objects that are beyond    the burden by going dyn    Featured Resources f    on aoa Sa a E D a E a i a    Fage Setup           Frink    Ctrl P        Exit    4  Select    File     gt     New        gt    Project       from the menu        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 39 of 73    New Project    Project types  Templates     NET Framework 3 5     El    El  Visual C    isual Studio installed templates  Windows  Web FEl Smart Device Project    Smart Device     Office   My Templates   Database   Reporting   Test   wW F   workflow  H  Other Languages   l  Other Project Types     Test Projects    Al Search Online Templates          Solution Mame  Create directory For solution    an       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    Target platform           T T A rr  EJE        sa Description   Device Class Library Console   Control Library Empty Project  pplication Application    WET Compact Framework version     Peer ea    Templates     4 project For creating a  WET  Compact Frame
21. CUWIN    9000 6000 CWV Series    Microsoft Windows Embedded CE  Touch Controller    LT Windows Embedded CE 6 0       User s Manual    2014 10 01       Everything for Embedded Control     TECHNOLOGY  Comfile Technology Inc     www cubloc com  Copyright 1996 2010 Comfile Technology       Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 1 of 73    Table of Contents    PROTAGCE iaincsterscaninsivanesoheiantaiatawnseniannianriawnkeiawonkdurt ae a a a araoa 3  OVEFVICW E O a E EA 4  Powering On the CUWIN for the First Time                   cccccce eee e essen eee eee eeeneees 6  Setting the CUWIN s Operating MOde        ccccsccccccscueeteceuceseueeseueeseuatseuatesuntesenns 6  POWernG  Ol tne CU WIN pincecise cess toreni isan iutiasborauaemeaehintas el ia ata eee 7  Connecting the CUWIN to a Personal Computer  PC                 cccceeeeeeeeeeeeeees 9  Motaln Pe USB  Diy CV rresia niaaa a a aa a a a i 9  ACUVESVNG  CWINGOWS XP xc catnenacntiesinenestainns eE ENET 13  Windows Mobile Device Center  Windows Vista  7      cccceeeseeeteeeeeeeeeeeueeeensanenans 21  Setting the CUWIN   s Ethernet MAC AddreSs               ccc ccc cece cece eee eens 27  CUWIN  5XXX Q OXXX orii N evans OEEO 27  CUWINCWYV SONGS iiini a AE aa a AAA 27  Developing Software for the CUWIN            usususssnsnsnnrnrrsnrrrnrnnrrrrrrrnrrnrrnrnnrn 29  Installing Vistal  Studio 2008 nsango aar A 29  Installing the CUWIN Software Development Kit  SDK       ssssssssssssnsrrrrrnrrrrrrerne 33  Creating Ou
22. Corporation  File origin  Downloaded from the Internet            Show details       Change when these notifications appear       3  If you are presented with a    User Account Control    dialog  click the    Yes    button        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 21 of 73       te     Driver Update                   4  Windows Mobile Device Center will begin installing  Wait for it to finish     Windows Mobile based device support  gt     Device driver software installed successfully                        Default Programs   at Desktop Gadget Gallery     Internet Explorer   Korea Media Player Center   amp 9 Korea Messenger Center   amp  Windows Anytime Upgrade  E  Windows DVD Maker   bag Windows Fax and Scan   E Windows Media Center      i Pee ee e e eee E e     nag Hs Y AEC CECILO fh        ey Windows Update  s   XPS Viewer   di Accessories   d Games    di Maintenance  d Startup     Search programs and files       5  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    6  Run    Windows Media Device Center    from the Windows Start Menu        Comfile Technology    CUWIN 5000 6000 CWV Series   User s Manual 22 of 73       MICROSOFT SOFTWARE LICENSE TERMS 3    MICROSOFT WINDOWS MOBILE DEVICE  CENTER 6 1    These license terms are an agreement between
23. Down   lt  gt    H5crollBar     sy  ImageList    l j i      X Solution Explorer   HelloWorld  4 x      E e  2    2  EL  amp  amp   lod Solution  HelloWorld   1 project     a  HelloWorld  Sa  Properties    3 References      Form1 cs  c  Program cs    KOGIOO   we     E E    A Label  A LinkLabel     ListBox   33   ListView      MainMenu   4  MessageQueue    MonthCalendar   2  NumericUpDown   2  OpenFileDialog   E  Panel   val PictureBox       ProgressBar       RadioButton     SaveFileDialog   w SerialPort      Splitter vii             Ready    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 CUWIN 5000 6000 CWV Series   User s Manual 41 of 73    i  3    H           Form1         Any CPU    Toth ale   S  So Ek            3 v  oj Od   A Solution  Helloworld   1 project       PE HelloWorld  E Properties  H  References  a  EE  Formi cs  o G    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      cir pepe  f eot Project       Code   Designer   Server Explorer  Solution Explorer   Class View   Code Definition Window  Object Browser  Tab Order   Error List   Output   Properties Window  Task List   Toolbox   Find Results   Other Windows  Toolbars   Full Screen  Navigate
24. 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 Framework     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    At the time of writing this document  Visual Studio Express editions didn t support smart device  development  Also  at the time of writing this document  Visual Studio 2010 didn t yet support smart  device development  Therefore  Visual Studio 2008 will be our development environment of choice for  this document     This document will only show the installation process for Windows XP  the but 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 Eos  day trial version at  ft        25635db0192b  The downloaded file must be burned toa DVD  Use a DVD Suir to burn the  x iso image to a DVD disc     2  Insert your Visual Studio 2008 DVD into your DVD drive to begin the insta
25. OxFFOO Turn the LED on   Ox8C3A CRC       The CUBLOC will respond with the following Modbus PDU  an echo of the request                           Value Description   0x01 Slave Address 1   0x05 Read Bit   0x0000 Register Address O  Port 0   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 PDU                          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 PDU  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    CUWIN 5000 6000 CWV Series   User s Manual          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    Sel  File Edit Device Run Setup Help  Ball g JBA rmi B     F1  BASIC    F2  LADDER   Ladder Mnemonic                                          1 Const Device   CB2E0  Using CUBLOC CBZE0   2 Opencom 1 19200 3 50 50  Serial Port Settings   3 Set Modbus 1 1 20  Modbus Settings   4   5 Ramclear  Make sure o
26. 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 CUWIN 5000 6000 CWV Series   User s Manual 5 of 73    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     memnun  123456    L c O O O O                                              Position  Position Function Mode 1 2 3 4 5 6   Boot Device Reserved Off   5000 6000 Series    NAND Flash On  i Boot Device NAND Flash Off   CWV Series  Reserved On   Reserved On On   Jaz ooi ade Auto Run Mode On Off   Development Mode Off Off   OS Image Download Mode Off On   4 5  and 6 Reserved Reserved                               Development Mode  For the exercises in this document we need to set the CUWIN s operating mode to Development Mode   5000 6000 Series  1 On  the rest Off  CWV Series  All Off   AutoRun Mode    To configure the CUWIN to automatically start when the system boots  create the folder     Flash  Disk AutoRun    and copy the   exe fil
27. abIndex 0  TabStop True  Tag  E sov eo y    visible True v  Text  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                            Forml cs    Formi cs  Design     Start Page X    g Halloworld Form1 v   3 button1 _Clickfobject sender  Eventargs e  wt  15 using System  F   A using System  Ling     3 using System Collections Generic   4  using System  Component Model   5 using System Data   5i using System Drawing   7 using System  Text   a using System  Windows  Forms   J  10 namespace HelloWorld  11i      e public partial class Formi   Form  13    F  14 public Formit   15  i  16  InitiallzeComponent       17     18   19  private void buttonl Click  object sender  EventArgs ej  20     21 MessageBox  Show  Hella      a    23     24ib  y   lt  a    12  Now  double click on the button and you will be taken to the button 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 Technolo    gy CUWIN 5000 6000 CWV Series   User s Manual 43 of 73    23 HelloWorld   Microsoft Visual Studio       File Edit View Project Build Debug Data Tools Test Window Help                                           EAERI a N  IF eee E  gt  Debug   Any CPU       OS st Bla        BR A c  jF F 3 E  Pocket PC 2003 SE Emulator do a daad
28. ad Additional Ca terk Mon  07 Jun 2010 17 55 00 Z   Learn about common obfuscation techniques  MSDN Forums for  NET applications   visual C  Developer Center Parallel Programming in  NET Framework 4  Getting Started  Extend Visual Studio Wed  02 Jun 2010 17 45 00 2   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    isual Studio Headlines to suit your standards   New IDE Features in   isual Studio 2010 for C  Developers  Wed  12 May 2010 19 15 00 Z   An overview of the new C  IDE features in  Visual Studio 2010  Call Hierarchy  Navigate To  Highlight References     Generate Fram  leane and TntelliSence iranrnvement lt     Microsoft SDL Team Releases the  MSF Agile  SDL Process Template  for   isual Studio 2008         v        lt     Ready       3  Visual Studio will open to the    Start Page     Now we need to create a project         23 Start Page   Microsoft Visual Studio    Edit view Tools Test Window Help  Project    Ctrl Shifk h                   Web Site    Shift Alt M       Close File    Ctrl h              Close Solution       Project From Existing Code       teditems ctis PSSST ease    ted Items 45                 Save Sele          Save Sele         MSDN    isual C
29. already installed     Microsoft Windows Installer 3 1    MICROSOFT VISUAL STUDIO 2006 PROFESSIONAL EDITION AND TRIAL  EDITION    These license terms are an agreement between Microsoft Corporation for  based on where you live  one of its affiliates  and you  Please read them   E Setup will install the following components  They apply to the software named above  which includes the media on which a  Microsoft NET Framework 3 5  Microsoft Document Explorer 2008    Microsoft Visual Studio Web Authoring Press the Page Down key to see more text   Component    Microsoft Visual Studio 2008      I have read and accept the license terms    I donot accept the license terms     Product key   APWEC egy KOCEM SOW GFO SW    Mame     To install  you must accept the End User License Comfile Technolog      greement and enter your product key      lt Previous        meea       5  Read the license agreement and  if you agree  check the    I have read and accept the license  terms     Enter an appropriate name in the    Name    text box and click the    Next    button        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 30 of 73    F Microsoft Visual Studio 2008 Setup   Options Page    Microsoft        Visual Studio 2008 setup    Select features to install  Feature description         Default    This option allo ou to select which features y ant t  Installs the recommended features for the product Be Ne Sd ae ae OTN E E rey AO To    install         Full    lngtalls all features fo
30. and template in the next dialog box   Name  HelloHyperTerminal    Location  C  Documents and Settings 4dministrator My Documents visual Studio 2008 Projects we    Solution Name  HelloHyperTerminal Create directory For solution  an       1  Create a new smart device project as we did for HelloWorld  and name it HelloHyperTerminal     Add New Smart Device Project   HelloHyper Terminal F  x     Target platform  windows CE we     NET Compact Framework version    MET Compact Framework version 3 5 s    Templates  o      er ke a   Description   Device Class Library Console Control Library Empty Project A project For creating a  NET  Application Application 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 CUWIN 5000 6000 CWV Series   User s Manual 47 of 73       23 HelloHyper Terminal   Microsoft Visual Studio    File Edit View Project Build Debug Data Format Tools Test Window Help                a  oda  amp  Ha  I  b Debug z Any CPU      Ol SF 9 ot B 1    CUWIN2450 ARMY4I Device    gb fal ee  a ee a ee ere  e  X Formi cs Formi cs  Design  Start Page   x Solution Explorer   HelloHyperT    Ix  5  3A Solution  HelloHyperTerminal   1 project     4  HelloHyperTerminal  H Sa  Properties  H  3  References  B  ES  Formi cs     Formi Designer cs     Formi  resx  c   Program cs   lt   gt   Prope
31. 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 COM1 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 COM1    serial port                             se         s       e     te        i     3    e  ce  e  te  e  eo   a     sts  e e                  You should now have two connections between the CUWIN and the PC  USB and RS 232        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 46 of 73    New Project    Project types  Templates  WET Framework 3 5 w  E     El  visual C    isual Studio installed templates  windows  Web G2  S5mart Device Project    Smart Device    Office My Templates   Database   Reporting   Test   oo AIL   workflow  E  Other Languages  Other Project Types      Test Projects    Search Online Templates       4 project For Smart Device applications  Choose target platform  Framework version  
32. ataReceived    new SerialDataReceivedEventHandler    _port DataReceived       TOO CHOSiN       void port DataReceived object sender  SerialDataReceivedEventArgs e        Update label1 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 CUWIN 5000 6000 CWV Series   User s Manual 55 of 73    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 C  3 0  See the Microsoft Development Network  MSDN  documentation for Control Invoke  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     CUWIN Properties    Connect To Settings    Function  arrow  and ctrl keys act as  O  Windows keys    Backspace key sends       Cih     Del     Ctrl H  Space  Ctri H    E
33. connected to the PC  Click the    Explore    icon        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 19 of 73    E Mobile Device    File Edit View Favorites Tools Help    O Back     a p2 Search Wey Folders    Address A Mobile Device    Other Places oe i  Applicaton    Data       vb       Recycled    Flash Disk My Documents    Windows       Network Program Files    ke    Control Panel   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    CUWIN 5000 6000 CWV Series   User s Manual    20 of 73    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     1  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 aspx   Familyid 46F 72DF1 E46A 4A5F A791 O09FO7AAA1914 amp displaylang en                ER yf    File description  Wins2 Cabinet Self Extractor  Company  Microsoft Corporation   File version  60 5624 1638 7   Date created  6 23 2010 1 42 PM   Size  12 0 MB       2  Run the downloaded file     H User Account Control       Do you want to allow the following program to make    changes to this computer        Program name  Windows Mobile Device Center  Verified publisher  Microsoft 
34. d 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        P   y Connected Q  Mobile Device Settings  ae       12  Under    File Management    click    Browse the contents of your device           Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 25 of 73           al  x      _  oY Co    wT Favorites   Flash Dick  E Desktop Ss 9 52 MB free of 9 65 MB  7  p Downloads    w  Recent Places          Network       G Libraries     3 tems    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 CUWIN 5000 6000 CWV Series   User s Manual 26 of 73    Setting the CUWIN   s Ethernet MAC Address    CUWIN 5xxx  amp  6xxx    For the CUWIN 5000 and 6000 series  you can set the CUWIN   s MAC address by running the Macutil  program from the Windows CE Desktop                 1  Select    2450    and use the buttons to set the last two bytes of the MAC address  The first four  bytes are fixed     2  Press the    Save    button and the new value will be committed to the devices registry   Press the    Close    button when finished     CUWIN CWV Series    For the CUWIN CWV series  you must boot the device in a special mode to bring up the configuration  console     1  Connect a serial cable from a PC to the CUWIN   s Com 3 Serial port     
35. e    Connect Using    drop down list  select the serial port you wish 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    Fort Settings                        Bits per second  Data bits  rm    Parity    Stop bits  ra                      Flow control                       Restore Defaults   ok    Cancel   Arch                                    6  A new dialog will appear asking for your port settings  These settings must match those  settings made in the Forml 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 CUWIN 5000 6000 CWV Series   User s Manual 53 of 73                Start Debugging  FS     7  Execute the CUWIN program from Visual Studio        8  The form will display on the CUWIN  Click the    Say Hello    button     CUWIN   HyperTerminal Sl    7  dib ten Oo T y  nye  i  m  Eq LC view    al drar ISI Cr af       9  Take a look at the PC s HyperTerminal window  You will see the    Hello     message sent from the  CUWIN        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 54 of 73    17  18  19  20  21  22  23  24  29  26  21  28  29  30  31  32  33  34  35  36  37    Reading from the CUWIN s Serial Port    We have successfully built an program that writes data to the CUWIN s serial port  sendi
36. e to execute into that folder  Then configure the device for  AutoRun mode     5000 6000 Series  1 On  2 On  the rest Off  CWV Series  2 On  the rest Off       Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 6 of 73    Powering On the CUWIN       Power  Switch       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 CUWIN 5000 6000 CWV Series   User s Manual 7 of 73    My Device         Recycle Bin    f   Ed  Intemnet  Explorer    oo   Windows Embedded CE 6 C  b    Media Player    ull    SaveRegs       Fg    Ran EN EE PM lal    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  CUWIN 5000  amp  6000 series only    5 Media Player Windows CE Media player for playing audio and video files    6   SaveRegs Utility to permanently save any changes to the device s registry    7 Sta
37. eSync  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     1  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    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 4dministratoriDesktop       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    dialog box appears  click the    Run    button              Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual    13 of 73    i  Microsoft ActiveSync 4 5    Microsoft ActiveSync 4 5    Welcome to Microsoft Activesync 4 5 Setup    Click Next to install Microsoft ActiveSync 4 5 on your computer        4  On the following screen  cl
38. ff            Whats    Your  status                First the CUWIN must ask the CUBLOC if the LED is on or off        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 59 of 73       Then  the CUWIN will tell the CUBLOC to turn the LED on  if the LED was off   or off  if the LED was    on      The following Modbus PDUs 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 PDUs 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 PDU                          Value Description   0x01 Slave Address 1   0x02 Read Bit   0x0000 Register Address O  Port 0   Ox0001 Read only 1 bit   OxB9CA CRC          If the LED is off  the CUBLOC will respond with the following Modbus PDU                             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 PDU                          Value Description  0x01 Slave Address 1  0x02 Read Bit   0x00 1 Bit Read   0x01 LED is on  0x6048 CRC             Comfile Technology    CUWIN 5000 6000 CWV Series   User s Manual    60 of 73    Turning the LED On   To have the CUBLOC turn the LED on  we issue the following Modbus PDU                             Value Description   0x01 Slave Address 1   0x05 Write bit   0x0000 Register Address O  Port 0   
39. hat you can attach event handlers    Properties       Formi System  Windows  Forms  Form ki    SE   DataBindings   Activated  Click   Closed                 gt     Deactivate   Doubleclick    EnabledChanged   GotFocus   HelpRequested w    Closing    Occurs Whenever the user closes the Form   before the Form has been closed     to  Double click the    Closing    event and a Form1 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 buttonl Click object sender  EventArgs e            Send  Hello   to HyperTerminal  _port Write   Hello  r n        7  Go back to the    Formi 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    CUWIN 5000 6000 CWV Series   User s Manual    49 of 73    HelloHyperTerminal    Formi cs    Formi cs Design      Start Page       4oplication   Build   Build Events  Debug  Resources  Reference Paths    Signing       Devices       Deployment Options    Target device     CUWIN2Z450 ARMY Device w                           Output File Folder   SSIDL_ PROGRAM FILES  HelloHyperTerminal   ial                                                          C  Deploy the latest version of the NET Compact Framework  including Service Packs     4uthenticode
40. he phone 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  This settings are not necessary for this experiment   but HyperTerminal requires it  After you are finished  click the    OK    button        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 51 of 73    Phone and Modem Options    Dialing Rules      3 a The list below displays the locations you have specified  Select the    location from which you are dialing     Locations     Location Area Code     OlMy Location B55    Apply       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    Da Ss  DF    Connection Description  WE 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  configure the PC s serial port  Enter    CUWIN    in the    Name    textbox and click the    OK    button        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 52 of 73    Connect To    Enter details for the phone number that you want to dial     Country regiory     Connect using  co he E                                                 5  In th
41. ialog  accept the default or change the destination folder  Then  click the    Next    button        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 15 of 73    ie  Microsoft ActiveSync 4 5    Ready to Install the Program    The wizard is ready to begin installation     Setup is ready bo 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     ie  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  maw bake several minutes     skatus     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 CUWIN 5000 6000 CWV Series   User s Manual 16 of 73    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 Setup is  complete     Click the    Finish    button     Help    Show Details          11  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 show
42. ick 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 for  based on where you live  one of its affiliates  and you  Please read therm   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  Ww    G1 accept the terms in the license agreement     O I do not accept the terms in the license agreement            5  Read the license agreement and  if you agree  accept the license agreement and click the     Next    button        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 14 of 73    ie    Microsoft ActiveSync 4 5    Customer Information    Please enter your information     User Name        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    Click Next to install to this Folder  or click Change to install to a different Folder     Install Microsoft Activesyne 4 5 bo     C  Program Files Microsoft Activesync     Volume Disk  Size Available Required Differences  ac  3906 J666 34MB 36GB          7  On the    Destination Folder    d
43. ing a status of    Not  Connected           Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 17 of 73           Phar a   4        Pa     s   w  9 K        x x x     J a           12 Using a USB cable  connect the CUWIN to the PC     gm  Fa  m  A     T  en  3  a  al                 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        18 of 73    CUWIN 5000 6000 CWV Series   User s Manual    Comfile Technology    New Partnership    Set Up a Partnership    Before you can synchronize information between your  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  File View Tools Help    F i     Aa  Sync g Schedule kay Explore    Show Details       v dy Se CA  4 54 PM       15  ActiveSync will now show a status of    Connected     and the ActiveSync system tray icon will  change indicating the CUWIN is 
44. l MSDN documentation and other updates from this  screen  Make your choice or click the    Finish    button        Comfile Technology    CUWIN 5000 6000 CWV Series   User s Manual    32 of 73    is Visual Studio 2008 Setup    Microsoft     Visual Studio 2008 Setup    Repair  reinstall  or install additional Visual Studio 20086  features  You can also uninstall Visual Studio 2008     Install Product Documentation  Install the MSOWN 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        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     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    Fr      got    rel NES    Type  Windows Installer Package    Author  Combile Technalgoy   Title  Installation Database  Subject  CUWIN24 50   CUWINS 450
45. lication     Device      CUWINE450 ARMY Device   Pocket PC 2003 Device   Pocket PC 2003 SE Emulator   Pocket PC 2003 SE Square Emulator   Pocket PC 2003 5E Square YGA Emulator   Pocket PC 2003 5E YGA Emulator   USA Windows Mobile 5 0 Pocket PE R2 Emulator   USA Windows Mobile 5 0 Pocket PC R2 Square Emulator  USA Windows Mobile 5 0 Smartphone R2 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  If a    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     ie     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 CUWIN 5000 6000 CWV Series   User s Manual 45 of 73    Interfacing the CUWIN 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 
46. ll 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 CUWIN 5000 6000 CWV Series   User s Manual 3 of 73    Overview    The CUWIN is a Windows Embedded CE touch controller primarily targeted for use as a Human  Machine Interface HMI         EF Windows Embedded CE 6 0    T J   Fii i i fics r      a    ERF       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     SOEard    Audio    Power       The CUWIN s rear and side panels feature several interfaces  RS232 485  USB  Ethernet  Audio  SD  Card  for communicating with many different electronic devices        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 4 of 73    EY Windows Embedded CE 6 0           TCP IP  UDP          O               r aw  hy  W Eag    E E E i E  SD Card Speakers  CUBLOC  PLC aol   8  g  intenet Wifi  other audio rd   lt 5  28       Server   HTTP  database   FTP  other server       The CUWIN translates input from a human user to signals that electronic devices can 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      
47. llation   fy Visual Studio 2008 Setup    Microsoft       Visual Studio 2008 Setup       Install   isual Studio 7008  Install Visual Studio 2008 features and required  components     View Reade       3  Click the    Install Visual Studio 2008    link to begin the installation        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 29 of 73    FS Microsoft Visual Studio 7008    Mii crosoft      Visual Studio 2008 Setup    Welcome to the Microsoft   isual 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           es  send information about my setup experiences to Microsoft  Corporation     Jip For 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     Fi Microsoft Visual Studio 2008 Setup   Start Page    Microsoft        Visual Studio 2008 setup    Please exit all applications before Be sure to carefully read and understand all the rights and restrictions described    continuing with the installation  in the license terms  You must accept the license terms before you can install the  software     MICROSOFT SOFTWARE LICENSE TERMS    i  Setup has detected that the following required  components are 
48. mart Device Pragrammability    Disk space requirements                                               Volume Disk Size Available Required Remaining  C  40 0 GE 36 6 GE 4 0 GE 32 6 GB    Micky Dothuscator Community Edition    a Mics Tools for Redistributing Applications  Emea Unit Testing Tools       r 2005 Express Edit    rma al o_o   E m   rm vr    P    E Ma L i 7 wE     lt  j   a             Restore Defaults Install       7  In 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        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 31 of 73    F amp  Microsoft Visual Studio 2008 Setup   Install Page    Mi crosoft       Visual Studio 2008    Installing Components     Microsoft  NWET Framework 3 5  Microsoft Document Explorer 2006  Microsoft Visual Studio Web Authoring  Component   Microsoft Visual Studio 2008   Microsoft MET Compact Framework 2 0  SP2   Microsoft MET Compact Framework 3 5  Microsoft Visual Studio Tools for the  Microsoft Office system  version 3 0  Runtime     Enable great Web experiences that  have AJAX support      Web developers can quickly  build applications that have  broadest possible reach and a  rich  browser based client  experience    Expressive and standards   compliant    Better collaboration between  designer and developer    Microsoft Visual Studia 2005 T
49. mulation       Auto detect                                                                Telnet terminal ID                                         Backecroll butter lines                      Play sound when connecting or disconnecting    Input Translation    ASCII Setup             1  In HyperTerminal with the CUWIN connection open  select File  gt Properties from the menu  The     CUWIN Properties    dialog will appear  On the    Settngs    tab  click the    ASCII Settup       button        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 56 of 73    ASCII Setup    ASCII Sending     Send line ends with line feeds       Line delay  i rollizecords     Character delay  i os   milliseconds     ASCII Recerving      Append line feeds to incoming line ends     Force incoming data to F 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        CUWIM   Hyper Terminal Sele  File Edit View Call Transfer Help     lt   Connected 0 00 41 Auko 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
50. ng 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 HelloHyper Terminal   Microsoft Visual Studio    Fie Edit view Project Build Debug Data Tools Test Window Help                a a  oid aw   143 9   b Debug   Any CPU z   ie eE a a aS  CUWIN2450 ARMV4I Device     a fl See  ee ee A r ee a 23  a m Z p7   Start Page   Formi cs  Formi cs Design    HelloHyperTerminal   X Solution Explorer   HelloHyperT      A X    A ka     2  HEA    x oqjoo j i ot    fod Solution  HelloHyperTerminal   1 project      FE  HelloHyperTerminal    a  Properties     Sj References     E  Formi cs   gt   Form1 Designer cs   gt   Form1 resx  cPC  a     Program cs     lt   gt   Properties   xX    labeli System  Windows Forms Label X                ezla   Font Tahoma  10pt A  ForeColor ControlText  Say Hello    GenerateMember True  Location 176  93  Locked False  Modifiers Private  Size 427 20  Tag     i Text PC  v   lt    TextAlign TopLeft v  Command Window   2X Text   gt  The text contained in the control   rr   Error List   54 Command Window  Ready    1  Add a    Label    from the Toolbox to the form  and label it    PC      by changing its Text property     Se iwetee Wwocl Weremll hoe  eleijoer SewCleic  liven eicge se      Teo Yew ioe rialPorte Comity   Com pore  TOZ 010      Baud Rate  Parity None  Parity  P Dar eee  OPB ts One  ee o o E      Listen for incoming data  _port D
51. nt F    Network Connections  al Outlook Express  ane E Internet Explorer fim  System Tools   Network Setup Wizard     we MSN WA Address Book  o New Connection Wizard       w Paint  7 e Microsoft visual Stud  9 MSN       windows Media Playe  33 Windows Messenger       Tour Windows sF    All Programs      Ea Outlook Express E Calculator Wireless Network Setup Wizard             Remote Assistance    i         windows Media Player    E command Prompt  r Notepad    W Paint        Program Compatibility Wizard             gt  Windows Messenger  eh Windows Movie Maker          Microsoft Activesync FE Remote Desktop Connection    iy Synchronize  g Tour Windows    P        A Microsoft Security Essentials  fm  Microsoft Silverlight         fim  Microsoft SOL Server 2005   er  Windows Explorer    A WordPad        fm  Microsoft visual Studio 2008 p        fan Microsoft Windows SDK v6 04      pe  Log OFF  9    Turn OFF Computer       na start F3 HelloHyperTerminal         1  Start HyperTerminal by selecting Start   gt All Programs   gt Accessories   gt Communications     gt HyperTerminal in the Windows start menu     Location Information    Before you can make any phone or modem connections   Windows needs the following information about pour current  location     What county region are you in now     United States ka    What area code  or city code  are you in now     ABA    IF You need to speci  a camer code  what is it     IF You dial a number to access an outside line  what ts it     T
52. omfile Technology CUWIN 5000 6000 CWV Series   User s Manual 9 of 73    Found New Hardware Wizard    Welcome to the Found New  Hardware Wizard    This wizard helps you install software for     Samsung LS  USB Sync    9 F your hardware came with an installation CD  LE or floppy disk  insert it now     What do you want the wizard to do     Q Install ne sottware suede a       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     Found New Hardware Wizard    Please choose your search and installation options     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 search           Clsctivesyne_usb cuwin5000 wl Browse               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         tek Jie    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        Comfile
53. ools for the    2007 Microsoft Office System Runtime  Microsoft SQL Server Compact 3 5  Microsoft SQL Server Compact 3 5  Design Tools   Microsoft SQL Server Compact 3 5 For  Devices   Windows Mobile 5 0 SDK R2 for Pocket  Br    Initializing Microsoft MET Framework  3 5     lt  Previous   Next  gt        Cancel    8  Visual Studio 2008 will begin installing  Wait for the installation to complete  It may take some    time     F amp  Microsoft Visual Studio 2008 Setup   Finish Page    Microsoft        Visual Studio 2008 setup    Success    2 Visual Studio Setup is complete     Visual Studio 2008 has been  installed     G  Documentation     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       Itis 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   You can do so by visiting this site     Cancel     lt  Previous       9  When the installation is complete  the above screen will appear  No further action is necessary   but if you wish  you can download and instal
54. r First CUWIN ProgramM         sessssessessssnsessnsnsnasnsonnasnsosnnenssennenueennnse 38  Interfacing the CUWIN to Other Devices             s sssssssssrsrrrnnrrnrrrrrrrrrrnrrnrrrne 46  R923 Zee ae a E S EEEE 46  Writing to the CUWIN s Serial POTE ssiiiweveiisnviveinavievinnst nana A AA 46  Reading from the CUWIN s Serial POrt        ssesenessnnssunnsnnnensrnnnnsnnenurnnensrnnrurne 55  MIOGIOUNS oree A E E E A E A 59  Using Modbus to Interface the CUWIN to the CUBLOC     s s sssssssrsrsrsrssrrsrsrrrene 59  Setting Up Mhe CUBLOC reriieataerea epic autoni EE ee Beoeeaneees 62  Programming  the  CUWIN eicaesociien aai A A a 64       Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 2 of 73    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 programming 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 a
55. r the product       Custom      Product install path   Select features to include and exclude from the oes    product C  Program Files Microsoft Visual Studio 9 0     Disk space requirements              Volume Disk  Size Available Required Remaining  L  40 0 GB 36 6 GB 4 0 GB 32 6 GB              lt Previous     N 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     FS Microsoft Visual Studio 2008 Setup   Options Page Si k     Microsoft       Visual Studio 2008 Setup    Select features to install  Feature description     omw Microsoft Yisual Studio 2008 Profession       es E Visual C  Smart Device Programmability       L Tool pE            ues Joa piia Use your existing Visual C  skills to build applications for     wey Visual CH the  NET Compact Framework  extending your software skills  E mez Smart Device Frogrammability to the rapidly growing world of mobile devices  Visual C   Smart Device Programmability provides everything you ll  need to build smart device applications  including      ee Visual C    o mes Smart Device Programmability    HO x s64 Compilers and Tools Feature install path     aM ak Visual C   Tools C  Program Files    Microgott Visual Studio 3 0  CH Browse       ee Visual C   Run Time Libraries      Egres Visual C   Class  amp  Template Librarie  Eines Visual Basic  a 4  oe  S
56. rns true If LED 12 On  fal   e if LED is Off  private bool ReadLEDState          slave address   0x01    function code   0x02   read bit    register address   0x00  0x00    read only 1 bit   0x00  0x01    crc   O0xB9  OxCA  byte   request     0x01  0x02  0x00  0x00  0x00  0x01  OxB9  OxCA         send request  _port Write request  0  request Length         Wait for a response    _evt WaitoOne       _evt Reset        pyte 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 PDU to the CUBLOC to read the state  of the LED  This function will wait for a response PDU from the CUBLOC   evt WaitOne      and examine the response  If the response PDU 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 CUWIN 5000 6000 CWV Series   User s Manual 68 of 73    76  71  78  79  80  81  82  83  84  85  86  87  88  89  90  9   92  93  94  95  96  97  98  99  100  101  102      If turnOn is true  turn on 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     cre   0x8C 0x3A  on   OxCD OxCA  off   byte   request   if  turnon       request   new byte        0x01  0x05  0x00  0x00  OxFF  0x00  Ox8C  Ox3A            else       request   new byte        
57. rt 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 CUWIN 5000 6000 CWV Series   User s Manual 8 of 73    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    The following instructions describe how to install the CUWIN s USB driver on the PC  Although the  instructions are illustrated using Windows XP  the same procedure should be followed for Windows  Vista or Windows 7           activesync_us     Size  115 KB  Files  secbulk inf  secbulk sys  wceusbsh inf  wceusbsh  sys       1  Download the    ActiveSync USB Driver  CUWIN5000 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           ae  Prine      ee    e       2  Using a USB cable  connect the CUWIN to the PC        C
58. rties IX             button1 System  Windows  Forms Button         7 2 SMEL    ForeColor BB controltext A  i i GenerateMember True    Say Hello Location 94  294    Locked False  Modifiers Private  Size 427 116  a TabIndex 0  TabStop True  Error List  4 xX Tag  Description File Line Column Project Lee Paar  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 syo tem    2 Using System  oe eae  3 using System Windows Forms   4 using System IO Ports     5    6 namespace HelloHyperTerminal    7  8  9  10  1   12  13    14  15    16  17  18  19  20  21  22  23  24  25  26  2i  28       Publio    partvaleeclass Porm y    Form  i  POU le Orage      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                  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        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 48 of 73    28  29  30  31  32    34  35  36  37  38    5  Go back to the    Formi cs  Design     tab  Select the form  and in the    Properties    window click  the lightning bolt icon      This will display all of the events t
59. t Build Debug Data Tools Test Window Help             cl   is  Fed a   De GA  b Debug   Any CPU       F398 BO   CUWIN2450 ARMY4I Device z Le al  4 Sk  X HelloWorld  Formi cs   Form1 cs  Design    Start Page   x Solution Explorer   HelloWorld  4 xX  a a 3 2   S Application lod    pas oF  1 project      w    HelloWor  Build   Sa  Properties  Deni t Onti    Sj References  Build Events T    EE  Formt cs  Target device  2  Program cs  Debug   CUWIN2450 ARMY4I Device v    Resources Output File Folder     YCSIDL_PROGRAM_FILES 1Helloworld Lisl    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 xXx       s a        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 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 CUWIN 5000 6000 CWV Series   User s Manual 44 of 73          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 app
60. the    Customer Information    dialog  enter the appropriate information the in    User Name     and    Organization    text boxes  Then click the    Next    button     iy CUWIN2450 Setup    Choose Setup Type  Choose the setup type that best suits your needs    Custom    Allows users to choose which program features will be installed  and where they will be installed  Recommended for advanced  USers     Complete  All program features will be installed   Requires most disk  space        6  Choose    Custom     If you choose    Complete    the installation may fail        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 35 of 73    ig 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    E Will be installed on local hard drive  E38 Entire feature will be installed on local hard drive    Entre feature will be unavailable hs                25 OKE on your       7  Remove the    Documentation    feature from the installation  If you don t do this  the installation  may fail     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       
61. ur memory is clean    7 Usepin 0  0ut  Use PO to light the LED  3 Set Ladder On  Needed to make PO light LED     Keep Running  don t exit       1  Using Cubloc 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  It  is not necessary to fully understand this program  If you want to learn more about  programming the CUBLOC  see the CUBLOC s user manual     MOT BOARD 1    z Epis 7       2  Connect the CUBLOC s I O port 0 to an LED  The image above illustrates how to accomplish  this using the CUBLOC Study Board        Comfile Technology CUWIN 5000 6000 CWV Series   User s Manual 62 of 73    CUWIN           6   ereot gy           CUBLOC  Study Board    La  L                  Ld              a                  5  C         a                                 oeee     80888  8 POS  ee  8   ot t  amp    amp  EUU       3  Connect the CUBLOC s serial port to the CUWIN s COM1 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 CUWIN 5000 6000 CWV Series   User s Manual 63 of 73    Programming the CUWIN    Now that the CUBLOC has been programmed to process Modbus PDUs  configured to light an LED  and  connected to the CUWIN  we need to program the CUWIN to send Modbus PDUs to the
62. work 3 5 Forms  application For Windows CE  Platform          Download additonal emulator images and smart device SOKS             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 CUWIN 5000 6000 CWV Series   User s Manual 40 of 73    23 HelloWorld   Microsoft Visual Studio       File Edit View Project Build Debug Data Tools Test Window Help    Al  al   eas a ar  amp   gt  Debug  gt  Any CPU     d el tts z   PiN 21  z  Pocket PC 2003 SE Emulator E Se a EE TE  A 4 tL     Forml cs  Design  Start Page  x Bea eg ix    ETE  21   A Solution  Helloworld   1 project     Helloworld       d  Properties     Qj References    ES  Formi cs  c   Program cs    XOq Oo   Ad         mainMenul       Creating project  HelloWorld       project creation successful     7  Finally  the project will open  and we are ready to start programming     23 HelloWorld   Microsoft Visual Studio  File Edit view Project Build Debug Data Tools Test Window Help    Gy ly A  E  IE Fa 4    gt  Debug 7 Any CPU   E eE Sa aS    it       Pocket PC 2003 SE Emulator  gt  ob ba a    All Device Controls      hm Pointer  227 BindingSource  CheckBox  EF ComboBox  El ContextMenu     DataGrid  a  DataSet  TA DateTimePicker     DomainUp
    
Download Pdf Manuals
 
 
    
Related Search
    
Related Contents
“Embedded Linux development made easier” User`s manual  Fongicide QUILT - Syngenta Canada  Shuttle X27D  Manuel Ventilation- V12  フードスタンプ ニッスイ シリーズ    Service Manual - RadioDatabase.nl  Brenthaven Collins Sleeve Plus  BLANCO ZEROX 450-U  ClosetMaid 17002 Installation Guide    Copyright © All rights reserved. 
   Failed to retrieve file