USB-to-Serial Problem OSX
Posted: Sun Jan 16, 2011 5:42 pm
I have a device (motor with serial interface) sitting behind a usb-to-serial adapter (FTDI FT232R chipset). The motor requires 19,200, 8N1 serial settings. I can turn motor on and off perfectly in Win32 platform but everything falls apart under OSX. The motor intermittently turns on (sometimes it works, sometimes it doesn't). I think it must have something to do with setting the Baud rate or the FTDI VCP driver for OSX. Any ideas or input? Maybe someone out there has worked on something like this before and has the magic answer.
Here's the code I use:
Here's the code I use:
Code: Select all
on MouseUp -- Turn On Motor Button
set the serialControlString to "BAUD=19200 PARITY=N DATA=8 STOP=1"
if the platform = "MacOS" then
open driver (the ComPortName of this Stack) for write
write (the MotorOnCommand of this Stack) to driver (the ComPortName of this Stack)
close driver (the ComPortName of this Stack)
Else
open file(the ComPortName of this Stack) for write
write (the MotorOnCommand of this Stack) to file (the ComPortName of this Stack)
close file (the ComPortName of this Stack)
end if
End MouseUp