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

Document Type: Example Program
NI Supported: Yes
Publish Date: Nov 26, 2007


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Creating a 32-bit Counter Using the FP-CTR-500/502

1 ratings | 5.00 out of 5
Print

Downloads

Filename: cascade_counter_example.vi
Requirements: View

The attached LabVIEW program demonstrates how to read cascade two counters on the CTR 500/502 module to produce a 32-bit counter. Follow the steps below to create a 32-bit counter from counter 0 and counter 1.

(1) Wire your signal into the input of Counter 0.

(2) In FieldPoint Explorer, right click on FP-CTR-500/502 and select Edit this device. Press the Channel Configuration button. Set Counter 0 attributes to the following in the Channel Attributes section of the Channel Configuration window. Be sure to press Create Item after each attribute is set.

Count Source: External Count Input
Terminal Count: 65535
Gate Source: Always Enabled
Read Reset Mode: Don't Reset on Read
Noise Rejection: 50 kHz

(3) Set Counter 1 attributes to the following by following the procedure described in step (2).

Count Source: Previous Channel
Terminal Count: 65535
Gate Source: Always Enabled
Read Reset Mode: Don't Reset on Read
Noise Rejection: 50 kHz

(4) In the Channel Commands section of the Channel Configuration window, create a multiple channel Item called Control @Multi. Check both Channel 0 and Channel 1 then press Create Item. See the link below for more information on creating a multiple channel Item.

(5) Save the iak file.

(6) Run the attached VI in LabVIEW

When reading the counters with either LabVIEW or LabWindows, read the counter containing the lower bits first and then the counter with the upper bits. If the counters are read the other way around, there is the possibility that the lower counter could increment the upper counter during the read, which would give erroneous results.

Requirements


Filename: cascade_counter_example.vi

Software Requirements


Application Software: LabVIEW Full Development System 6.0
Toolkits and Add-Ons: LabVIEW Datalogging and Supervisory Control Module 6.0
Language(s): LabVIEW

Hardware Requirements


Hardware Group: FieldPoint

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