serout to vb app only sends what's in parenthesis
realolman
Posts: 65
I am trying to send info from a bS2 in a USB BOE to a Visual Basic app.
I can send and recieve a string from the BS2 if i put it in parenthesis,· but if I try to send a number variable, i get random Hoo Haw in the VB app.
I have tried several different fixes but I can't seem to figure it out.
In the BS2:
If I replace Seconds with any string in parentesis it'll work.
·In the VB app:
txtSerialPort.Text = ""
StringContainer = SerialPort1.ReadExisting()
txtSerialPort.Text = StringContainer
Post Edited (realolman) : 3/1/2008 10:27:34 PM GMT
I can send and recieve a string from the BS2 if i put it in parenthesis,· but if I try to send a number variable, i get random Hoo Haw in the VB app.
I have tried several different fixes but I can't seem to figure it out.
In the BS2:
If I replace Seconds with any string in parentesis it'll work.
Seconds VAR Word Begin: PAUSE 1000 Seconds=Seconds +1 SEROUT 16, 16780, [noparse][[/noparse]Seconds] GOTO Begin: END
·In the VB app:
txtSerialPort.Text = ""
StringContainer = SerialPort1.ReadExisting()
txtSerialPort.Text = StringContainer
Post Edited (realolman) : 3/1/2008 10:27:34 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
The "random hoo haw" you're seeing is actually the ascii values of the characters making up "seconds".
Try SEROUT 16, 16780, [noparse][[/noparse]DEC4 Seconds]
Cheers
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
Now I'm getting 0001000200030004, but it is counting and sending... I'll have to work on it and get it to send only what and when I want. Or else see if I can strip off what I don't want at the other end.
Thank You
PS I followed your link to your web site... that looks pretty interesting. .
Post Edited (realolman) : 3/1/2008 10:50:39 PM GMT