VCP1000_0: data rate vs data interval

Comments & issues
Post Reply
Rhybot
Phidgeteer!
Posts: 52
Joined: Wed Aug 14, 2019 4:58 pm
Contact:

VCP1000_0: data rate vs data interval

Post 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?
User avatar
mparadis
Site Admin
Posts: 959
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: VCP1000_0: data rate vs data interval

Post 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.
Rhybot
Phidgeteer!
Posts: 52
Joined: Wed Aug 14, 2019 4:58 pm
Contact:

Re: VCP1000_0: data rate vs data interval

Post 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!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 15 guests