Skip to Navigation

MATLAB Examples (Windows UD)

MATLAB drivers and examples version 1.32. See the PDF included in the download zip. Tested on MATLAB 7.0, but should work with 6.5 or newer.

This should work for most 32-bit versions of MATLAB. Due to how MATLAB handles calls to .dlls, additional steps are needed for work with 64-bit MATLAB. In addition to needing the 64-bit LabJackUD.dll you must also have a set of compiler tools to call the functions.  

See this for an example of how to set that up with MATLAB 7.7

For MATLAB R2010a you can get more information here for 32-bit versions and here for 64-bit versions.

For MATLAB R2011b you can get more information here for 32-bit versions and here for 64-bit versions.

File attachment: 
tags:

Comments

#1

I noticed in the U3_Simple_Logger.m file that you don't preinitialize the size of the array for Error, AINX, and FIOX.  This will dramatically decrease the speed of data acquisition as the array gets larger.  Since you are already requesting the 'time' and 'dt' variables, the following lines should be added at the beginning of the program to increase program speed for longer tests.

  • Error(1,1:time/dt)=0;
  • AIN0(1,1:time/dt)=-100;
  • AIN1(1,1:time/dt)=-100;
  • AIN2(1,1:time/dt)=-100;
  • AIN3(1,1:time/dt)=-100;
  • FIO0(1,1:time/dt)=-100;
  • FIO1(1,1:time/dt)=-100;

It may be desirable to initialize values to -100 in case samples are missed (these values could get filtered later).

- A concerned citizen with Matlab expertise

 

#2

Thank you for your suggestion and we will be sure to fix that in the examples as soon as possible.

 

-- Labjack Support