Shop OBEX P1 Docs P2 Docs Learn Events
Need VB help! — Parallax Forums

Need VB help!

crackticus potscrackticus pots Posts: 34
edited 2006-04-19 18:13 in General Discussion
hi ya all
I cannot figure out how to use visual basic(built in to office 2000), to send a single word out the serial port of a computer·to a basic stamp. my application is a Wi-LAN ethernet based webpage controlled robot (and yes I did search google and dogpile and did not find how to do it, and yes·I saw all of the other threads that had to do with serial and VB but they were no help)

any help would be appriciated smile.gif

thankyou.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
there are a hundred types of people in the world,

but I dont have time to name them all.

Post Edited (crackticus pots) : 3/31/2006 11:50:57 PM GMT

Comments

  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-04-01 01:10
    VBA (what's included in MS Office 2K) doesnt have a direct comm object. VB.4~6 do. As an alternate, if it's a true ip webpage, you can referance the iexplorer object and send http commands directly. This was tough enough to do in VB, VBA would be tougher, but "dooable". On thinking about it, in the VBA IDE, select tools, ref's Find the ref to mscomm.dll (it should be there, if not google it and get it, regsvr32 it in your system32 dir, then add it to the project. VBA can do it, but it's not designed for that. VB 6 is prefered, and it's (the dll) included with VB.
    If you need more info, let me know, I'll get the paticulars for you.
    Ummm, one question... if your 'bot is wi-lan endabled, what is the com port needed for?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • crackticus potscrackticus pots Posts: 34
    edited 2006-04-04 20:17
    yea it is still not quite clear, other than it will be hard (and i am an in-experenced programmer)

    about the wifi thing, here is how the robot works

    the robot has a P-II computer on it with a wifi card, the computer also has network\ web·server software
    the the web server can be accessed from a network or web, when accessed the default site has 6 buttons (forward, back, left, right, stop, and wake robot)·aswell as a 240X120 picture that automaticly updates every 1.3 seconds (picture updates from the web cam attached to the robot computer) when one of the web buttons is pressed it (hopfuly) sends a serial command to a BS2p-24 witch gathers sensor information and controlls the two motor controlers witch·drives·two 24V·motors each. (the web site is going to be accessed forn a PDA with a wifi card)

    Btw "wake robot" turns on all the sensors and re-activates·the motor controllers because the robot·goes in to a "sleep mode" after 5 minuts of inactivity.

    thank you.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    there are a hundred types of people in the world,

    but I dont have time to name them all.
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-04-05 17:24
    Sounds like an interesting project. Lots of fun anyway. As to the details...
    Well, from what I see, I cant see the connection between the web server and the hardware.
    Is that what your looking to create, the link from the webserver to the serial?
    One last question before I can suggest a corse of action:How does the web server post the button?
    IE: Does it post the buttons to a web page, a file, what does it do with the button requests? Or, are you creating the interface yourself?
    Does the bot's PC have an OS? WHich one?
    From here, I'm sure someone if not I can help.

    KK

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • DunnseptDunnsept Posts: 115
    edited 2006-04-06 13:40
    by saying VBA and webforms, I would assume you are using active server pages. ASP does not support DDE nor will it let you easily open up the com port to write things out. One option you would have would be to create your own activeX COM object (in something like VB6) that does all of the serial work for you, then you can instantiate that object from within ASP on the webserver.
    As an example you could make the object have certain methods like .moveforward and .turnleft Then if you want it to continue that direction until another command comes in, fine. otherwise put in a count parameter like .turnright(10)
    Becuase your object is created in VB6 (or your choice) you can have direct access to the serial port.
    then in your ASP code you would instantiate that object and link the button clicks to those exposed methods of the object
    (asp code)
    if request.form("command") = "Left" then
    myBoeBot.TurnLeft(10)
    elseif request.form("command") = "Right" then
    myBoeBot.TurnRight(10)

    and so on. You could also write an ISAPI DLL to handle this if you wanted to use some other language (PERL).. you can also SHELL from ASP and run executables, just keep in mind that if you open the website to others, you have to handle the security and you have to have something to prevent like 10 people all trying to control the bot at the same time.

    Post Edited (Dunnsept) : 4/6/2006 3:42:48 PM GMT
  • JavalinJavalin Posts: 892
    edited 2006-04-06 15:25
    For an easy guide to this, look at column #89 - Data exchange with VB in Nuts and Volts

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

    James
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2006-04-09 15:29
    You might also want to consider using VB.Net or ASP.Net instead of trying to use VBA from Office. You can get some basic IDEs free from Microsoft:

    msdn.microsoft.com/vstudio/express/default.aspx
  • crackticus potscrackticus pots Posts: 34
    edited 2006-04-13 16:12
    sorry I have not respondid for a while. i am a student and my math teacher love to give us lots of home-work.

    kaos kidd said:·I cant see the connection between the web server and the hardware.
    Is that what your looking to create, the link from the webserver to the serial?
    One last question before I can suggest a corse of action:How does the web server post the button?
    IE: Does it post the buttons to a web page, a file, what does it do with the button requests? Or, are you creating the interface yourself?
    Does the bot's PC have an OS? WHich one?
    From here, I'm sure someone if not I can help


    the hardware (win XP computer) is configured to be a server that has a single web page, that page has buttons
    controlling the·motion, and the robot will reman in motion untill anothr force acts upon it (another button pressed or it hits a chair)·the servers web page is accessed form a pocket pc, the computer sends serial commands to the basic stamp. yes·I am looking to create a link rom the software to a stamp.

    Kevin Wood
    the link to download vb is brokin thank you though.
    Javalin
    thank you, this is a little helpful. flow controll is hard stuff!!!

    dunnsept
    I don't think·I quite get it. but yes I do want it to remain in motion untill it receives another command(or sensor input) the security is built in to the server (smart card or password)



    thank you all who provided input.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    there are a hundred types of people in the world,

    but I dont have time to name them all.

    Post Edited (crackticus pots) : 4/13/2006 8:28:08 PM GMT
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-04-13 19:47
    Crackticus Pots:
    Ok, knowing you have a full blowen PC, and access to various aspects of the PC, a general plan of action can be taken.
    Dunnsept has the right idea for you.
    It would be the fasest path to success.
    And, the access you need is there.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • crackticus potscrackticus pots Posts: 34
    edited 2006-04-19 18:13
    Thank you all for the help ·on that I might continue that later but for now I am no longer doing this project because some @#^*# stole my school bag with·my·jornada PDA·insidemad.gif··witch had·all my Basic stamp programs that·I had been working on lately including the Wifi robot program. (the pda was the
    WI-FI controller for those who are wondering what bering that this has on the project)

    so thank you for the help.
    and maby I will eventualy finnish the project.


    P.S. hey maby·I could make the robot a dial-up-networking robot!smile.gif
    does·body have any suggestions or done any thing like that before?
    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    there are a hundred types of people in the world,

    but I dont have time to name them all.

    Post Edited (crackticus pots) : 4/19/2006 6:16:30 PM GMT
Sign In or Register to comment.