From 37fbd1a77316ae6664d272a4d2457e09caf847bf Mon Sep 17 00:00:00 2001 From: tongju12 Date: Fri, 1 Mar 2024 13:18:46 -0800 Subject: [PATCH] Li2K4 target positions setup and EPS done --- .../_Config/IO/Device 1 (EtherCAT).xti | 1 + .../tmo_motion/POUs/PRG_LI2K4_IP1.TcPOU | 40 ++- plc-tmo-motion/tmo_motion/tmo_motion.tmc | 234 ++++-------------- 3 files changed, 82 insertions(+), 193 deletions(-) diff --git a/plc-tmo-motion/_Config/IO/Device 1 (EtherCAT).xti b/plc-tmo-motion/_Config/IO/Device 1 (EtherCAT).xti index 38ce751..2a3124f 100644 --- a/plc-tmo-motion/_Config/IO/Device 1 (EtherCAT).xti +++ b/plc-tmo-motion/_Config/IO/Device 1 (EtherCAT).xti @@ -46,6 +46,7 @@ + diff --git a/plc-tmo-motion/tmo_motion/POUs/PRG_LI2K4_IP1.TcPOU b/plc-tmo-motion/tmo_motion/POUs/PRG_LI2K4_IP1.TcPOU index 7a0a67a..55ed8a9 100644 --- a/plc-tmo-motion/tmo_motion/POUs/PRG_LI2K4_IP1.TcPOU +++ b/plc-tmo-motion/tmo_motion/POUs/PRG_LI2K4_IP1.TcPOU @@ -24,28 +24,54 @@ VAR li2k4_enumGet: ENUM_LaserCoupling_States; fbStateSetup: FB_StateSetupHelper; stDefault: ST_PositionState :=( + fDelta :=0.5, fVelocity := 0.5, - bMoveOK := TRUE, bValid := TRUE ); aLI2K4XStates: ARRAY[1..GeneralConstants.MAX_STATES] OF ST_PositionState; aLI2K4YStates: ARRAY[1..GeneralConstants.MAX_STATES] OF ST_PositionState; + + bLI2K4XOut: BOOL; + bLI2K4YIn: BOOL; END_VAR ]]> - In move Y then move X + IN->OUT move X thenm move Y + +bLI2K4XOut := F_AtPositionState(stMotionStage:=Main.M46, stPositionState:=aLI2K4XStates[ENUM_LaserCoupling_States.OUT]); +bLI2K4YIn := F_AtPositionState(stMotionStage:=Main.M45, stPositionState:=aLI2K4YStates[ENUM_LaserCoupling_States.Mirror1]); + +aLI2K4XStates[ENUM_LaserCoupling_States.OUT].bMoveOk := FALSE; +aLI2K4XStates[ENUM_LaserCoupling_States.Mirror1].bMoveOk := FALSE; +aLI2K4YStates[ENUM_LaserCoupling_States.OUT].bMoveOk := FALSE; +aLI2K4YStates[ENUM_LaserCoupling_States.Mirror1].bMoveOk := FALSE; + +IF bLI2K4YIn THEN + aLI2K4XStates[ENUM_LaserCoupling_States.OUT].bMoveOk := TRUE; + aLI2K4XStates[ENUM_LaserCoupling_States.Mirror1].bMoveOk := TRUE; +END_IF + +IF bLI2K4XOut THEN + aLI2K4YStates[ENUM_LaserCoupling_States.Mirror1].bMoveOk := TRUE; + aLI2K4YStates[ENUM_LaserCoupling_States.OUT].bMoveOk := TRUE; +END_IF + +//LI2K4 sequenct move : OUT->IN Y move first and then X moves IN->OUT X moves first then Y fbLI2K4States( stMotionStage1:=Main.M45, diff --git a/plc-tmo-motion/tmo_motion/tmo_motion.tmc b/plc-tmo-motion/tmo_motion/tmo_motion.tmc index 8088aa5..ae50de2 100644 --- a/plc-tmo-motion/tmo_motion/tmo_motion.tmc +++ b/plc-tmo-motion/tmo_motion/tmo_motion.tmc @@ -1,5 +1,5 @@ - + ST_System @@ -6256,11 +6256,6 @@ DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_BOOL @@ -6396,11 +6391,6 @@ DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_STRING @@ -6557,11 +6547,6 @@ DINT 32 - - __Index__0 - DINT - 32 - GetNumberOfSuccessfulTests @@ -6671,11 +6656,6 @@ DINT 32 - - __Index__0 - DINT - 32 - SetTestFailed @@ -6809,11 +6789,6 @@ DINT 32 - - __Index__0 - DINT - 32 - IsTestFinished @@ -7294,11 +7269,6 @@ DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_SINT @@ -8064,11 +8034,6 @@ DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_TIME @@ -8460,11 +8425,6 @@ DINT 32 - - __Index__0 - DINT - 32 - AssertArrayEquals_INT @@ -8559,11 +8519,6 @@ DINT 32 - - __Index__0 - DINT - 32 - AssertFalse @@ -8688,11 +8643,6 @@ DINT 32 - - __Index__0 - DINT - 32 - AssertArrayEquals_LWORD @@ -8797,11 +8747,6 @@ DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_LWORD @@ -9115,11 +9060,6 @@ DINT 32 - - __Index__0 - DINT - 32 - AreAllTestsFinished @@ -9287,11 +9227,6 @@ DINT 32 - - __Index__0 - DINT - 32 - FindTestSuiteInstancePath @@ -9473,11 +9408,6 @@ DINT 32 - - __Index__0 - DINT - 32 - AssertArrayEquals_LREAL @@ -9578,11 +9508,6 @@ DINT 32 - - __Index__0 - DINT - 32 - @@ -18031,7 +17956,7 @@ contributing fast faults, unless the FFO is currently vetoed. - UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite) + UINT (1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite) 16 UINT @@ -18045,6 +17970,21 @@ contributing fast faults, unless the FFO is currently vetoed. + + UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites) + 16 + UINT + + + LowerBorder + 1 + + + UpperBorder + 1000 + + + FB_AdsTestResultLogger @@ -18062,7 +18002,7 @@ contributing fast faults, unless the FFO is currently vetoed. PrintingTestSuiteResultNumber - UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites) + UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites) 16 96 @@ -18100,12 +18040,12 @@ contributing fast faults, unless the FFO is currently vetoed. TestsInTestSuiteCounter - UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite) + UINT (1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite) 16 MaxNumberOfTestsToPrint - UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite) + UINT (1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite) 16 @@ -18936,7 +18876,7 @@ contributing fast faults, unless the FFO is currently vetoed. WritingTestSuiteResultNumber - UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites) + UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites) 16 530208 @@ -19319,21 +19259,6 @@ contributing fast faults, unless the FFO is currently vetoed. - - UINT (1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite) - 16 - UINT - - - LowerBorder - 1 - - - UpperBorder - 100 - - - U_ExpectedOrActual 4096 @@ -20769,11 +20694,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - FindTestSuiteInstancePath @@ -20889,7 +20809,7 @@ contributing fast faults, unless the FFO is currently vetoed. NumberOfTestsToAnalyse - UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites) + UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites) 16 @@ -21032,11 +20952,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertArrayEquals_BYTE @@ -21141,11 +21056,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_DATE @@ -21302,11 +21212,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_LTIME @@ -21432,11 +21337,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_LREAL @@ -21578,11 +21478,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals @@ -22341,11 +22236,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - SetHasStartedRunning @@ -22394,7 +22284,7 @@ contributing fast faults, unless the FFO is currently vetoed. NumberOfTestsToAnalyse - UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites) + UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites) 16 @@ -22506,11 +22396,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - GetHasStartedRunning @@ -22616,11 +22501,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_WSTRING @@ -22772,11 +22652,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_DINT @@ -22902,11 +22777,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertEquals_STRING @@ -22975,7 +22845,7 @@ contributing fast faults, unless the FFO is currently vetoed. NumberOfTestsToAnalyse - UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites) + UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites) 16 @@ -23082,11 +22952,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertArray3dEquals_LREAL @@ -23369,11 +23234,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - CalculateAndSetNumberOfAssertsForTest @@ -23424,7 +23284,7 @@ contributing fast faults, unless the FFO is currently vetoed. NumberOfTestsToAnalyse - UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites) + UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites) 16 @@ -23783,7 +23643,7 @@ contributing fast faults, unless the FFO is currently vetoed. NumberOfTestsToAnalyse - UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestSuites) + UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites) 16 @@ -24167,11 +24027,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - AssertArrayEquals_UDINT @@ -24266,11 +24121,6 @@ contributing fast faults, unless the FFO is currently vetoed. DINT 32 - - __Index__0 - DINT - 32 - @@ -59868,7 +59718,7 @@ Digital outputs 0 PlcTask Inputs 0 - 87228416 + 87293952 PRG_AL1K4_L2SI.fbAL1K4.fbYStage.fbDriveVirtual.MasterAxis.NcToPlc 2048 @@ -71350,7 +71200,7 @@ Digital outputs 1 PlcTask Outputs 0 - 87228416 + 87293952 PRG_AL1K4_L2SI.fbAL1K4.fbYStage.fbDriveVirtual.MasterAxis.PlcToNc 1024 @@ -74291,7 +74141,7 @@ Digital outputs 3 PlcTask Internal 0 - 87228416 + 87293952 DefaultGlobals.stSys Included for you @@ -82124,12 +81974,12 @@ Digital outputs ST_PositionState - .fVelocity + .fDelta 0.5 - .bMoveOK - 1 + .fVelocity + 0.5 .bValid @@ -83837,6 +83687,12 @@ Digital outputs 688556320 + + PRG_LI2K4_IP1.bLI2K4XOut + 8 + BOOL + 688556328 + Constants.RuntimeVersionNumeric 32 @@ -84383,12 +84239,18 @@ Digital outputs 688603904 + + PRG_LI2K4_IP1.bLI2K4YIn + 8 + BOOL + 694586272 + 4 PlcTask Retains 0 - 87228416 + 87293952 PMPS_GVL.SuccessfulPreemption Any time BPTM applies a new BP request which is confirmed @@ -84468,15 +84330,15 @@ Digital outputs ChangeDate - 2024-02-20T12:26:31 + 2024-02-27T13:32:36 GeneratedCodeSize - 1081344 + 1007616 GlobalDataSize - 85659648 + 85598208