02-27-2009 02:09 AM
Hi.
I have made a LabView program that controls a test rig. One component of the rig is an AC motor drive which has a serial link at 19200baud which is used for speed (rpm) logging and control. On top of this a NI USB-6009 DAQ is used to monitor parameters such as torque e.t.c.
The problem is that the AC motor drive demands a 35ms wait between me sending the "Read command" and actually reading it. If the time is less than 35ms the drive returns corrupt data. So the limit does not seem to be the baudrate but more of cpu capacity limit in the AC motor drive.
As a result, the DAQ sampling, which is run in the same while loop as the serial interface can never reach a higher rate than ~28Hz. I would like to increase the sample rate of the DAQ to around 100Hz and update the speed over the serial interface as often as possible.
So my question is.... how is this done in the best/simplest way?
Kind regards // Gustaf
02-27-2009 10:43 PM
Break up the code into two seperate loops: One that runs at the maximum rate for the DAQ system. One for the slower serial system.
Mike...