Skip to main content
Skip table of contents

thread_state(th_id)

기능

Thread의 상태를 확인합니다.

인수

인수명자료형기본값설명

th_id

int

-

상태 정보를 알고자 하는 thread ID

리턴

설명

1

RUN (TH_STATE_RUN)

2

PAUSE (TH_STATE_PAUSE)

3

STOP (TH_STATE_STOP)

예외

예외설명

DR_Error (DR_ERROR_TYPE)

인수들의 데이터형 오류 시

DR_Error (DR_ERROR_VALUE)

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

예제

PY
def fn_th_func():
if check_motion()==0: # 수행 중인 모션이 없는 경우
set_digital_output(1, OFF)
else:
set_digital_output(1, ON)

th_id = thread_run(fn_th_func, loop=True)
state1 = thread_state(th_id)

thread_pause(th_id)
state2 = thread_state(th_id)

JavaScript errors detected

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

If this problem persists, please contact our support.