boris
01-16-2002, 12:15 PM
I'm wondering how to do this in the most painless way possible. please give me links to Active X controlls or code to regulate pulses on events. Thnx
communicating to hardware via RS-232C portsboris 01-16-2002, 12:15 PM I'm wondering how to do this in the most painless way possible. please give me links to Active X controlls or code to regulate pulses on events. Thnx Robby 01-16-2002, 12:50 PM What is the device you wish to control? Homemade or Manufactured? boris 01-17-2002, 08:30 AM Originally posted by Robby What is the device you wish to control? Homemade or Manufactured? Sorry for being so ambiguous, but I was pressed for time. I'm doing a little school project (Gr. 8 science fair) and I decided to do something in VB. My project partner suggested that we make a robotic arm. I figured that if the amperage and voltage were about right on an RS-232C/IEA-232D port, I could controll small 3v servos. I know that comm ports use a common ground, so I figured I would have to spring load the arm to move it up again. I'm thinking of using a LapLink cable to drive the servos off of the com ports if I can. I'ts been a while since I looked this sort of thing up, so I don't know what pins do what (i.e.:Bell, ready to recieve, etc.). Thinker 01-17-2002, 09:47 AM If you can get the mscomm control to raise and lower the signal pins (RTS,CTS,DSR,DTS) you might be able to control it that way. There would be no point in trying to use the TD (transmit data) signal as it remains at a voltage level. boris 01-17-2002, 10:45 AM Originally posted by Thinker If you can get the mscomm control to raise and lower the signal pins (RTS,CTS,DSR,DTS) you might be able to control it that way. There would be no point in trying to use the TD (transmit data) signal as it remains at a voltage level. That helps, but I'm only going one way. I'm not trying to get data back to my board, just out. Again, I need to know what voltage the com port runs at and how it will be affected by 5 feet of cable. On top of all this, I need to know which pins go where. I've recorded this, but the laptops I put it on have all been damaged rendering the data on my HDs non-recoverable (untill I get a 2.5" to 3.5" IDE adapter). BTW... What code should I use for the mscomm control:confused: Fredd 01-17-2002, 11:52 PM I think it is dangerous to drive the motor from your computer com port alone. The amperage may just burned it. You need at least am amplifier to do that. I don't think VB can go to that low level but C definitely can do that. And another thing is, to control individual pin, i think you need to access parallel port instead of serial port. Hope that help u. Fred:) boris 01-18-2002, 06:38 AM Originally posted by Fredd I think it is dangerous to drive the motor from your computer com port alone. The amperage may just burned it. You need at least am amplifier to do that. I don't think VB can go to that low level but C definitely can do that. And another thing is, to control individual pin, i think you need to access parallel port instead of serial port. Hope that help u. Fred:) What are we talking about burning out here? the motors or the board? If it's the motors, I've run them on 9v current before for 5 minute w/o them burning. If it's the board, the amperage sholden't cause much along the lines of damage, but then again... :mad: :confused: :( Thinker 01-18-2002, 08:04 AM ...I could control small 3v servos... Controlling a servo and running a motor are two different things. It is possible there will be enough current on an RS232 control line to flip a servo. Certainly not run a motor. The voltage levels are quite a bit higher than 3v, but probably only need a resistor to take care of that. Which pin is what is dependent on 2 things, 25pin or 9pin connector, and DTE or DCE configuration. IIRC, the standard 25pin PC comm port is DTE and the 9pin is DCE but I won't swear to that. The difference between DTE and DCE is the input/output condition of the control line is reversed. For instance, RTS is output on DTE and input on DCE. Here is a page that has some good info (http://www.blackbox.nl/techweb/intrface/rs232.htm) boris 01-18-2002, 08:24 AM Thanks a tonne, Thinker. That page really helped. I'm looking to use a 9-pin comm port. I don't think I've been too clear though. I'm not running any electronics in this bot- it's all just straight through, so I don't need to know hat's DTR, DCD, etc... . All I need to know is how to send current through these lines. P.S: when I said motors, I meant servos. Thinker 01-18-2002, 09:17 AM I believe you haven't quite caught the meaning of what I am trying to say. You don't have any choice when using rs232. The control lines are all you have. You can't use the transmit line. If you can't find a way to raise and lower the level of a control line, you can't do it with a comm port. For instance, if you were using the DTR control line. Setting DTR to on would raise the voltage level, and off would return it to 0 (warning, the voltages might be negative with respect to ground, has been awhile since I put a voltmeter on one.) boris 01-18-2002, 10:36 AM OK. I understand clearly now. How do you think paralell would work? Thinker 01-18-2002, 10:40 AM Not too sure about parallel, but I would still guess you would have to use control lines to change voltage levels. On top of that, you would have to find a control that can manipulate the port, as I don't think there are any standard controls with VB that can. I would bet there are controls out there that could be used to make this work for both serial and parallel ports. Try searching the internet (I like to use www.google.com) Ales Zigon 01-18-2002, 12:14 PM This is what Google came up with (http://www.google.com/search?q=inpout32.dll) , or follow THIS (http://www.lvr.com/parport.htm) link. Ales Zigon 01-18-2002, 12:18 PM Or try HERE (developer.intel.com/intelpress/usb/examples/steppermVB.htm ) for an example on driving steppers from VB. Jared 01-18-2002, 01:41 PM Controlling servos from a serial port directly is going to be hard. You have to use PWM (Pulse Width Modulation). I would suggest going to http://www.rentron.com and looking at their Mini SSCs. These are small devices that accept serial data streams and convert the data to constant PWM for up to 16 channels. Check out the Robo-Ware package. I wrote this software and it does control up to 16 servos with the ability to record and playback movements, plus much more... velicity13 03-10-2002, 10:29 AM Boris, Upon considering this idea of using the output voltage of the 232 to control an analog electronic I thought I might be able to help a bit. Check the IEEE.com for the electrical specs on the 232 standard and you will find the operating voltage and amperage of lines such as CTS and DSR. You will also see the pin layout as related to both the 9pin and 25pin connector. At the very most you could use MSComm to turn on CTS arbitrarily, and without error from VB or the UART, and use a relay at the other end that will bump the voltage from that CTS line. The CTS will stay energized until YOU tell it to turn off or the device (a modem) begins to receive info on the RTS line which it won't. If you have an output voltage of 24v from your CTS on the computer then you can wire a relay in your device to latch and transfer the "proper" voltage until the CTS goes back to 0v. You use a diode isolated SPDT relay that is triggerd within the range of your UART's output voltage, ie 24volt coil. A standard SPDT relay has 5 pins. You have two pins that conprise the coil, one pin as the common and the last two pins are Normally Open and Normally Closed state. In this setup you would wire your CTS to pin85, a ground to 86. Your voltage feed from the device (9v feed) to 30 and the output to the servo to 87. 30 and 87a are always connected until you energize the coil, voltage to 85 which grounds thru 86. The lever moves from connection at 30 to 87a over to 30 to 87. Done. That way, you have voltage potential at the relay at all times but no connection until CTS ignites the coil. The diode isolation in the relay protects a ground loop back to the UART. This little dude will cost you about 5$ at radio shack. Does this help? Jon |
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum