Jump to content
  • 0

Save data in particular rate


SimonV

Question

Hello!

I'm a postdoc with limited programming expertise. I am working with a USB-1608FS-Plus device, which I use to collect data from a photodiode. My setup involves using a single channel in 10-volt mode. I work on Linux Mint and uldaq 1.2.3. My data is saved to a CSV file at a resolution of 500Hz. In my code, I specify the "rate" parameter as 500 Hz, but saving the data also requires additional time. This means each data point is saved approximately every 0.00023 seconds (not 0.0002), though this value varies slightly.

Currently, I'm using a higher rate and then resampling to achieve the needed rate. I found in the documentation the parameter 'scan_options = ScanOption.CONTINUOUS', which can be altered to 'PACEROUT' for using the internal pacer output on a DAQ device. If I understand correctly, this should allow me to save data at a specific speed without needing to resample. However, due to my limited programming skills, I'm not sure how to implement this.

Could anyone please provide an example or guidance on how to save data at a specific frequency using this device and library?

Edited by SimonV
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

I cannot find a definition for PACEROUT. The UL Help documentation doesn't mention it, and it's not listed as a supported option for the USB-1608FS-PLUS.

To use more than one scan option, use the logical OR operator to include it. For example, ScanOption.CONTINOUS | ScanOption.PACEROUT. 

If you set the sample rate to 500 in your application, the data points are spaced 0.002 seconds apart. This is because we use a crystal oscillator to pace the data collection accurately. Each data point represents 0.002 seconds of elapsed time for a single channel acquisition. If you choose a sample rate unattainable by the device, the a_in_scan function returns the actual rate with the rate parameter. 

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...