Serial port access, always monitoring query

Trying update label from xml sent via serial port every 6 seconds

Page 1 of 1

0 Replies - 1371 Views - Last Post: 22 February 2009 - 02:28 PM Rate Topic: -----

#1 SharpGecko  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-February 09

Serial port access, always monitoring query

Posted 22 February 2009 - 02:28 PM

Hi,

I have set up a Google Code project at http://code.google.c...e/browse/trunk/ in order to show my problem.

What I'm trying to achieve here is read some data from a serial port and update a label element on each new input.

What I think should give the desired result instead appears to be hanging in a loop.

The specific code I am having trouble with is...


			/* define the connection to the CurrentCost meter */ 
			SerialPortAccess meter = new SerialPortAccess(); 
			meter.ComPort = "COM7"; 
			CurrentCostUpdate ccUpdate = meter.GetSingleUpdate(); 
			/* get a single update from the CurrentCost meter */ 
 
			CurrentPowerLabel.Text = ccUpdate.Channel1Watts.ToString(); 



Please view the SerialPortAccess.cs file for the business end.

Thanks in advance for your help

- Andy

Is This A Good Question/Topic? 0
  • +

Page 1 of 1