Chr(0)

maxpic55

Member
Joined
Dec 16, 2002
Messages
15
Hello I want to send to serial port with class rs232 the value equal to 0 that in Visual Basic 6.0 it was a char like this "
 
Do you have the specs that the item you are talking to requires. Then you can look and see what the command terminator is and send that. Also you will have to convert to Hex Coded Ascii more then likely.

Other wise...
Chr(0) = Null (ascii standard).
",,i" = chr(46) & chr(46) & chr(105)

MTS
 
Hi MTSkull,
Thank for reply,
I want to send value 0xFF in hex but when I convert in Ascii I have a problem beacuse it takes a value equal to null and the program cant work.
maxpic55
 
0xFF is the last char on the Ascii chart, Null is 0x00. If this is the stop char then you should not need to read it into ascii. Just find it so you know to stop reading the line, but do not convert it because it is not supposed to be a real character just the Stop Flag.

MTS
 
ChrW is a bit of a VB left over , using .NET you can accomplish the same with ...
Code:
MessageBox.Show(Convert.ToChar(&HFF))
or ...
Code:
MessageBox.Show(Convert.ToChar(Integer.Parse("FF", Globalization.NumberStyles.HexNumber)))
 
Back
Top