JOliver Posted February 26, 2008 Report Share Posted February 26, 2008 I have a servo motor with a serial interface and am trying to figure out how to read the serial port using an analog trigger event from the device that the servo motor is turning. Does anyone have an ideas? I am using a 9205 in a cDAQ for the analog input. Quote Link to comment
jdunham Posted February 26, 2008 Report Share Posted February 26, 2008 QUOTE(JOliver @ Feb 25 2008, 10:08 AM) I have a servo motor with a serial interface and am trying to figure out how to read the serial port using an analog trigger event from the device that the servo motor is turning. Does anyone have an ideas? I am using a 9205 in a cDAQ for the analog input. What kind of timing do you need? Does the motor need to be polled, or does it constantly send position updates? Serial ports are inherently asyncrhonous, so there isn't usually a means to trigger a serial reading via a hardware trigger signal. I would probably write labview software to poll the analog input for your trigger condition, and then request a new reading from the motor. The problem is that this will usually take 10-100ms to get a response, but maybe that is good enough. To get a bit faster, you could set up the motor to stream position updates at you and grab the latest one when your analog trigger condition is satisfied. It is pretty easy to do this with a LabVIEW Notifier. The serial reader loop puts readings into the notifier, and a separate analog trigger loop reads the notifier and uses the value. If you need more deterministic (guaranteed) response time, you may need a different kind of motor controller. Quote Link to comment
BrokenArrow Posted March 22, 2008 Report Share Posted March 22, 2008 QUOTE (JOliver @ Feb 25 2008, 02:08 PM) I have a servo motor with a serial interface and am trying to figure out how to read the serial port using an analog trigger event from the device that the servo motor is turning. Does anyone have an ideas? I am using a 9205 in a cDAQ for the analog input. Is it the wiring / hardware part that you have questions about, or the LabVIEW part? The obvious solution is to have an event fire when the analog signal exists (i.e. what jdunham said), or when the signal crosses a certain threshold. Or you could use hardware handshaking. If you can convert the analog signal to digital (and that may not even be necessary depending on the level), you can wire the signal to the handshake line (CTS) and use VISA Enable Event and VISA Wait on Event to monitor the CTS line. When the signal exists, read the port. Richard Quote Link to comment
orko Posted March 23, 2008 Report Share Posted March 23, 2008 QUOTE (BrokenArrow @ Mar 21 2008, 12:17 PM) If you can convert the analog signal to digital (and that may not even be necessary depending on the level), you can wire the signal to the handshake line (CTS) and use VISA Enable Event and VISA Wait on Event to monitor the CTS line. Hey, that's a good idea! I'll be sure to http://forums.lavag.org/www.jott.com' target="_blank">Jott it down so I can remember to use this next time. Thanks! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.