Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

reading electronic balance

Posted on 2002-05-31
8
Medium Priority
?
208 Views
Last Modified: 2013-11-20
Hi,
I want to read weigh from electronic balance (connected through com port 1 or 2) and display it in edit box on dialog. How can I do it? Any sample code or useful link please.
0
Comment
Question by:shitallj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
8 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 7047617
Do you have information from the makers of the balance as to what gets sent or received via the serial (i.e. COM) port?

If so, you just open the COM port using CreatFile(), read the data with ReadFile(), and write with WriteFile().

0
 
LVL 86

Accepted Solution

by:
jkr earned 800 total points
ID: 7047698
Check http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwbgen/html/msdn_serial.asp ("Serial Communications in Win32") - it comes with a full-featured sample.
0
 

Expert Comment

by:vpomona
ID: 7047754
I have done it like this.
I have attached a CString member variable to the CEdit control
by going to Class Wizard and selecting the member variables tab
unsigned char * rx_buffer = new unsigned char[number_of_chars+1];
Port.Read(number_of_chars+1,rx_buffer);  //read the port
buffer[0]=__toascii(rx_buffer[0]);
m_kelvin_temp = buffer[0];
for(n=1;n<8;n++)
{
    buffer[n]=__toascii(rx_buffer[n]);
    m_kelvin_temp +=buffer[n];
}
0
 
LVL 86

Expert Comment

by:jkr
ID: 7138468
shitallj, sre you still with us?
0
 
LVL 86

Expert Comment

by:jkr
ID: 12036021
I'd say the Q is answered.
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question