Solved

send and recieve info over a com port

Posted on 1998-08-31
3
179 Views
Last Modified: 2010-04-04
I am looking for C++ (or dos)source code to send and receive info over a com port. How do I acces and turn on the com port and set the baud rate? Specifically on an HP200lx palmtop computer. I am trying to download information to the palmtop, the program is very low level and the dos interupt is not working. It is intended for a CMT datalogger but I am trying to adapt it to the HP, and it needs the COM port address.

Thanks,
Antonio Llanos  
0
Comment
Question by:llanos
3 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1338262
I'm not sure if this is what you are looking for but still....i hope it's a bit helpful
To read a port...
//This is assembler for Delphi
function ReadPortB( wPort : Word ) : Byte;
begin
  asm
    mov dx, wPort
    in al, dx
    mov result, al
   end;
end;
//To write to a Port
//This one is assembler for Delphi too..I mean the function is implemented with Delphi code
procedure WritePortB( wPort : Word; bValue : Byte );
begin
  asm
    mov dx, wPort
    mov al, bValue
    out dx, al
  end;
end;

Hope this helps ;-)

Regards,
Viktor Ivanov
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
ID: 1338263
If you want C++, or dos source then you're in the wrong place, this is Delphi place!!

But if you want source : here is a very good component, freeware, with source :

http://www.torry.ru/vcl/comms/cd320108.zip

and another :

http://www.torry.ru/vcl/comms/async32.zip

regards, Zif.
0
 

Author Comment

by:llanos
ID: 1338264
Thanks, I will check the URLs, I am really looking for something in C++ but that was my
mistake for posting on the Delphi area, I am new at this.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Magic Software info 18 124
JAudiorecorder record freezing the app 29 59
Delphi...Split view - idea? 1 40
CheckListBox usage 3 49
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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

8 Experts available now in Live!

Get 1:1 Help Now