squareWave

Creates a square wave output on a Nationall Instruments DAQ card using generic DLL calls.
2.2K Downloads
Updated 24 Mar 2005

No License

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)

Cite As

Christopher Ruckman (2024). squareWave (https://www.mathworks.com/matlabcentral/fileexchange/7216-squarewave), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0