03-03-2009 04:35 PM
Hello, I need to control a motor/position controller using Labview but the controller only has one signal line into it. The signal line is used for sending commands and receiving responses. Here is an example command.
Command: Hex Value Binary Value Description
Querry Position 0h08 00001:000 Returns the current position as a 16-bit signed value. The value is returned
high byte first (ValueH), then low byte (ValueL)
Transmit Data Format: [command(5 bits):address(3bits)]
Receive Data Format: [ValueH], [ValueL]
How can I transmit, wait, then receive on the same comm-port line?
thanks,
jackammo
03-04-2009 02:54 PM
Hey jack,
With only one wire connection, you won't be able to transmit and receive from any RS-232 or RS-485/422 device. These protocols have separate transmit and receive pins, so with only one wire you'd be able to make your controller only transmit or only receive. What type of device is communicating with your instrument, and how do you have them connected together?
03-04-2009 05:41 PM
The device is a position/motor controller from parallax: http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/27971-MotorMount-v1.2.pdf
Connectivity: Laptop serial port >> 232 to TTL adapter >> position control signal line ( half-duplex).
Would it be OK to connect pins 2 and 3 of the laptop's DB9 port together before connecting to the device? This will allow Labview to send data on pin 2 to the signal line of the position controller then receive on pin 3 from the same signal line of the position controller. We would have make sure we are not sending any data after we send a querry command until the response has been received. I'm not sure if this is a good work-around.
Thanks,
jackammo
03-05-2009 01:48 PM
Hi
It is indeed a serial line but not rs232.
The levels are wrong and single wire is not OK
You would have to translate the rs232 levels to 0..5 volt levels (that is easy) and maybe use a dtr or rqs bit that can be controlled from LabVIEW to have high impedance on the outgoing line.
Normally you only need to become high impedant when expecting data.
The problem lies in switching speed after sending a command that needs receiving afterwards.
Look up someone who can solder such translation of levels and high impedance switch.