Jump to content

Reading Serial Port Based Off of Analog Trigger


JOliver

Recommended Posts

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.

Link to comment
  • 4 weeks later...

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.