squareWave
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
Platform Compatibility
Windows macOS LinuxCategories
- Test and Measurement > Instrument Control Toolbox > Instrument Connection and Communication >
- Test and Measurement > Data Acquisition Toolbox > Periodic Waveform Generation >
- MATLAB > External Language Interfaces > Other languages > LabVIEW >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |