Configuring the sample rate of Counters

  • Software
  • Configuring the sample rate of Counters
Khalid Hersafril

Posted on 16.12.2024 16:43

Hi,


I have been trying to configure the sample rate of the counters but it seems as though it is fixed to a single value. I have gone through the manual but I am not sure if I am missing something.


So, when I configure the dynamic acquisition rate to 5000 Hz, for Analogue Input, I am able to configure the sample rate. It lists a bunch of options I can choose from. However, when doing the same for the Counters, it is fixed to a single value with no option to configure it. Another thing I noticed is the fact that the counters sampling rate are subjected to the maximum sampling rate set in one of the few channels available from the Analogue Input. For example, if the dynamic acquisition rate is 5000 Hz, then the max sampling rate configured for one of the channels are set to 1250 Hz, the counters would reflect the same settings.


I am not entirely sure if there are any settings I might have missed as I could not find it in the manual.


Here is a screen record of the issue (link below):





Pika Kreča Šmid

Posted on 19.12.2024 10:21

Dear Khalid,


thank you for reaching out to us.

I took a look at the video you've sent us and could see that you are working with a Dewe-43. I can confirm that the behaviour form the video is correct- it is not possible to configure the sample rate of the counters.

The sample rate of the counters is determined by the sample rate with which the device is acquiring the data, and there are two criteria when it comes to the sampling rate of the device:

  • The device samples with the lowest sample rate, supported by the device,
  • as long as this sample rate corresponds to the Sample rates with which we acquire data from separate channels (we also call this the Sample rate divider)


As an example, let's look at two examples:

In this first case, the device will sample with 2500 Hz- this will be the lowest sample rate that is supported by the device, and we can also apply a sample rate divider to it to get the individual sample rates of all Analog in signals:

  • 2500 = 2500/1
  • 1250 = 2500/2
  • 25 = 2500/100


The Counter sample rate will therefore be 2500 Hz.


In the example below, the sample rate of the counters won't be 20000, because we cannot get the Sample rates of the other Analog in channels from it:


  • 20 000 = 20 000/1
  • 12500 = 20 000/1.6
  • 400 = 20 000/50
  • 5000 = 20 000/4


Because of this, the sample rate on the counters will be 100 kHz:

  • 20 000 = 100 000/5
  • 12500 = 20 000/8
  • 400 = 250
  • 5000 = 20


Based on this principle, I do not see any unexpected behaviour in your video, and I believe that the functionality is working as expected.


Please let us know if you have any additional questions, or if any additional explanation is needed.


Best regards,

Pika

Khalid Hersafril

Posted on 19.12.2024 16:06

That make sense, thank you for the example!


Then, I was wondering if it is possible for the counters to use a lower sampling rate rather than opting for the highest sampling rate?


For instance, the first example you gave me, would it be possible if the counters opt for 1250 Hz instead of 2500 Hz? Considering that the device is capable of achieving the 1250 Hz by dividing it by 2, would there be any way to then use this settings instead?

Pika Kreča Šmid

Posted on 20.12.2024 09:41

Dear Khalid,


thank you for the follow-up question.

In the first case, we set the Dynamic sample rate to 5000, and the Individual samples have been set to sample with 2500 Hz, 1250 Hz, and 25 Hz.


The device will sample with the lowest sample rate that "fits" the Sample rates of all the Analog in channels. Since no channels are sampled with 5000 Hz, the device will try to find the next highest sample rate that fits the description. For the Sample rate divider, we have the following options:


Since the channels will be sampling with 2500 Hz, 1250 Hz, and 25 Hz, the device will have to sample with at least 2500 Hz, and it just so happens that we can divide this sample rate with a sample rate divider to get 1250 Hz and 25 Hz.

My answer might be a little confusing, so to answer your question, it unfortunately is not possible for the counters to opt for 1250 Hz, because the device cannot sample with such low sample rates. That is, because at least one of the channels requires a higher sample rate than 1250 Hz (that is, 2500 Hz).


If you need to work with lower sample rates, I would then suggest using Mathematics for Downsampling. You could set all the counter channels to "Used" and "Not stored", then make mathematical channels with a lower sample rate.


To resample a mathematical channel, navigate to Time axis, then select Sync timebase, and set the SRDiv to a number, that will correspond to a frequency, we would like to work with.

In this case, we want the channels to be sampled with 1250 Hz, so we set SRDiv to 4 (Dynamic sample rate/SRDiv = Wanted sample rate: 5000 Hz/4=1250


I can name an additional example. Let's say we set the Dynamic sample rate to 100 000 Hz, and sample the channels with 2500 Hz and 1000 Hz.


In this case, the device can sample with a lower sample rate than 100 000 Hz, but this sample rate cannot be 2500 Hz, since this frequency doesn't fit 1000 Hz (2500/1000=2.5). The device will therefore sample with the lowest sample rate that fits all Analog in channels, meaning with the next highest sample rate than 2500 Hz, that is a multiplication of 1000 Hz, but can also be neatly divided by 2500 Hz:


From the image above, we can gather that the lowest frequency the device can sample with is 5000 Hz:

3125/2500 = 1.25

3125/1000 = 3.125

4000/2500 = 1.6

4000/1000 = 4

5000/2500 = 2

5000/1000 = 5



Please let me know if there's anything that is still unclear.


Best regards,

Pika

Khalid Hersafril

Posted on 20.12.2024 10:27

That makes a lot of sense, thank you for the really thorough example!

Pika Kreča Šmid

Posted on 20.12.2024 11:43

Dear Khalid,


thank you for your feedback- I am glad to hear that I could provide a suitable answer to your question.

Please let me know if you have any additional questions.


Best regards,

Pika

Login to reply to this topic. If you don't have account yet, you can signup for free account .