Waiting for the status of the commanded job

The #WAIT command is used to synchronise a commanding program with a job that the client previously commanded (requested). The commanding program is stopped until the expected status occurs. If several alternative states are specified, it is enough to fulfil one of the requested statuses for the program to continue running. The last valid return value of #WAIT MC_Status can be read out by the MCV_WAIT_STATUS function and used to continue program execution.

Available as of V3.1.3110

Syntax of the NC command:

#WAIT MC_Status [ JobID=.. [MC_NEW] [MC_BUSY] [MC_ACTIVE] [MC_DONE]
                                               [MC_ABORTED] [MC_ERROR] ]

JobID=..

User-specific JobID/job identification number. Every number must be unique in the commanding program.

MC_NEW

New job received but not yet processed in the commanded channel.

MC_BUSY

New job waits for execution in the commanded channel.

MC_ACTIVE

The job is active in the commanded channel but was not completed.

MC_DONE

The job was successfully completed in the commanded channel.

MC_ABORTED

The job was aborted in the commanded channel before completion.
An abort can be forced by a reset command, e.g. #MC_GroupResetForced.

MC_ERROR

An error occurred while the job is in progress.

Properties:

Notice

notice

If no expected status is defined for #WAIT MC_Status, an implicit MC_DONE and MC_ABORTED apply.

Programing Example

prg_example

Waiting for job state

The program starts a “SlaveFile”.nc program in logical channel 3 with job 633, then waits for the job to be completed with the alternative states MC_DONE, MC_ABORTED or MC_ERROR. If none of the states is reached, the program stops.

%Example MC_Wait

N010 #MC_MovePath SYN[ CH=3 JobID=633 FileName=”SlaveFile.nc”]

N020 #WAIT MC_Status [JobID=633 MC_DONE MC_ABORTED MC_ERROR]

N100 M30