Shop OBEX P1 Docs P2 Docs Learn Events
sending data from bs2 to bs2 — Parallax Forums

sending data from bs2 to bs2

niconico Posts: 28
edited 2009-08-27 13:16 in BASIC Stamp
hi,
Let's say I have 4 bs2. These bs2 are programmed to read data from the sensors. I need to display these data in all·the bs2·in my computer.·However by doing so I need·4 serial ports.·Any1 has any solutions that need only 1 serial ports to receive·data from all the 4 bs2 ?·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-27 04:24
    With the use of USB to serial adapters it's possible to have 4 serial ports active at the same time. If you don't want to do that, you can have 3 of the BS2 communicate with the 4th and that one would send all the data to the PC. There's a pair of Nuts and Volts Columns (#55 & #56) that shows how to connect several Stamps into a network. The Stamp Manual also shows how to connect several Stamps into a network (party line) making use of the "open mode" of the SEROUT statement. That won't work for the PC, but there are ways to convert RS232 signals into the same sort of "party line".

    Post Edited (Mike Green) : 8/27/2009 4:48:01 AM GMT
  • Mike2545Mike2545 Posts: 433
    edited 2009-08-27 04:25
    You can use Serin 0\1,baud,[noparse][[/noparse]data] to get information between stamps, you would then need to relay that data to the PC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • niconico Posts: 28
    edited 2009-08-27 09:15
    thank you everyone. i'll go look for the nuts and volts columns.
  • RiJoRiRiJoRi Posts: 157
    edited 2009-08-27 13:16
    I would set up the Stamp's firmware to look for a unique address coming in, and then respond with its information. The PC's software would cycle through the addresses, and collect the data of the responses. You would also need the PC capable of notifying the user that an error has occurred after some number of tries without a response.

    A "conversation" might look like this:

    PC: "1"
    Stamp1: [noparse][[/noparse]Data]

    PC: "2"
    Stamp2: [noparse][[/noparse]Data]

    PC: "3"
    Stamp3: [noparse][[/noparse]Data]

    PC: "4"
    Stamp4: [noparse][[/noparse]Data]

    PC: "1"
    Stamp1:

    PC: "1"
    Stamp1:

    <PC indicates Stamp1 is not responding>

    PC: "2"
    Stamp2: [noparse][[/noparse]Data]

    etc.

    You may need some type of interface chips if you are using the RS232 standard. RS232 was designed for one-on-one communication. While more units can be used, it is NOT recommended.

    --Rich
Sign In or Register to comment.