Shop OBEX P1 Docs P2 Docs Learn Events
Reading input on programming port for BS2pe — Parallax Forums

Reading input on programming port for BS2pe

jkdalexjkdalex Posts: 8
edited 2006-07-18 17:06 in BASIC Stamp
Hi, I wrote up a program for basic stamp that requires a one byte number input (i.e. 0-255) in the debug window to make a choice which corrsponds to an action. That program works fine. However, I want to write up another program in Visual Basic 6 to be the interface. I've written the VB6 program and it "supposedly" connects using the MSComm feature of Visual Basic. However, when I send commands, the basic stamp does not respond. I am trying to send these commands via the same Comm Port (1) which is the programming port. So basically Comm Port 1 / RS232.

To do so, I have to first close the debug window or else there will be program conflict and i won't be able to connect with my VB6 prog.

I am quite sure I am communicating with the right baud rate, parity (9600, n, 8, 1) etc. with my VB6 program. I even tried inserting a carriage return after each digit output but to no avail. In VB6, I simply use "MSComm1.Output = Chr$(10)" where 10 corresponds to a menu option in my basic stamp program.

Is there something else that I should do when communicating with basic stamp without the debug window?

Thanks in advance!

Comments

  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-07-17 23:12
    There are number of Nuts n Volts articles that deal with VB+BS2.

    The only one that I'm certain of is #89, which can be downloaded here:

    www.parallax.com/html_pages/downloads/nvcolumns/Nuts_Volts_Downloads_V3.asp

    You'll have to look for the others in the downloads.

    Edit:

    Okay, here is a list of the NV cloums that mention VB in some way:

    17, 41, 42, 43, 44, 63, 64, 88, 89, 93, 105, Overview

    Post Edited (Kevin Wood) : 7/18/2006 12:20:56 AM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-18 14:13
    I guess the question is, what are you sending?· If you're sending a 10, then what is the BASIC Stamp waiting for?· It should be a 10 if that's the case, and without the carriage return unless you're looking for that too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-07-18 17:06
    1. I think you need to open the port with "DTREnable" property set to FALSE.

    2. I think there's an MSComm setting which says how many bytes need to be in the buffer before data is actually sent out the serial port. You need to set that to zero.

    Oh, and here's a working example -- but I think it's mostly to 'listen' to a BS2.



    Post Edited (allanlane5) : 7/18/2006 5:12:04 PM GMT
Sign In or Register to comment.