Solved

Sending bytes using the serial com-port

Posted on 1997-07-03
3
231 Views
Last Modified: 2010-04-03
Hi!
I need help whith sending bytes to the serial com-port. Sending Char is no problem, but I want to send Byte. Whith Byte I meen that I want to be able to send 123 in one byte and not in three. How do I do that? I'm using Delphi 2 and overlapped structure on the port, if need to know that.
0
Comment
Question by:Lillan061397
  • 2
3 Comments
 

Accepted Solution

by:
GGR earned 50 total points
ID: 1338128
I'm not sure this is what your wanting, but try this:

aByte := StrToIntDef('123', 0);
{.. Send the Byte ..}

Where aByte = aByte:Byte;
and '123' is the string you want converted to a byte.

I have only tested this in Delphi 3.0 I'm not at my D2 Machine.
0
 

Author Comment

by:Lillan061397
ID: 1338129
I want aByte to have the value 123. 123 is an integer and not a string. It's very important that the value is correct.

Thanks!
0
 

Author Comment

by:Lillan061397
ID: 1338130
It works!!! Thanks! The ASCII tabel I first had was wrong, so I thought that it didn't work.

Linda.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

747 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

11 Experts available now in Live!

Get 1:1 Help Now