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 value | Description |
---|---|
0 | The function is called successfully |
-101 | Invalid input parameter |
-102 | The target object does not exist. This typically occurs when the system initialization is incomplete, and calling other functions may return this value |
-103 | The target object is currently in an inoperable state |
Parameter Option
Parameter | Type | Description |
---|---|---|
line | int | The line number where the instruction will be inserted, parameter range: 0 < line < (NRC_GetJobfileLineSum()+1) |
port | int | The number of the digital input port to be detected, parameter range: port > 0 |
value | int | The input state to wait for; 0: low level; 1: high level |
timeoutSec | double | Timeout 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 |
now | bool | Whether 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