Shop OBEX P1 Docs P2 Docs Learn Events
Problem communicating PC VB6 - BS2 — Parallax Forums

Problem communicating PC VB6 - BS2

ArchiverArchiver Posts: 46,084
edited 2003-01-19 13:30 in General Discussion
I trie to communicate with Visual Basic mscomms with the BS2 standard sin en
sout pins
Many settings changed but always return the same problem or i get worse.
I have to send twice the string

mscomm.output = "DA02" & vbCR ' to get a return
mscomm.output = "DA02" & vbCR ' to get a return

then the bs2 react but i think there is stil sometihing in his buffer the first
2 characters are scrumbled.
In the debug window of parallax it does the wright thing.

Does anybody recognize this or has a sollution.

Regards
Pieter



[noparse][[/noparse]Non-text portions of this message have been removed]

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-01-09 14:10
    The BS2 programming port hardware echoes anything received back to the
    sender. This is a matter of hardware and cannot be turned off. What you
    must do when using VB is keep track of how many bytes you send, then filter
    that many bytes out of the VB input stream as they are the echoed characters.

    And keep in mind that the BASIC Stamp does not have a serial buffer -- except
    the variable(s) you use in a SERIN statement. If you're not sitting on a
    SERIN when VB sends its characters, the Stamp will miss them.

    -- Jon Williams
    -- Parallax


    In a message dated 1/9/2003 4:04:53 AM Central Standard Time, pso@t...
    writes:

    > I trie to communicate with Visual Basic mscomms with the BS2 standard sin en
    > sout pins
    > Many settings changed but always return the same problem or i get worse.
    > I have to send twice the string
    >
    > mscomm.output = "DA02" &vbCR ' to get a return
    > mscomm.output = "DA02" &vbCR ' to get a return
    >
    > then the bs2 react but i think there is stil sometihing in his buffer the
    > first 2 characters are scrumbled.
    > In the debug window of parallax it does the wright thing.
    >
    > Does anybody recognize this or has a sollution.
    >
    > Regards
    > Pieter



    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-01-19 13:30
    I also work with a serial comm between BS2 and VB6 (or in fact
    Access database also run in VB)

    Since the BS2 don't have ram buffer, it's understanding that the
    stamp must have charge over the communication. When ever the stamp
    is interesting to ask for information from the PC, I just use the
    line "Serin 16,16468,1000,Nodata,[noparse][[/noparse]DataIN]" Then the PC has one
    second to answer or else the BS2-program go to the label "NoData"

    When Pc is sending serial onfo, this info is send back as an echo
    from the stamp.. Just ignore this in your vb-program or put the info
    in a Com_log or something.

    Remember not to turn you're VB Comm off on the PC, when using the
    serial cable to the BS2. This will restart you're Stamp.

    I have some difficulty splitting the incoming serial info into
    several variables. Maybe you have some good BS2-code for this.

    Stein_frostad at mailcity dot com

    --- In basicstamps@yahoogroups.com, jonwms@a... wrote:
    > The BS2 programming port hardware echoes anything received back to
    the
    > sender. This is a matter of hardware and cannot be turned off.
    What you
    > must do when using VB is keep track of how many bytes you send,
    then filter
    > that many bytes out of the VB input stream as they are the echoed
    characters.
    >
    > And keep in mind that the BASIC Stamp does not have a serial
    buffer -- except
    > the variable(s) you use in a SERIN statement. If you're not
    sitting on a
    > SERIN when VB sends its characters, the Stamp will miss them.
    >
    > -- Jon Williams
    > -- Parallax
    >
    >
    > In a message dated 1/9/2003 4:04:53 AM Central Standard Time,
    pso@t...
    > writes:
    >
    > > I trie to communicate with Visual Basic mscomms with the BS2
    standard sin en
    > > sout pins
    > > Many settings changed but always return the same problem or i
    get worse.
    > > I have to send twice the string
    > >
    > > mscomm.output = "DA02" &vbCR ' to get a return
    > > mscomm.output = "DA02" &vbCR ' to get a return
    > >
    > > then the bs2 react but i think there is stil sometihing in his
    buffer the
    > > first 2 characters are scrumbled.
    > > In the debug window of parallax it does the wright thing.
    > >
    > > Does anybody recognize this or has a sollution.
    > >
    > > Regards
    > > Pieter
    >
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.