No BSD License  

Highlights from
squareWave

5.0

5.0 | 1 rating Rate this file 5 Downloads (last 30 days) File Size: 13.37 KB File ID: #7216

squareWave

by Christopher Ruckman

 

21 Mar 2005 (Updated 24 Mar 2005)

Creates a square wave output on a Nationall Instruments DAQ card using generic DLL calls.

| Watch this File

File Information
Description

This example shows how to create a square wave output on the GCPTR0 line of a National Instruments data acquisition card using only direct DLL calls to the NIDAQ DLL.

With DLL calls, you can use features that are not directly accessible from MATLAB or the Data Acquisition Toolbox. The same technique can be adapted for other tasks such as reading counters, creating pulses, or general data acquisition.

For more examples, look at any of the C files typically found in the folder

C:\Program Files\National Instruments\NI-DAQ\Examples\VisualC

Any of those programs can be adapted to run in MATLAB using DLL calls.

The original purpose of SQUAREWAVE was to generate a clock signal for a bank of anti-alias filters, but it also provides a useful example of the general approach.

This submission complements, and was made possible by, Scott Hirsch's excellent http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=2890&objectType=file (Counter Example).
Chris Ruckman (cruckman@vssl.com)

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Counter Example

MATLAB release MATLAB 7.0.1 (R14SP1)
Other requirements Requires a National Instruments data acquisition card such as the 6031E. Similar methods can be adapted to work with any NI product that uses traditional NI-DAQ.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
01 Feb 2006 B H

Excellent - any ideas how to make it work for R13?

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
example Christopher Ruckman 22 Oct 2008 07:43:53
application Christopher Ruckman 22 Oct 2008 07:43:53
nidaq Christopher Ruckman 22 Oct 2008 07:43:53
generic Christopher Ruckman 22 Oct 2008 07:43:53
dll Christopher Ruckman 22 Oct 2008 07:43:53
gpctr Christopher Ruckman 22 Oct 2008 07:43:53
counter Christopher Ruckman 22 Oct 2008 07:43:53
freq_out Christopher Ruckman 22 Oct 2008 07:43:53
clock Christopher Ruckman 22 Oct 2008 07:43:53
counter Krasimir 09 Jan 2010 17:03:27
counter Hiran Jayaweera 23 Jul 2010 06:30:26
example Jose Ercolino 30 Apr 2012 19:27:51
daq Jose Ercolino 30 Apr 2012 19:27:51
counter Jose Ercolino 30 Apr 2012 19:27:51
timer Jose Ercolino 30 Apr 2012 19:27:51
national instruments Jose Ercolino 30 Apr 2012 19:27:51

Contact us at files@mathworks.com