Page 1 of 1

VCP1000_0: data rate vs data interval

Posted: Wed Mar 30, 2022 3:05 pm
by Rhybot
I see the VCP1000_0's Python API supports:
- getDataRate, getMinDataRate, getMaxDataRate, setDataRate
- getDataInterval, getMinDataInterval, getMaxDataInterval, setDataInterval

I have found this article: https://www.phidgets.com/docs/Data_Inte ... ge_Trigger

However, it doesn't explain the difference between data rate and data interval. Is the difference just data rate is converted to Hertz already?

Re: VCP1000_0: data rate vs data interval

Posted: Thu Mar 31, 2022 7:54 am
by mparadis
Data rate is a newly added feature that lets you specify in hertz instead of ms. For all of the devices we have now, there's no advantage to using one or the other, because setting a rate in hz will just be converted to the nearest possible interval in ms inside our libraries. But for future Phidgets that will support intervals faster than 1ms, setting the rate in Hz will be necessary to get the most data out of the device.

Re: VCP1000_0: data rate vs data interval

Posted: Thu Mar 31, 2022 11:34 am
by Rhybot
Hello mparadis,

Thank you for the response, and that makes sense on being necessary in the future, because data interval has an integer type.

So actually I had rolled a data interval (ms) --> rate (Hz) converter myself for this a while ago in my own end-user code. I saw that this new API call was added, and think it's a great change.

Two comments:
- Consider adding to the docs that the two are basically equivalent, or adding an article about this
- Silently rounding to a nearest possible interval (ms) is slightly undesirable IMO. At least consider documenting this behavior in the API call's description

Thanks again for answering, looking forward to high speed Phidgets!