Requesting the last valid status in #WAIT MC_Status

After one or more previous #WAIT MC_Status commands, 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.
The numerical values stored in the constants apply as return values.

The following constants for status are available in the CNC code:

They are used to compare a stored variable after a #MCV_WAIT_STATUS.

Release Note

release_note

Available as of V3.1.3110.

Syntax:

#MCV_WAIT_STATUS [JobID=..]

JobID=..

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

Notice

notice

To call this function, it requires one or more #WAIT MC_Status commands with the same JobID=... for the number stored in <JobID>.

If this is not the case, an error is output.

Programing Example

prg_example

Waiting for a job signal

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.

The valid state when #WAIT MC_Status is enabled can be analysed.

%Example MC_Wait

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

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

N020 V.P.McStatus = MCV_WAIT_STATUS [633]

N030 $IF V.P.McStatus != MC_DONE

N040   #ERROR [ID455 MID0 RC2 PV1=V.P.McStatus \
              PV2=MC_DONE PM1=3 PM2=633]

N050 $ENDIF

N100 M30