From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

Modify example "Frequency Measurement.vi" for cFP to read two channels

I am using the cFP-CTR-502 to measure frequency on one channel using a modified version of the built-in example, "Frequency Measurement.vi" found under 'Hardware Input and Output>Fieldpoint>Advanced'.  How do I modify this example further to incorporate additional frequency-measurement channels?
0 Kudos
Message 1 of 5
(6,568 Views)
AEICincy,

Modifying the example for multiple frequency measurements shouldn't be too difficult.  If you wish to use the same gating pulse, the only thing you need to do is set up a new channel in MAX (set it up the same way you set up the first channel as per step 3 of the instructions), set the counter channel on the new front panel controls, and add code to read and reset the counter (which can be copy/pasted in the False case of the code).  I have attached an example of a VI with these changes.


Message Edited by Devin_K on 01-28-2008 08:38 AM
0 Kudos
Message 2 of 5
(6,543 Views)

Thanks, Devin.  I'll look it over shortly.

On a separate note, our experiments with the unmodified version have us scratching our heads a bit.  One reading will be nearly right (though low), the next will be very low, a cycle which repeats.  When the two measurements are added, the result is almost dead-on, with about 2 ms of pulses missing.  It seems to us that the read is not waiting for the gating operation to complete before it reads and resets.  Any thoughts?

0 Kudos
Message 3 of 5
(6,537 Views)
AEICincy,

If you didn't modify the example code at all, I wouldn't expect to see the behavior you are seeing.  Are you using a counter to generate an output on the gate, as described in the instructions, or is your gate signal coming from somewhere else?  The read and reset should only occur when the gate changes from a high to a low.  If you are getting two readings instead of one, it would indicate to me that after the gate signal goes low it briefly jumps back high before settling at low.  I'm not sure what would be causing this, but perhaps something is causing noise in your gating signal.
0 Kudos
Message 4 of 5
(6,507 Views)

Thanks.  I was using the output 0 to trigger the gate, as specified in the example.

 

I appreciate your help, but in light of our difficulties, we decided to pre-condition the signal with a frequency to DC converter, and replace the CTR with an AI module.

0 Kudos
Message 5 of 5
(6,503 Views)