Solved

reading electronic balance

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 21
Error on moodle after upgrade 3 106
Hibernate methods 2 58
no14 challenge 14 56
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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now