Hi

I wish to send data to serial port. I use the following code under normal circumstances.


dim bytearray () as byte
redim bytearray(0)

bytearray(0)= &HFF
MSCOMM1.output = bytearray(0) ' 8 bit data


Now I have a requirement that I wish to send 32 bit data to serial port. Which means sending 8 bit data in four steps.

32 bit hex data is in a string as

dim hexstring as string

hexstring = "ff0d01fe"

I use a for loop to send the data

for i = 0 to (hexastring.length/2)-1

bytearray(0) = "&H" hexastring(2*I) & hexastring((2*I)+1)

MSCOMM1.output = bytearray(0) ' 8 bit data

next




But , the following line doesn't make sense. It just uses string concatenation

bytearray(0) = "&H" hexastring(2*I) & hexastring((2*I)+1) [/B]

But the left hand side variable bytearray(0) is byte data type

Any help would be appreciated

Regards

Faisal