Dear All ,
I have a device with upon serial communication , it send the data as HEX values , (eg, C020042ABD0F91A103E400F929EBC) . I use the following code to get data from the serial port.
Dim fStream As New FileStream(sFileName, FileMode.CreateNew) ' creates new file
Dim bw As New BinaryWriter(fStream)
System.Threading.Thread.Sleep(1500)
ComTd.Read(data, 1, bCount)
Dim bCount As Integer = 4119 ' it is the size of the chunk not block size
Dim data(bCount) As Byte
bw.Write(data) ' This saves the byte array to a binary file .
The problem is that the stored data are in hex not decimal . I want to covert this HEX data in the byte array to a decimal to save into binray file .
Thanks,
WSN
now