3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish
3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish

get_digital_outputs()

get_digital_outputs(bit_list)

기능

컨트롤러의 디지털 출력 복수 개의 접점에서 신호를 불러오기 위한 명령문입니다. bit_list에 정의된 접점들의 디지털 신호를 한 번에 입력할 수 있습니다.

인수

인수명

자료형

기본값

설명

index

list (int)

-

복수 개로 읽어들일 output 접점 list

1 ~ 16까지의 숫자이며, 컨트롤러에 장착된 I/O 접점 번호

리턴

설명

int (>=0)

한번에 읽은 복수 개의 접점 값

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

음수 값

실패

예외

예외

설명

DR_Error (DR_ERROR_TYPE)

인수들의 데이터형 오류 시

DR_Error (DR_ERROR_VALUE)

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

DR_Error (DR_ERROR_RUNTIME)

C Extension 모듈 에러 발생 시

DR_Error (DR_ERROR_STOP)

프로그램 강제 종료 시

예제

Python
# output 접점: 1번=OFF, 2번=OFF, 3번=ON, 4번=ON인 경우 
res = get_digital_outputs(bit_list=[1,2,3,4])
#res 기대값 = 0b1100(이진수), 12(십진수), 0x0C(16진수) 

# output 접점: 5번=ON, 6번=ON, 7번=OFF, 8번=ON인 경우
res = get_digital_outputs([5,6,7,8]) 
#res 기대값 = 0b1011(이진수), 11(십진수), 0x0B(16진수)

Keyword

get / digital / outputs / get_ / get_digital / digital_outputs


get_digital_outputs(bit_start, bit_end)

기능

컨트롤러의 디지털 출력 시작 접점(start_index)부터 마지막 접점(end_index)까지 한 번에 복수 신호를 불러오기 위한 명령문입니다.

인수

인수명

자료형

기본값

설명

bit_start

int

-

출력 신호 시작 접점 번호 (1~16)

bit_end

int

-

출력 신호 끝 접점 번호 (1~16)

알아두기

bit_end는 bit_start 보다 큰 값 이어야 합니다.

리턴

설명

int (>=0)

한번에 읽은 복수 개의 접점 값

bit_start =LSB, bit_end=MSB 가 되는 비트 조합의 값

음수 값

실패

예외

예외

설명

DR_Error (DR_ERROR_TYPE)

인수들의 데이터형 오류 시

DR_Error (DR_ERROR_VALUE)

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

DR_Error (DR_ERROR_RUNTIME)

C Extension 모듈 에러 발생 시

DR_Error (DR_ERROR_STOP)

프로그램 강제 종료 시

예제

Python
# output 접점: 1번=OFF, 2번=OFF, 3번=ON, 4번=ON인 경우 
res = get_digital_outputs(bit_start=1, bit_end=4)
# res 기대값 = 0b1100(이진수), 12(십진수), 0x0C(16진수)

Keyword

get / digital / outputs / get_ / get_digital / digital_outputs