tcp wellpro 3066 - 온도 데이타 읽어오기
페이지 정보

본문
import sys, time
from pyModbusTCP.client import ModbusClient
while True:
'''
# 3066 읽어오기
모듈의 온도 입력 데이터를 읽는 명령어입니다.
데이터는 16진수 데이터로 10진수 데이터로 변환해야 하는 데이터이므로 공식에 대입하여 계산합니다.
A、If data = 65535, the temperature sensor is not connected
B、If data > 10000 and data < 65535, the temperature is below 0℃
TEMP = -(DATA-10000)/10
C、if data < 10000, the temperature is over 0℃
TEMP = DATA/10
'''
modbus_client = ModbusClient("172.30.1.109", 8899, unit_id=2)
#print(modbus_client)
r = modbus_client.read_holding_registers(0, 8)
print("r => ", r)
#print("r=>", r[0])
- 이전글wellpro 3082 - 릴레이 데이타 읽고 쓰기 22.11.23
- 다음글tcp 소켓 통신 - 중계기 이용한 지하수 센서 데이타 읽어오기 22.11.23
댓글목록
등록된 댓글이 없습니다.