LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Doing Buffered Event count by using Count Buffered Edges.vi, however the count was not accurate. why is this so?

I'm currently using Count Buffered Edges.vi to do Buffered Event count, however the count was not accurate. why is this so? say for example,

Source : Internal timebase, 100Khz, 10usec for each count
gate : use the function generator to send in a 50Hz signal(for testing purpose only). Period of 0.02sec


i'm should be expecting the buffer of the vi be, 2000,4000,6000, ... and so on. since 1 cycle is 2000count. yet i always end up with a counter value that is less than 2000 for each cycle.

1. y is'nt the counter accurate? what is the problem?

2. wrong counter value in the memory for the first data.(quite often) y is this so? and what should i do to
resolve this problem?

In the explaination of buffered event counting, it mention that counter will starts to count when detecting the edges(eg: rising edge) however in the counter control.vi it mention that counter will start to count as soon as i arm it?

3. so can i concluded that counter will starts to count after i arm it, even before the detection of rising edge at the gate signal? or will it wait for the edge at the gate before start counting?

thks and best regards
lyn
0 Kudos
Message 1 of 7
(3,602 Views)
1. One thing to check is the input waveform of the signal you are wanting to count. In my experience, the counters tend to be pretty finicky about the waveshape of the input signals. Over- and under-shoot on edges can really mess things up.

2. As stated in the manual, the first count will be off, and no there's nothing you can do about it.

3. If properly configured, the gate signal will start the counting process. The arm simply gets it ready to start.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 7
(3,602 Views)
Thank you mike,

i had check with the input waveform and i don't think it was the cause, coz i always had a counter value that were alway about 200 to 300 count lesser.

Is there any other possible reasons? help!!

thanks
lyn
0 Kudos
Message 3 of 7
(3,602 Views)
Nothing I can think of, in my experience this functionality always worked very reliably. The only trouble I every had was related to the input signal not being a good square wave. Have you talked to NI about this problem?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 7
(3,602 Views)
Lyn,

I tested the VI that you are using here in my machine and works fine!, I know that does not helps but here is the setup that I have. I selected the internal timebase to be the source and then I wired a function generator to the gate. The only further modifications that I did to the VI was to subtract the first element of the array to all the elements in the array, this gives you an actual value of the pulses that were generated between gate pulses.

About how the counter stars this is the way it goes, as soon as you arm the counter it will be counting any pulse coming into the source and will report the value to the program when a pulse is received in the gate, this is why the first reading needs to be subtracted.

For the way that the data that you get s
eems that the counter is restarting or some estrange behavior like that, this is no common, counters are usually very stable. I would start with the simple event counting VI to verify that there are no problems with the counter, also make sure that other pins for the counter like the output or the Up/Down pin do not have anything wired into them that could cause some confusion. I hope this can help you...
Regards,
Gazoo!
0 Kudos
Message 5 of 7
(3,602 Views)
thks mike, i'll try to talk to NI abt this problem.
lyn
0 Kudos
Message 6 of 7
(3,602 Views)
Thks gazoo,

If you try to view all answers for this question, you can see that i had a reply stating that counter will start count only when it detects the rising edge(set by me) at the gate signal. Hence i'm very confused.

The reason why i face this problem was,according to the note for buffered event counting, it states that counter start counting when it detect the rising edge. however according to the counter control.vi, it mention that counter will start count as soon as i arm it. so when does the counter starts actually?

Currently, i'm facing another problem, using the same setting as before, the max internal buffer size that i can allocate is only about 100~300. Whenever i change both the internal buffer size and counts to read to a higher value
, this vi don't seem to function well.

1. is it possible to have a buffer size of 2000? what is the problem causing the wrong counter value?

2. also note that the size of max internal buffer varies with the frequency of signal sent to the gate, why is this so? eg: buffer size get smaller as frequency decrease.

3. i'll get funny response and counter value when both the internal buffer size and counts to read are not set to the same. Why is this so? is it a must to set both value the same?

thks,lyn
0 Kudos
Message 7 of 7
(3,602 Views)