Serial Communication and Nulls 
Author Message
 Serial Communication and Nulls

Can anyone tell me how to send and receive nulls over the serial port in c++
without using ocx controls(mscomm or after market).


Thu, 15 Sep 2005 03:29:31 GMT  
 Serial Communication and Nulls

Quote:

> Can anyone tell me how to send and receive nulls over the serial port in c++
> without using ocx controls(mscomm or after market).

You can send/receive over the serial port using Win32 API calls.  They
deal with byte arrays, which can contain nulls.  See the MSDN article
"Serial Communications in Win32" and search for the related sample
application code.

This class may also be useful:
http://www.codeguru.com/network/serialport.shtml

--
Scott McPhillips [VC++ MVP]



Thu, 15 Sep 2005 04:27:43 GMT  
 Serial Communication and Nulls
This is the method I am using, and it eithers strips nulls (null disguard
enabled) or stops sending/receiving when a null is received/sent(null
disguard disabled).

Thank You for any help

Quote:

> > Can anyone tell me how to send and receive nulls over the serial port in
c++
> > without using ocx controls(mscomm or after market).

> You can send/receive over the serial port using Win32 API calls.  They
> deal with byte arrays, which can contain nulls.  See the MSDN article
> "Serial Communications in Win32" and search for the related sample
> application code.

> This class may also be useful:
> http://www.codeguru.com/network/serialport.shtml

> --
> Scott McPhillips [VC++ MVP]



Thu, 15 Sep 2005 05:08:59 GMT  
 Serial Communication and Nulls

Quote:

> This is the method I am using, and it eithers strips nulls (null disguard
> enabled) or stops sending/receiving when a null is received/sent(null
> disguard disabled).

The API functions can handle nulls.  Are you sure your code is not using
any string functions to work with the data?  String functions, of
course, will stop when they encounter a null.
--
Scott McPhillips [VC++ MVP]


Thu, 15 Sep 2005 14:21:32 GMT  
 Serial Communication and Nulls
I am not sure of the differerent APIs you are referring to.
The link to the codeguru used char arrays.
Can you please elaborate the on correct api's?

Ron S


Quote:

> > This is the method I am using, and it eithers strips nulls (null
disguard
> > enabled) or stops sending/receiving when a null is received/sent(null
> > disguard disabled).

> The API functions can handle nulls.  Are you sure your code is not using
> any string functions to work with the data?  String functions, of
> course, will stop when they encounter a null.
> --
> Scott McPhillips [VC++ MVP]



Fri, 16 Sep 2005 17:00:57 GMT  
 Serial Communication and Nulls
Check the doc on the Win32 Comm API.


Quote:
> I am not sure of the differerent APIs you are referring to.
> The link to the codeguru used char arrays.
> Can you please elaborate the on correct api's?

> Ron S




> > > This is the method I am using, and it eithers strips nulls (null
> disguard
> > > enabled) or stops sending/receiving when a null is received/sent(null
> > > disguard disabled).

> > The API functions can handle nulls.  Are you sure your code is not using
> > any string functions to work with the data?  String functions, of
> > course, will stop when they encounter a null.
> > --
> > Scott McPhillips [VC++ MVP]



Sat, 17 Sep 2005 01:55:47 GMT  
 Serial Communication and Nulls

Quote:

> I am not sure of the differerent APIs you are referring to.
> The link to the codeguru used char arrays.
> Can you please elaborate the on correct api's?

> Ron S

ReadFile reads from the serial port and can handle nulls embedded in the
data.  GetCommState/SetCommState should be used to get the DCB and set
its fNull member to FALSE.

--
Scott McPhillips [VC++ MVP]



Sat, 17 Sep 2005 02:41:17 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Serial communication (null characters)

2. Serial communication, null striping

3. Serial Communications: Null Characters

4. Serial communication (NULL stripping)

5. Serial Communication with C#

6. Serial Communications

7. Serial communication

8. Serial Communications Class?

9. Serial Communications in Win32

10. C# and serial RS-232 communications

11. serial communication in C

12. bios.h serial communications

 

 
Powered by phpBB® Forum Software