Skip to main content

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

Insert WAIT instruction into the job file

Before calling this function, please call NRC_CreateJobfile(std::string jobname) or NRC_OpenJobfile(std::string jobname) to create or open a job file

Type

int=>Insert WAIT instruction into the job file

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
lineintThe line number where the instruction will be inserted, parameter range: 0 < line < (NRC_GetJobfileLineSum()+1)
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_JobfileInsertWAIT(1,1, 1,3.5,0);
//Insert the WAIT instruction in the first line of the job file, 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