Basic Stamp to VB6
Doc
Posts: 25
Hello,
actually I have a small problem with collecting data from Basic Stamp. I have a SRF235 Ultra Sound detector connected to BS2px24-BOE/USB Interface. I wrote the code in PBasic and all works well,·thus, in the interface I can see the distance measured each "x ms". On VB6, I want to save the data in a list box, that means the distance measured every x ms. The problem is that there is a delay between Basic Stamp and VB6 and moreover, VB6 displays the range measured in basic Stamp preceded by a vertical dash which is the ASCII Value 1 (HOME Symbol).
Is there any solution for this?
Thank you.
actually I have a small problem with collecting data from Basic Stamp. I have a SRF235 Ultra Sound detector connected to BS2px24-BOE/USB Interface. I wrote the code in PBasic and all works well,·thus, in the interface I can see the distance measured each "x ms". On VB6, I want to save the data in a list box, that means the distance measured every x ms. The problem is that there is a delay between Basic Stamp and VB6 and moreover, VB6 displays the range measured in basic Stamp preceded by a vertical dash which is the ASCII Value 1 (HOME Symbol).
Is there any solution for this?
Thank you.
Comments
·· This is kind of a trick question in a way...One could infer that if the reading is correct but with the extra character, then just don't have your VB6 App print that character.· On the other hand, do you know what's being sent from the BASIC Stamp Module?· Is that character being sent?· If so, don't send it.· If not, perhaps your MSCOMM routine is messed up?· What exactly are you getting?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Thank you for your reply. Actualy, the Basic Stamp module is sending as follow : "DEBUG 1, DEC4 Range", where "1" is the HOME symbole, so this is the caracter which is not recognized by VB6. In the VB6, I am printing the MSComm.Input into a listbox :
A = MSComm.Input
lstdata.Additem A
Thanks
The other way around it is to use a SEROUT command ( on pin 16, if you want to use the existing connector). That way, no additional characters are sent.
Tom
Just filter the 1 from the MSComm input -- I haven't used VB in a while, but you should be able to do something like this:
· temp = MSComm.Input
· If Left$(temp, 1) < 32 Then
··· temp = Mid$(temp, 2)
· End If
· lstData.AddItem temp
Double check use of Left$ and Mid$ -- like I said, I haven't used VB in a while.· The idea is to remove the first character if it's not in the normal ASCII printing range.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
or
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Sorry for my late reply but I was away.
One more thing, any idea about the delay between the Basic Stamp and the VB6?
Thx,
Doc.
If you're forced to use the programming port, you may want to develop a software protocol where the BASIC Stamp sends an *ready* message to the PC, the immediately loads a SERIN statement to wait on what the PC has to send.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax