Shop OBEX P1 Docs P2 Docs Learn Events
A "bit" of a road block — Parallax Forums

A "bit" of a road block

Bulslayer85Bulslayer85 Posts: 34
edited 2012-04-09 18:13 in BASIC Stamp
I changed my project around a bit, instead of a stand alone robot i am now working on something more like KITT from the old knight rider series. The AI program i am working on is in Visual Basic 2010 but i need to get it to have access to the sensor data that my basic stamp gets. I tried getting VB to just tap into the com port that the basic stamp is on but i cant seem to get that to work so i thought i would try seeing if i could get VB and Basic stamp to share a file that the stamp can write data to and VB can read from it....is this possible?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-04-09 18:13
    Not quite. The Stamp and VB have to talk to each other via the COM port used for programming. VB's I/O is buffered, so VB can listen all the time to the COM port. The Stamp is not buffered, so, if it's not actually listening (via a SERIN) to the COM port, it will miss anything sent from VB. Typically, the Stamp sends some kind of packet (like "HELLO?") that could be cryptic like "?H". The VB program periodically looks for this from the COM port. When it sees it, VB sends back a query asking for the sensor data(like "?SENS"). The Stamp in the mean time is sitting in a SERIN waiting for the query. When it sees it, it sends back the most recent sensor data in some format that VB is expecting. After VB gets the sensor data, it might send an acknowledgement to the Stamp. If there was an error with the data, the Stamp might resend the data, otherwise it would go back to reading the sensors and occasionally seeing if VB is interested in more data.
Sign In or Register to comment.