Skip to main content
Skip table of contents

thread_state(th_id)

Features

This function checks the status of a thread.

Parameters

Parameter NameData TypeDefault ValueDescription

th_id

int

-

Thread ID to check the status

Return

ValueDescription

1

RUN (TH_STATE_RUN)

2

PAUSE (TH_STATE_PAUSE)

3

STOP (TH_STATE_STOP)

Exception

ExceptionDescription

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

Example

PY
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)
JavaScript errors detected

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

If this problem persists, please contact our support.