title: Visual Studio C# USB 4 Relay board controller
body: <p>What I want to do is to create a simple Windows form app to control a Relay board to power on and off some lights. Nothing serious it is a personal project. This the link to the relay board I have : <a href="http://www.canakit.com/catalog/product/view/id/627/s/4-port-usb-relay-controller/" rel="nofollow">http://www.canakit.com/catalog/product/view/id/627/s/4-port-usb-relay-controller/</a> .</p>
  
  <p>Now my question is how can I send commands to the relay and receive some from it via USB. The relay board comes with a driver. The boards support the commands below. So how do I send 
  them to the board via my windows form.</p>
  
  <p>From the user manual: It is compatible with both Windows and Apple OS X, as well as various Linux flavors and appears as a USB CDC (Communications Device Class) device which creates a Virtual Serial (COM) port allowing easy communication with the board through any programming language that supports serial communications (VB, VB.NET, C#, C, C++, Perl, Java, etc). A complete set of easy to use commands are available for complete control of all relays, I/O channels and sensors.</p>
  
  <p>Supported Commands:</p>
  
  <pre><code>RELx.ON
  RELx.OFF
  RELx.TOGGLE
  RELx.GET
  
  RELS.ON
  RELS.OFF
  RELS.GET
  
  CHx.ON
  CHx.OFF
  CHx.TOGGLE
  CHx.GET
  CHx.SETMODE
  CHx.GETANALOG
  CHx.GETTEMP
  
  CHS.ON
  CHS.OFF
  CHS.GET
  CHS.SETTEMPRES
  </code></pre>