Postprocessor development
  • Postprocessor development
v3.0.3
Search Results for

    Show / Hide Table of Contents

    WAIT - Waiting for synchronization point

    Command caption

    How the command appears in the CLData command list:

    WAIT ID(<SynchPointID>), Index(<SynchPointIndex>)
    

    The WAIT command used to synchronize multiple concurrent threads of control (several NC-programs, each of which can control a separate working element of the machine). For this command should add frames (labels) to NC-program, implementing the suspension of the program until the achievement of a similar label in another (concurrent) program.

    Access from sppx

    Handler: program Wait

    Parameters available through the cmd operator

    TCLDSyncPoint: ComplexType Waiting for synchronization point command
    SyncPointID: String cmd.Str["SyncPointID"] - unique identifier of synchronization point, defined by the user.
    Index: Integer cmd.Int["Index"] - ordinal number of synchronization point automatically generated by the system.

    When a project uses a «Turn take over» operation that must be synchronized with a «Lathe part-off» operation, the SyncPointID parameter in the WAIT commands takes strictly defined values:

    • Takeover1: the wait label with this identifier is output immediately after the PPFUN TECHINFO (58) commands of both operations. Both channels wait for mutual synchronization.
    • Takeover2: on reaching the wait label with this identifier, the «Turn take over» operation moves to the main spindle and grips the part in it. The «Lathe part-off» operation stays in the waiting state until the wait label with identifier Takeover3 is reached.
    • Takeover3: on reaching the wait label with this identifier, the «Lathe part-off» operation cuts the finished part off from the main spindle. The «Turn take over» operation, holding the part being cut off, waits for the cutoff to finish, that is, for the wait label with identifier Takeover4.
    • Takeover4: on reaching the wait label with this identifier, the «Turn take over» operation begins retracting the counter-spindle with the gripped cut-off part. The «Lathe part-off» operation waits until the counter-spindle has been retracted by the Return feed distance, which is marked by the wait label with identifier Takeover5.
    • Takeover5: on reaching this wait label, the «Lathe part-off» operation retracts the tool (if required), and the «Turn take over» operation returns the counter-spindle to its initial position.
    SyncPointID «Lathe part-off» operation «Turn take over» operation
    Takeover1 Waiting for mutual synchronization Waiting for mutual synchronization
    Takeover2 Stays in the waiting state until the Takeover3 label is reached. Moves to the main spindle and grips the part in it.
    Takeover3 Cuts the finished part off from the main spindle. Holding the part being cut off, waits for the cutoff to finish (the Takeover4 label).
    Takeover4 Waits until the counter-spindle has been retracted by the Return feed distance (the Takeover5 label). Begins retracting the counter-spindle with the gripped cut-off part.
    Takeover5 Retracts the tool (if required). Returns the counter-spindle to its initial position.

    Example (from the PUMA MX series postprocessor):

    program Wait
        Call OutBl
        if NextCode= CodeOfCmd("PPFUN") then begin
          output "M01";
          NeedM1 =0;
        end
        i : integer;
        i = Cmd.Int["Index"];
        call AddWait(i);
    end
    

    Access from .NET

    Handler:

    public override void OnSyncWait(ICLDSyncWaitCommand cmd, CLDArray cld)
    

    Inheritance: ICLDSyncWaitCommand : ICLDCommand.

    Read the parameters from the strongly-typed cmd object (recommended); the raw cld[i] array (same indices as in sppx) and the named cmd["..."] helpers are available too. The table lists the command's members, including those inherited from its base interfaces; the common ICLDCommand members (navigation, CLD, CLDFile, TechOperation, ...) are described in the CLData access model.

    Member Type Description
    cmd.PointIndex int Ordinal number of the synchronization point automatically generated by the system.
    cmd.PointID string Unique textual identifier of the synchronization point, defined by the user.

    Example - OnSyncWait (from the HanwhaSwissType postprocessor):

    public override void OnSyncWait(ICLDSyncWaitCommand cmd, CLDArray cld)
    {
        int PntN = 0;    
        if (NCFiles.OutputDisabled)
            return;
        if (cmd.PointID.Contains("SubAxial2"))
            return; //Middle label in a wait main spindle operation.
        if (SameText(cmd.PointID, "Takeover1")) return;
    
        if (SameText(cmd.PointID, "Takeover2")) {
            PntN = 2;
            SynchPoints.OutPrev(cmd.PointIndex,1);
            if (nc==nc1)
            {
                SyncSpindles(true);
            }
        } else if (SameText(cmd.PointID, "Takeover3")) {
            PntN = 3;
            if (activeChannel>0)
              outClamp(false,true);
            SynchPoints.OutPrev(cmd.PointIndex,1);
            nc.WriteLine(GetSyncZCode(true));
        } else if (SameText(cmd.PointID, "Takeover4")) {
            PntN = 4;
            SynchPoints.OutPrev(cmd.PointIndex,2);
            nc.WriteLine(GetSyncZCode(false));
            if (nc==nc1) {
                SyncSpindles(false);
            } else {
                IncrementalMove=true;
            }
            SynchPoints.OutPrev(cmd.PointIndex,1);
            if (nc==nc1) {
                nc.WriteLine("S0");
            } else {
                nc.WriteLine("S40");
            }
        } else if (SameText(cmd.PointID, "Takeover5")) {
            PntN = 5;
            IncrementalMove=false;
        }
    
        SynchPoints.Add(cmd.PointIndex);
    
        if (PntN==4)
            OutDetectBrokenTool();
    
        if ((nc==nc2) && (PntN==2)) {
            outAirBlower(0);
            outClamp(false, false);
        }
        if ((nc==nc2) && (PntN==5)) {
            nc.WriteLine("M95");
            nc.WriteLine("/M91");
            nc.WriteLine("M96");
        }
    
    }
    

    See also

    • CLData access model
    In this article