Skip to main content
Skip table of contents

get_modbus_inputs(iobus_list)

기능

Modbus Slave장치에 복수 개의 신호를 읽어오기 위한 명령입니다.

인수

인수명자료형기본값설명

iobus_list

list(string)

-

modbus input 이름 list (TP에서 설정)

signal type이 아래의 경우에만 사용가능

  • DR_MODBUS_DIG_INPUT
  • DR_MODBUS_DIG_OUTPUT

리턴

설명

int (>=0)

한번에 읽은 복수 개의 신호 값

(iobus_list 의 첫번째 값=LSB, iobus_list 의 마지막 값=MSB 가 되는 비트 조합의 값)

음수 값

실패

예외

예외설명

DR_Error (DR_ERROR_TYPE)

인수들의 데이터형 오류 시

DR_Error (DR_ERROR_VALUE)

인수의 값이 유효하지 않을 시

DR_Error (DR_ERROR_RUNTIME)

C Extension 모듈 에러 발생 시

DR_Error (DR_ERROR_STOP)

프로그램 강제 종료 시

예제

PY
# Modbus digital I/O 입력 신호가 ”di1”은 OFF, ”di2”은 ON, ”di3”은 ON 인 경우
res = get_modbus_inputs(iobus_list=["di1", "di2", "di3”])
	  #res 기대값 = 0b110(이진수), 6(십진수), 0x06(16진수)	

# Modbus digital I I/O 입력 신호가 ”di4”은 OFF, ”di5”은 ON 인 경우
res = get_modbus_inputs(["di4", "di5"])
	  #res 기대값 = 0b10(이진수), 2(십진수), 0x02(16진수)
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.