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

Document Type: Example Program
NI Supported: Yes
Publish Date: Oct 23, 2006


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Continuous Write Digital Port Using the Internal Counter for a Sample Clock on cDAQ

5 ratings | 5.00 out of 5
Print

Overview

This example demonstrates perform correlated digital generation on a cDAQ module using an internal counter as a sample clock.

Downloads

Filename: contwritedigport-ctrclk-cdaq.vi
Requirements: View

I.    Description:
This example demonstrates perform correlated digital generation on a cDAQ module using an internal counter as a sample clock.

II.   Instructions for Running:
1.  Select the Physical Channel to correspond to where your signal is output on the cDAQ device.
2.  Select an internal counter on your cDAQ to generate the sample clock.
3.  Specify the Rate of the output digital pattern.
4.  Enter the digital pattern data.

III.  Block Diagram Steps:
1.  Create a Counter Output channel to produce a Pulse in terms of Frequency.
2.  Use the DAQmx Timing VI (Implicit) to configure the duration of the pulse generation.
3.  Use a DAQmx Task Property Node to query the device and channel used in the Task to be able to determine the internal counter output terminal.
4.  Create an Digital Output Channel.
5.  Use string functions to create the internal counter output terminal (e.g. cDAQ1/Ctr0InternalOutput)
6.  Call the DAQmx (Sample Clock) VI which sets the sample clock rate and the source of the clock.  Additionally, set the sample mode to continuous.
7.  Write the data to the output buffer.
8.  Call the Start VI to start the Digital Output Task.  Note that the digital values will not actually be generated until the sample clock is generated.
9. Call the Start VI to arm the counter and begin the pulse train generation.
10. Loop continuously until the user presses the Stop button. Check for errors every 100ms on both tasks using the Is Task Done? VI.
11.  Call the Clear Task VI to clear the Digital Output Task
12.  Call the Clear Task VI to clear the Counter Output Task
13.  Report any errors that may have occurred.

IV.  I/O Connections Overview:
Make sure your signal output terminal matches the Physical Channel I/O Control.  For further connection information, refer to your hardware reference manual.

Requirements


Filename: contwritedigport-ctrclk-cdaq.vi

Software Requirements


Application Software: LabVIEW Base Development System 7.1, LabVIEW Full Development System 7.1, LabVIEW Professional Development System 7.1, LabVIEW Base Development System 8.0, LabVIEW Professional Development System 8.2, LabVIEW Professional Development System 8.0, LabVIEW Base Development System 8.2, LabVIEW Full Development System 8.2, LabVIEW Full Development System 8.0
Language(s): LabVIEW

Hardware Requirements


Hardware Group: Multifunction DAQ (MIO)
Driver: NI-DAQmx 8.3

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