Measuring Frequency into an Acquisition Buffer Using an SCXI-1126
Downloads
Filename: scxi-1126_frequency.zip
Requirements: View
Note: Use only SCXI-1126 channels with this example. Since input limits for SCXI-1126 channels are in units of Hz, mixing them with channels from other SCXI modules or DAQ devices will result in incorrect readings. You can mix channels from other SCXI modules or DAQ devices by specifying the channels and input limits in different channel string and input limit array elements, respectively.
This is a timed acquisition, meaning that a hardware clock is used to control the acquisition for fast and accurate timing. It is also a continuous circular buffered acquisition. This means that a software buffer is used between your DAQ device and LabVIEW. While data are being transferred from your board into one part of the input buffer, LabVIEW is reading data from another part of that buffer. The occurrence makes the acquisition asynchronous (allowing processor time for other things to run) by causing the loop to wait until the number of scans to read at a time is available before it is read into LabVIEW. For this reason it is important that you set your parameters such that LabVIEW reads data out of the buffer fast enough to keep up with the rate at which your board is writing new data into the buffer. If not, unread data will be overwritten and an error will occur. The acquisition continues until the STOP button is pushed, after which the AI Clear is called to clear the data acquisition.
This example requires the SCXI-1126 module to be configured before running.
Instructions:
1. Enter the device number, channels, scan rate and number of scans to read at a time.
2. Select the Voltage Threshold, Hysteresis, Output Filter Setting, and Frequency Range, if the default values are not appropriate. Also, if you select Voltage Threshold to be user defined, make sure to enter the User specified threshold in volts.
3. Make the appropriate I/O connections as explained below.
4. Run the VI. The Y-axis of the graph scales based on the selected Frequency Range.
Key Parameters:
* AI Config:
--Input Limits - used to specify input frequency limits for the SCXI-1126.
* AI Parameter:
--Operation = Set, ParameterName = Filter Setting, Float In = [selected output filter setting] - used to specify filter settings for the SCXI-1126.
* AI Trigger Config:
--trigger type = 7 (SCXI threshold settings)
--trigger channel = [blank] = apply to all channels in group
--mode = ON
--level = value determined based on selection in 'Voltage Threshold' front panel control
--additional trigger params = the only thing changed in this cluster from the default values is the hysteresis. The value is taken from the front panel control.
* AI Start:
--Number of scans to acquire = 0 - starts a continuous acquisition.
I/O Connections:
Connect to the frequency signals to the screw terminals on the terminal block connected to your SCXI-1126, so that they match the channels you have chosen on the front panel of this VI. For example, sc1!md1!0:3.
To find the actual pin numbers, refer to your hardware user manual.
DAQ VIs Used:
AI Config.vi
AI Parameter.vi
AI Start.vi
AI Read.vi
AI Clear.vi
Requirements
Filename: scxi-1126_frequency.zip
Software Requirements
Application Software: LabVIEW Full Development System 5.0.1
Language(s): LabVIEW
Hardware Requirements
Hardware Group: Multifunction DAQ (MIO)
Driver: Traditional NI-DAQ (Legacy)
Reader Comments | Submit a comment »
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
