Urgent Help:Using visual basic GUI to interface with BS2
legion_78
Posts: 2
My project mate and I are·currently doing a school project which require us to design a graphical user interface (GUI) for the BS2. The GUI we are going to design·is similar to the GUI-bot software for the BOE-BOT kits.·We are facing great with the interface between the GUI and the BS2. Both of us are not trained in electronics and programming·thus its quite hard for us to pick up easily. What we can achieve right now is to convert the pbasic programs·to exe files and using these exe files to d/l to the BOE-BOT using visual basic. The problem is that we cannot accumulate the commands together. Example, i want my robot to travel forward, turn right and forward again. In the GU-BOT software, you can click the required movements and·the commands·will be·executed in one move. For our case we are only able to execute one command·at a time.·The drawback is·the robot·will always have to be connected to a RS232 cable.
We would appreciate if anyone can tell us how we can solve this prob, i know its a very tough and complicated matter as it requires both the knowledge of pbasic and vb programming. At least if there is any books u·guys can recomend we would not be so lost. Thank you very much.
We would appreciate if anyone can tell us how we can solve this prob, i know its a very tough and complicated matter as it requires both the knowledge of pbasic and vb programming. At least if there is any books u·guys can recomend we would not be so lost. Thank you very much.
Comments
·
Here are two books I used to accomplish a similar project.
·
“Controlling The World with Your PC” by Paul Bergsman
“Serial Port Complete” by Jan Axelson
·
Hopefully this is what you were trying to do. If not let me know what you had in mind.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Alex Burke
burke@ajbrobotics.com
"The factory of the future will have only two employees, a man and a dog.· The man will be there to feed the dog.· The dog will be there to keep the man from touching the equipment."· ~Warren G. Bennis!
Some of what you're saying doesn't sem to make sense, unless I'm misunderstaning what you're saying. You said in your prior post:
"What we can achieve right now is to convert the pbasic programs to exe files and using these exe files to d/l to the BOE-BOT using visual basic."
PBASIC programs are meant to be input to the Stamp Editor, and the Editor will check the programs for proper syntax, and optionally download the necessary program codes to the Basic Stamp. Subsequently the loaded program code can be executed. EXE files don't enter the picture anywhere. Second, PBASIC and Visual BASIC are in no way compatible. There is no way to use Visual Basic on a Stamp regardless of the format (EXE or otherwise).
Insofar as what you need to do, you need to develop your own Motion Command
"Language" syntax which includes a command stack, in Visual Basic on a PC (or whatever language and platform you choose to employ). The command stack (to accomodate multiple commands if required) is only executed (singly and serially) if/when a (say) EXECUTE command is issued and received by the Stamp Motion Command processor via whatever input means you might choose to use.
For testing and development, an RS-232 link (wire tether) should be fine. Later, that can be rather easily converted to a wireless system if you choose to go that route.
Hints: Since the Stamp has no specific provision for working with strings of data, I would implement the inter-program "language" using single character alphamerics, or better yet, nothing but numerics. Using just numerics it seems pretty obvious that you will need to use at least a two digit command syntax. This really isn't an impediment, if you look ahead and pre-plan the commands based on some simple scheme. The following might be a simple scheme:
1 X = Orient Commands 3 X = Forward Commands
1 1 = Orient North 3 1 = Move forward slowly
1 2 = Orient South 3 2 = Move forward normal
1 3 = Orient East 3 3 = Move forward quickly
1 4 = Orient West
2 X = Turn Commands 4 X = Reverse Commands
2 1 = Turn North 4 1 = Move reversed slowly
2 2 = Turn South 4 3 = Move reversed normal
2 3 = Turn East 4 4 = Move reversed quickly
2 4 = Turn West
8 X = Ancillary commands
....
8 8 = IMMEDIATE STOP
0 0 = Stack next commands
0 9 = End command stack
9 8 = Display but do not execute commands in stack
9 9 = EXECUTE stacked commands
. . . . ETC
If you were to use a binary scheme the command structure could be reduced immensely.
Just some thoughts. Good luck with your project!
Regards,
Bruce Bates
Kevin
· If i understand correctly, are you saying that we can use visual basic·to develop a series of motion·commands for our BOE-BOT and the stamp editor does not come into the picture? Isnt the BS2·be only written·in pbasic codes? The following sample·codes you have written, are they·written in·vb format to control the robot?
1 X = Orient Commands 3 X = Forward Commands
1 1 = Orient North 3 1 = Move forward slowly
1 2 = Orient South 3 2 = Move forward normal
1 3 = Orient East 3 3 = Move forward quickly
1 4 = Orient West
etc
We have decided to purchase the RF (wireless) products which you guys have also mentioned. Its worth a try and if we can get technical support from the supplier maybe we can get things done a lot quicker.
As for the exe files,·there is an option in the stamp editor whereby you can save the pbasic codes in executable file and·we use·our GUI created in vb·to d/l it to the robot.
Thanks for your advise.