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

thread_state()

정의

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)

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

예제

Python
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)

Keyword

thread / thread_