Jump to content
  • 0

Running time is less than scheduled recording time


mms14

Question

Hello,

I set my AD3 digitalIn to record 60s and the recording lasts about 55s.

Frequency is set to 100kHz, gives a divider of 1000 which is a multiple of 8 :

On 3/6/2023 at 10:57 AM, attila said:

Hi @Someone

The supported divisions are 1, 2, 4 and 8*N, N=1,2,3...

The number of samples is 6.000.000

The divider and number of samples are configured :

# get internal clock frequency
internal_frequency = c_double()
dwf.FDwfDigitalInInternalClockInfo(device_handle, byref(internal_frequency))
# set clock frequency divider (needed for lower frequency input signals)
dwf.FDwfDigitalInDividerSet(device_handle, c_int(int(internal_frequency.value / self.sampling_frequency)))
# set 8-bit sample format
dwf.FDwfDigitalInSampleFormatSet(device_handle, c_int(16))
# set buffer size
dwf.FDwfDigitalInBufferSizeSet(device_handle, c_int(self.buffer_size))

Other configuration :

dwf.FDwfDigitalInTriggerPositionSet(device_handle, c_int(int(self.buffer_size/2))) # trigger in the middle
# number of samples before trigger
dwf.FDwfDigitalInTriggerPrefillSet(device_handle, c_int(0))
dwf.FDwfDigitalInInputOrderSet(device_handle, c_int(0))
dwf.FDwfDigitalInConfigure(device_handle, c_bool(True), c_bool(False))

I did few runs with the same sampling frequency and number of samples and print the time :

print(time.time())
result, recordTime = logic.record(device.hdwf)
print(time.time())

the record function is the same as in examples and I get different execution time :

55.1014998
54.0307646
55.8770659
54.8211658

57.0943558
55.5126603

And with frequency of 10kHz and 600.000 samples, it lasts about 32s

How to configure to record for 60s ?

Thanks

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @mms14

Only natural division of system frequency are supported. With the default 100MHz closest would be 5.882MHz.
For 6MHz set system frequency for instance to 120MHz. dwf.FDwfDeviceParamSet(hdwf, DwfParamFrequency, 120000000)

 

See WF SDK/ samples/ py/ DigitalIn_Record.py example
Set number of minimum samples you want to capture before trigger as Prefill and the exact number after trigger as Position.
After the capture is done the data need to be aligned. rgwSamples = rgwSamples[iSample:]+rgwSamples[:iSample]

For digital record 6MHz is on the limit to work, buffer overflow may occur.
To improve the record use the 4th or 5th device configuration.
dwf.FDwfDeviceConfigOpen(-1, 3 or 4, byref(hdwf)) 

If the average signal toggle rate is less than 3MHz use data compression. This way you may be able to use even higher record rate, like 120MHz
See DigitalIn_Record_Compress.py example

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...