Shop OBEX P1 Docs P2 Docs Learn Events
Programming problem with BS2pe — Parallax Forums

Programming problem with BS2pe

doubleDdoubleD Posts: 4
edited 2007-11-30 19:48 in BASIC Stamp
i have built a GUI in VB that gathers order entry data for download to a BS2pe. the VB program can not access the serial port while the DEBUG command window is running and the DEBUG command window will not run while the VB program has the serial port open. i know the GUI work because of a test program i wrote for the BS2pe that does not use a DEBUG command. It only runs a SERIN command and then waits indefinately for the 8 byte data stream to be downloaded and then writes it to the EEPROM or SPRam. this works fine, but when i placed the code into the main program and then asked that the user close the DEBUG window while using the VB interface, the program just stops at the SERIN command. i placed a DEBUG command before the SERIN to see if i was getting to it, and i was, BUT ANY DEBUG commands or anything else after the SERIN will not execute. i need a way to let VB access the port to download the data and still have the DEBUG window running or a way to get the DEBUG command window to come back up once the SERIN command gets the data. i have tried every combination of code placement i can think of, and i just can not find a way to get this to work right......ANYONE have any ideas??


thanks Dan

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-29 20:45
    The DEBUG window will not run while the VB program has the serial port open because they're both trying to use the same serial port and Windows won't allow that. You have to quit the Stamp Editor. There's really no way around this. If you need both ports, you'll have to use a pair of I/O pins and a second serial port on the PC to establish an independent serial channel. The Stamp Manual shows how to use a series resistor to implement a non-standard, but usually adequate RS232 port.
  • doubleDdoubleD Posts: 4
    edited 2007-11-29 21:13
    Yes i figured that much....what i need to know is this Is there any command or way i can place into the Basic code that will reinitalize the DEBUG command window? i used an LED to test my code using HIGH and LOW pin commands and it goes through the code just fine, but it will not bring up the DEBUG command window and display the DEBUG commands i placed into the code after you close the window to allow the VB interface to use the serial port



    thanks· Dan
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-11-29 23:14
    What you could do seeing as DEBUG and SEROUT are virtually the same thing is program your own debug window as part of your Visual Basic application. The subject was touched on at the following link.

    http://forums.parallax.com/showthread.php?p=671804

    Jeff T.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-11-30 19:48
    Dan,

    The BASIC Stamp cannot force the DEBUG window to open. This is only done at download time if there is a DEBUG statement in the program. Once it has been closed it must be opened again manually. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.