From: Walter Roberson on
Dave Hathaway wrote:

> The hardware vendor is talking about there being some USB latency issue
> with such a slow sample rate. I don't understand that at all. Seems
> like any modern system should be able to handle 200 samples/second in
> it's sleep.

USB is made for synchronous work, not for asynchronous. USB bundles asynch
data at 40 ms silence or 62 bytes (which-ever comes first), and requires 7
bytes of header to transfer serial port bytes; plus there is time negotiating
the use of the USB bus.

Would you perhaps be using RTW ? If so, there are hints that an older version
of it might not have supported more than 100 Hz, with current versions
supporting up to 500 Mhz but some people reporting they are unable to get more
than 200 Hz. This is not a general Matlab serial port restriction, it has to
do with RTW and DAQ interrupt guarantees.


The following have some potentially relevant material.

http://groups.google.ca/group/comp.soft-sys.matlab/browse_thread/thread/dd0ee432eb0ce4d7/64a0f9bdf140b574

http://groups.google.ca/group/comp.soft-sys.matlab/browse_thread/thread/fc42fdad99e1969c/ebc857d87eab8ce7

http://groups.google.ca/group/comp.soft-sys.matlab/browse_thread/thread/314f223e11a4331f/be866bf20d142e97
From: Dave Hathaway on
Walter Roberson <roberson(a)hushmail.com> wrote in message <hv6btj$qmh$1(a)canopus.cc.umanitoba.ca>...
> USB is made for synchronous work, not for asynchronous. USB bundles asynch
> data at 40 ms silence or 62 bytes (which-ever comes first), and requires 7
> bytes of header to transfer serial port bytes; plus there is time negotiating
> the use of the USB bus.
>
> Would you perhaps be using RTW ? If so, there are hints that an older version
> of it might not have supported more than 100 Hz, with current versions
> supporting up to 500 Mhz but some people reporting they are unable to get more
> than 200 Hz. This is not a general Matlab serial port restriction, it has to
> do with RTW and DAQ interrupt guarantees.
>
>
> The following have some potentially relevant material.
>
> http://groups.google.ca/group/comp.soft-sys.matlab/browse_thread/thread/dd0ee432eb0ce4d7/64a0f9bdf140b574
>
> http://groups.google.ca/group/comp.soft-sys.matlab/browse_thread/thread/fc42fdad99e1969c/ebc857d87eab8ce7
>
> http://groups.google.ca/group/comp.soft-sys.matlab/browse_thread/thread/314f223e11a4331f/be866bf20d142e97

I will check out the links, thank you. The vendor (Data Translation) is telling me that my sample rate is too SLOW. They in fact suggested that I increase my sampling rate to 1K/sec and just select every fifth sample. 2K/sec would work even better? I don't understand the "why" of this. In testing, 1K and 2K sample rates have very similar problems.

On a different machine that I no longer have access to, a much more complicated version of the program ran all day long being interpreted under MATLAB without dropping data. This simple compiled program is unable to sustain the very slow sampling rate. I don't know if it is the different machine, that it is compiled, or if it is my program. It's just frustrating that a program that should have taken two hours to write is now stretching over a week with not much improvement.

Thanks again,

Dave
First  |  Prev  | 
Pages: 1 2
Prev: Unexplainable Mex Error
Next: OpenGL performance