I am new to vb.net and am using visual studio 2008. I am sending data back and forth using the serialport module. I am wondering if there is a way to send a hex byte, rather than having the module ALWAYS convert everything to ASCII. This is extremely obnoxious, and so far I cant seem to figure out how to avoid this. I am sending this data through a com port to external hardware, and ASCII is not acceptable.

For example, I may need to send 0x1F, or &H1F in vb.net notation, which I absolutely do not want converted into ASCII, because then it will be sent in two bytes rather than 1.

Please let me know if anybody knows a way to avoid this, or if I must move towards a different type of module to send and receive my serial data.

Thanks for viewing!

well, its amazing that after 74 views nobody has a response to this, what turned out to be an easy problem. as i am new to vb.net the syntax briefly eluded me, but after some research i found that if i passed an argument as a byte array, it would not convert to ascii, as when i passed it a string (by default).

Hello,

It is really amazing after 744 views and nobody has a response to this thread.

I am just wondering if you are still having problems with the serial port. If so, I developed a serial port programming language in C# and I believe it solves nearly all of the problems that everybody encounters with. Would you please take a look and try it ?

Project is freely available on sourceforge and if you have any questions, please feel free to ask.

Project homepage

Download Link

Thank you,

Orhan

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.