Click here to Skip to main content
12,621,340 members (30,496 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET serialport
Hai All,
In my VB Application i need to read null value....
Because after of null i get data ..... But because of null my data has been terminated ... Now how should i read data including null.......

Thanks in ADV
Posted 12-Mar-12 20:17pm
Comments
SAKryukov 13-Mar-12 1:20am
   
What do you call null in this case?
--SA
Himachandra 13-Mar-12 2:36am
   
i got some hex data from serialport ..... it has 8char size.... whenever null has been coming in that 8char data .... After of null char what ever the data has been discarded....... But i need to read all the 8chars including null.......
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

A null is nothing but a byte value of 0. So, scan your buffer after the read and look for a 0. There's your null.

Unless, of course, youre dealing with Unicode strings, in which case, it's two 0 values in a row.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Please see my comment to the question. With the port, you transmit bytes, nothing else. It should make the answer apparent…

—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 13 Mar 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100