I am using Revpi Compact.
I am trying to read RTD values with Python. It's not working..
It is read normally in Node-red and PLC Loader programs.
When I run it as python code, the values are displayed differently.
The code used is below
Upload a screen capture as well.
I look forward to your help.
thank you.
Code: Select all
import datetime
import time
import revpimodio2
rpi = revpimodio2.RevPiModIO( autorefresh = True )
while True:
time_stamp = datetime.datetime.utcnow().isoformat()
print("TIME:",time_stamp)
ai_value = rpi.io['RTD_Value_1'].value
ai_value2 = rpi.io['RTD_Value_2'].value
core_temp = rpi.io['Core_Temperature'].value
frequency = rpi.io['Core_Frequency'].value
print("PT100_1:",ai_value)
print("PT100_2:",ai_value2)
print("Frequency: ", frequency)
print("CPU: ",core_temp)
time.sleep(0.5)