RevPi AIO sampling rate for 8ms in python
Posted: 14 Jul 2021, 10:31
Hello all,
I purchased RevPi AIO module and want to collect +- 10V value.
Data sampling should be max (8ms) according to the datasheet.
So I arranged a test code in python:
The result below showed, however, the cycle time seemed 800ms:
2021-07-14T08:07:58.093727 0.0
2021-07-14T08:08:01.931883 3.472
2021-07-14T08:08:03.526059 10.244
2021-07-14T08:08:04.323045 10.323
2021-07-14T08:08:05.121934 9.322
2021-07-14T08:08:05.918650 4.895
2021-07-14T08:08:06.715427 0.0
Is any setting wrong or code?
(Spec)
Model: RevPi Connect+ 32GB + RevPi AIO (QTY 1)
RevPi AIO version: 1.4
Python version: 3.7.3
revpimodio2 version: 2.5.7
Any opinion is welcome.
Thank you very much in advance.
Daisuke
I purchased RevPi AIO module and want to collect +- 10V value.
Data sampling should be max (8ms) according to the datasheet.
So I arranged a test code in python:
Code: Select all
import datetime
import revpimodio2
rpi = revpimodio2.RevPiModIO( autorefresh = True )
rpi.cycletime = 8
def test_loop( cycle_tools ):
time_stamp = datetime.datetime.utcnow().isoformat()
ai_value = rpi.io['InputValue_1'].value / 1000
print( f'{time_stamp} {ai_value}' )
rpi.exitsignal.wait(0.003)
rpi.cycleloop( test_loop )
2021-07-14T08:07:58.093727 0.0
2021-07-14T08:08:01.931883 3.472
2021-07-14T08:08:03.526059 10.244
2021-07-14T08:08:04.323045 10.323
2021-07-14T08:08:05.121934 9.322
2021-07-14T08:08:05.918650 4.895
2021-07-14T08:08:06.715427 0.0
Is any setting wrong or code?
(Spec)
Model: RevPi Connect+ 32GB + RevPi AIO (QTY 1)
RevPi AIO version: 1.4
Python version: 3.7.3
revpimodio2 version: 2.5.7
Any opinion is welcome.
Thank you very much in advance.
Daisuke