Solved

reading electronic balance

Posted on 2002-05-31
8
203 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
  • 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 200 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Prevent this page from creating additional dialogs. 3 625
Problem to open Excel file 15 179
Making an alias 7 101
"Black Box" Testing of Control System Software 2 72
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

820 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