Creating a 32-bit Counter Using the FP-CTR-500/502
Downloads
Filename: cascade_counter_example.vi
Requirements: View
(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
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/).
