Skip to main content

NRC_RunqueueInsertWAIT( int port, int value, double timeoutSec, bool now=false)

Insert WAIT instruction in the run queue

Before calling this function, please call NRC_CreateNoFlieRunqueue() to create a fileless run queue

Type

int=>Insert WAIT instruction in the run queue

Return valueDescription
0The function is called successfully
-101Invalid input parameter
-102The target object does not exist. This typically occurs when the system initialization is incomplete, and calling other functions may return this value
-103The target object is currently in an inoperable state

Parameter Option

ParameterTypeDescription
portintThe number of the digital input port to be detected, parameter range: port > 0
valueintThe input state to wait for; 0: low level; 1: high level
timeoutSecdoubleTimeout time, in seconds, parameter range: timeSec >= 0; If the requirement is not met after waiting for "timeoutSec" seconds, the instruction will stop waiting and end. If the value is 0, it will wait indefinitely until the condition is met
nowboolWhether PL is continuous

Sample code

NRC_RunqueueInsertWAIT(1, 1,3.5,0);
//Insert the WAIT instruction in the run queue, wait for DIN1 to be in a high level state, execute the following instructions after waiting for 3.5 seconds, and the PL is not continuous