Quantcast
Channel: Counter/Timer topics
Viewing all articles
Browse latest Browse all 1271

Read every 0.1 seconds, but the counter is not fixed

$
0
0

Dear all

 

I use python write an ci counter read code

my input frequency is fixed at 20Khz and i use while loop to get counter every 0.1 sec

but the conter is not fixed number

There will be a two-digit jump 

for example 1421 →1421 →1423 →1421 →1428 →1425 →1426 →1421 ........

how can i get fix counter ?

 

CT = 0
while (tCT >0):
tCT = NI.read() //NI is function task.ci_channels.add_ci_count_edges_chan('Dev1/ctr0').ci_count_edges_term = 'PFI0'
print(str(thCT-CT))
CT = tCT
time.sleep(0.1)

 

thanks all

 

 

 

 


Viewing all articles
Browse latest Browse all 1271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>