Modbus/CUBLOC Toggle LED Example

Applications, examples, and sample programs using products from Comfile Technology

Modbus/CUBLOC Toggle LED Example

Postby Mike » Thu Jul 14, 2011 7:57 pm

This is the source code for the Toggle LED Modbus/CUBLOC example in the CUWIN 5000/6000 series user's manual. It is simply a form with a button that toggles an LED on the CUBLOC study board using the Modbus communication protocol. For a detailed explanation of this code, please see the CUWIN 5000/6000 series user's manual here: http://www.cubloc.com/download/cuwin/en ... manual.pdf

* You can learn more about the Modbus protocol here: http://www.modbus.org/specs.php
* Learn about programming the serial port using the .Net Framework here: http://msdn.microsoft.com/en-us/library ... 90%29.aspx
* Attached projects for both C# and VB.Net

Here's the source code for the CUBLOC:
Code: Select all
Const Device = CB280
Opencom 1, 19200, 3, 50,50
Set Modbus 1, 1, 20

Ramclear

Usepin 0, Out

Set Ladder On

Do
Loop
Attachments
ToggleLED_VB.zip
VB.Net Project
(44.21 KiB) Downloaded 842 times
ToggleLED.zip
C# Project
(31.31 KiB) Downloaded 780 times
Mike
Mike
SuperDuperDuper
 
Posts: 551
Joined: Thu Mar 17, 2011 3:54 pm
Location: Seoul, South Korea

Re: Modbus/CUBLOC Toggle LED Example

Postby Mark Thompson » Mon Nov 28, 2011 8:10 am

Hi Mike

I cant seem to compile this (using Visual Studio 2010) can you please send it to me on notepad (VB version).
I have a CUSB 14R and would really appreciate it if you could explain how to calculate the crc and in regards to the outputs, would the output P40 on the CUSB 14R be address 28?

Many thanks
Mark Thompson
Terminator
 
Posts: 9
Joined: Sat Nov 05, 2011 7:28 am

Re: Modbus/CUBLOC Toggle LED Example

Postby Mike » Mon Nov 28, 2011 5:02 pm

Microsoft has not released the "Smart Device Development Kit" for Visual Studio 2010, so the latest version of Visual Studio that can be used to develop programs for Windows CE devices (at least at the time this post was written) is Visual Studio 2008.
Mike
Mike
SuperDuperDuper
 
Posts: 551
Joined: Thu Mar 17, 2011 3:54 pm
Location: Seoul, South Korea


Return to Applications and Examples

Who is online

Users browsing this forum: No registered users and 1 guest

cron