New guy in visual basic have a problem. (^.^)

Status
Not open for further replies.

yuhanghong

Newbie level 3
Joined
Oct 26, 2011
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,310
now, i am trying to started my first Vb programe.
i want the computer send out a short string " 0E " in hex.thought the serial port.
and receive " 0E " in other serial port.
and my subroutine of serial port parts is done.

but i have a problem now,
for example,
when i send a "E" out, the other serial port received a "45". that is not i want.
and i try to send " 15" out and then receive "31 34 " back.
i do not understand what going out and no idea for that.

could someone tell me plz ?

hang (^.^ )
 

so, that means i need to change my text to ASCII, then sent out.
am i right?

thank you so much ^.^
 

I will say you must use Hex codes. I don't know how to declare hex code in VB, but in C will be like this " int x = 0x0F"
 
Last edited:

Yuhanghong,

The representation of Hex values in VB6 is adding '&h' infront of the value , example .... you want 5 in hex then it has to be written like &H5.

And yes if the thing is that it is returning the hex value , that is why you got '45' incase of 'E'.

But in your question you written '15' is returning '31 34' then it is wrong as it should return '31 35', please check.


Regards,
Saubhik Das
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…