static void T_EXEMPLE() { ProgramInfo.KeepBlankLine = true; Run("test"); RO[1].Off(); //! bonjout if (RO[12] == OFF) { Print("pas bonjour"); } else { Print("oui"); } if (R[12] > 123) { Print("yes"); } Pos pTest = new Pos(1, "Point de test"); Pos pInter = new Pos(2); PosReg pAPproche = PR[12]; Reg valeurMax = R[69]; valeurMax.Desc = "Valeur maximu"; Reg valMin = R[1]; valMin.Desc = "valeur min"; valeurMax.Set(valMin); valeurMax.Value = valMin.Value; Reg i = R[53]; for (i.Value = 0; i.Value < valeurMax.Value; i.Value--) { Print("test"); } goto test; test: Move.Linear(pInter.Offset(PR[8]), 100, 100); Move.Linear(pTest, 50, 0); Move.Circular(pInter, pTest, 23, 0); }
private static void GlobalMove(char moveType, PosReg target, ushort fast, ushort smooth) { string formatedOffset = string.Empty; if (target.PROffset != null) { formatedOffset = " Offset," + target.PROffset.ToString(); } Generation.appendLine( $"{moveType} {target.ToString()} {fast}" + $"{((moveType == 'L') ? "mm/sec" : "%")} {smoothFormat(smooth)}{formatedOffset} ;"); }
public Pos Offset(PosReg posReg) { PROffset = posReg; return(this); }
public static void Joint(PosReg target, ushort fast, ushort smooth) { GlobalMove('J', target, fast, smooth); }
public static void Linear(PosReg target, ushort fast, ushort smooth) { GlobalMove('L', target, fast, smooth); }
static void T_PREMIER_TRAJ() { ProgramInfo.desc = "Trajectoire facile"; ProgramInfo.groupMask = "1,*,*,*,*"; ProgramInfo.type = TP_PROGRAM; ProgramInfo.keepBlankLine = true; run("T_REPLI"); Flag flagDemandeQualite = F[1]; Flag flagTest = F[2]; flagDemandeQualite.Off(); if (flagDemandeQualite.State == ON && flagTest.State == OFF || flagTest.State == ON) { //! test goto autreLabel; } //! par Louis Gobert //! Set de UTOOL et UFRAME Uframe.set(frameOrange); Utool.set(toolPince); T_OUV_PINCE(); Pos pApproche = new Pos(1); move.joint(pApproche, 100, 50); Pos jRepli = new Pos(2); Pos pPrise = new Pos(3); PosReg pCalculer = PR[12]; pCalculer.Desc = "Point calcule"; PosReg pTemp = PR[11]; pCalculer.set(pTemp); move.joint(jRepli, 12, 100); move.linear(pPrise, 123, FINE); print("Prise de la piece"); T_FERM_PINCE(); move.linear(pApproche, 12, FINE); move.joint(jRepli, 12, FINE); print("Fin du programme."); RO pince = RO[11]; if (pince.State == ON) { goto lablTest; } else { goto autreLabel; } autreLabel: if (RO[1].State == OFF) { print("Fermer"); } if (RO[12].State == ON) { print("12 fermer"); } lablTest: print("Arrive au label"); }