This M-file reads data from a WinDaq file and plots the data. The zip file contains M-file ReadWinDaqFile.m, and the M-file functions dataqfileerror.m, endoffile.m, and controlerror.m. The M-file functions are used to support ReadWinDaqFile.m. ************************** - Before you can use the M-file function, you need to first add the directory where the file is located to the MATLAB path using the addpath function: addpath('C:\DATAQMATLABExampes') - After you add the path, you can run the program from the MATLAB command prompt. Syntax: ReadWinDaqFile(WinDaqFileName,StartScan,NumScanPts,DataFormat) ReadWinDaqFile takes 4 user inputs as parameters: 1. WinDaqFileName = full path to the WinDaq (.wdq) data file. 2. StartScan = scan point to start collecting data from, 0 = beginning of file. 3. NumScanPts = number of channel scans to be returned. One scan is defined as one pass through all enabled channels (i.e., one sample per channel). This value must be between 1 and 32,767. NOTE: the scan starts at 0, so if you want 200 scans, enter NumScanPts = 199 4. DataFormat = format of the data returned. Valid settings are: 0 for 2’s complement binary data (FormatBinary); and 1 for data scaled in engineering units (FormatScaled). Set a variable = to ReadWinDaqFile to fill the recorded channel data into an array. For example: windaqFile = ReadWinDaqFile('C:\DATAQ\SAMPLE.wdq',0,10,1) The above line will fill the matrix array windaqFile with data from the SAMPLE.wdq file, starting from the beginning of the file (point 0) and going for 10 scans. The data is set to format scaled (1). After you enter the command, you can use the matrix windaqFile to perform calculations on your data. For example: mean(windaqFile,2) The above line will return the mean values for each channel (or column). ************************** You must have the DATAQ ActiveX controls installed on your machine to use this program. You can download the ActiveX control for free at http://www.dataq.com/develop/ For more information about using the DATAQ ActiveX controls in MATLAB, go to http://www.dataq.com/develop/matlabhelp.php For help with this file, please post a message to the DATAQ Forum at http://support.dataq.com