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

Definition

thread_state(th_id)

Features

This function checks the status of a thread.

Parameters

Parameter Name

Data Type

Default Value

Description

th_id

int

-

Thread ID to check the status

Return

Value

Description

1

RUN (TH_STATE_RUN)

2

PAUSE (TH_STATE_PAUSE)

3

STOP (TH_STATE_STOP)

Exception

Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

Example

Python
def fn_th_func():
	if check_motion()==0:	# No motion in action
		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_