Shop OBEX P1 Docs P2 Docs Learn Events
serout to vb app only sends what's in parenthesis — Parallax Forums

serout to vb app only sends what's in parenthesis

realolmanrealolman Posts: 65
edited 2008-03-01 22:39 in BASIC Stamp
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.
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

  • FranklinFranklin Posts: 4,747
    edited 2008-03-01 20:57
    It would help if you added a subject to this post.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • stamptrolstamptrol Posts: 1,731
    edited 2008-03-01 22:23
    olman,

    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
    ·
  • realolmanrealolman Posts: 65
    edited 2008-03-01 22:39
    thank you... that's it..... I thought in some instances it was ascii stuff. most of it was little rectangles. The DEC thing didn't soak into me when I was looking at the help for SEROUT before.

    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
Sign In or Register to comment.