Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Sep 20, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Finite Digital Input With Digital Start Trigger - C#.NET

0 ratings | 0.00 out of 5
Print

Downloads

Filename: 3937.zip
Requirements: View

Description:
This example demonstrates how to acquire a finite digital input with a digital start trigger.

Instructions for Running:
1. Select the digital input port for the acquisition.
2. Select the PFI or RTSI line that will be used for the digital start trigger
3. Set the number of digital samples you would like to acquire.
4. Set the desired sampling rate.

NOTE: Certain boards will not allow all PFI lines as digital start triggers. If you select a line that is not compatible, an error will be generated, and suggested lines will be shown.

Steps:
1. Create a new digital input task, and use DIChannels.CreateChannel() to configre the port for digital input.
2. Configure the timing specifications using Task.Timing.ConfigureSampleClock method. If you would like to do continously, set the SampleQuantityMode to be continuous.
3. Create the DigitalSingleChannelReader object, and register the callback function. Verify and start the task.
4. Call BeginMultiSampleRead method to start the asynchronous input.
5. Within the callback function, display the data. If you would like to use a continuous operation, call the BeginMultiSampleRead at the end of the callback.
6. When the callback has completed (or for continuous mode, if the stop button is pressed), Dispose of the DAQmx task.

Other Uses:
If you would like to do a multiple port acquisition, use the DigitalMultiChannelReader object instead of DigitalSingleChannelReader. DigitalSingleChannelReader is optimized for a single channel operation.

Requirements


Filename: 3937.zip

Software Requirements


Application Software: Measurement Studio Enterprise Edition System (Full Development System) 7.1
Language(s): C#
Additional Software: Visual Studio .NET 2003

Hardware Requirements


Hardware Group: Digital I/O (DIO)
Hardware Model: PCI-6503, PXI-6562, PCI-6505, PCI-6509, PCI-6510, PCI-6511, PCI-6512, PCI-6513, PCI-6514, PCI-6515, PCI-6516, PCI-6517, PCI-6518, PCI-6519, PCI-6520, PCI-6521, PCI-6522, PCI-6525, PCI-6526, PCI-6527, PCI-6528, PCI-6533, PCI-6534, PCI-6541, PCI-6542, PCI-6551, PCI-6552, PCI-6561, PCI-6562, PXI-6503, PXI-6504, PXI-6505, PXI-6507, PXI-6508, PXI-6509, PXI-6511, PXI-6512, PXI-6513, PXI-6514, PXI-6515, PXI-6521, PXI-6522, PXI-6523, PXI-6525, PXI-6526, PXI-6527, PXI-6528, PXI-6533, PXI-6534, PXI-6541, PXI-6542, PXI-6551, PXI-6552, PXI-6561, PCI-6504
Driver: NI-DAQmx 7.5

 
0 ratings | 0.00 out of 5
Print

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/).