Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

NI6210 Counter, Sample rate and loop time

I was trying to make a counting task by 6210.

Counter setting Dev1/Ctr0; Input (1KHz) to DEV1/PFI0; sample clock Dev1/PFI2, generated from PFI5.

If I set sample rate 500, sample per loop  500, number of loops about 100. The task will finish about 10s, with all counts 0.

My question:

1. why the taks take 10s to finish, I suppose it should take 100s, as the time would be "sample per loop" / "sampel rate" * "loop number".

2. why I didnot get any counts

0 Kudos
Message 1 of 2
(1,117 Views)

1. First, verify that your signals at PFI0 and PFI2 are valid TTL at the rates you expect.  You can use the Test Panels in MAX to check this out.   You can also try out some of the shipping examples -- I'd focus on edge counting and frequency measurement examples.

 

2. There are significant discrepancies between the description in your post, the comments on your block diagram, and your front panel default values.  This makes it difficult to make specific detailed comments.

 

3. Very generally, the signal at the PFI0 terminal you designate as the "Input Terminal" for edge counting will only affect the count value.  It has *nothing* to do with the sample rate.

 

4. Similarly, the signal at the PFI2 terminal you designate as the "Sample Clock Source" will only affect the sample rate.  It has nothing to do with count values.  And it's the signal itself that causes sampling.  The value you enter on the front panel for "Sample Rate" does not change that.  It only ends up being used to set a DAQmx buffer size, that's all.

 

5. If you finish 100 loops in 10 seconds, odds are that the # samples you read during each iteration is about 1/10 sec worth.   So if you're reading 500 samples per iteration, odds are that the signal at PFI2 is coming in at a ~5000 Hz rate.

 

6. If your count values are 0, odds are you don't have a valid TTL signal coming in at PFI0 during the time you run your task.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 2
(1,091 Views)