0

Hello.
I have a problem sending a string to a serial port.
I am using the MScomm to control a motor .
to get a full status form the motor I need to send the strng "R01 99" and a CR LF.
when I use MSComm1.Output = "R01 99" & vbCRLF I get the full status from the motor
but when I use MSComm1.Output = "R01 " & str$(99) & vbCRLF i get a response that if
the str$(99) is sent as 0.
if I print the str$(99) I see 99.

can somebody help ?

Thanks
Meir Mark.

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by meirmark
0

The Str function returns a leading space for the sign of number. Could that be messing you up? Sinec the leading space is there, you could use "R01" & str$(99)

0

I found the problem using Microsoft help and replace the str$(99) to Format(99)
thank you very much.

Meir Mark

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.