From 380d1094e65ed1db6a17c1e018cd28f4b3139be4 Mon Sep 17 00:00:00 2001 From: tongju12 Date: Thu, 29 Aug 2024 08:59:28 -0700 Subject: [PATCH] modify parameters after swapping the mirror --- plc-tmo-motion/_Config/PLC/tmo_motion.xti | 2 +- plc-tmo-motion/plc-tmo-motion.tsproj | 4 - .../tmo_motion/POUs/PRG_LI2K4_IP1.TcPOU | 18 ++--- .../Sequence_Mover/FB_SequenceMover2D.TcPOU | 16 +++- plc-tmo-motion/tmo_motion/tmo_motion.tmc | 75 ++++++++----------- 5 files changed, 52 insertions(+), 63 deletions(-) diff --git a/plc-tmo-motion/_Config/PLC/tmo_motion.xti b/plc-tmo-motion/_Config/PLC/tmo_motion.xti index 5c2c72e..6a7225b 100644 --- a/plc-tmo-motion/_Config/PLC/tmo_motion.xti +++ b/plc-tmo-motion/_Config/PLC/tmo_motion.xti @@ -1260,7 +1260,7 @@ External Setpoint Generation: - + tmo_motion Instance {08500001-0000-0000-F000-000000000064} diff --git a/plc-tmo-motion/plc-tmo-motion.tsproj b/plc-tmo-motion/plc-tmo-motion.tsproj index 3df9dc5..fa9d653 100644 --- a/plc-tmo-motion/plc-tmo-motion.tsproj +++ b/plc-tmo-motion/plc-tmo-motion.tsproj @@ -39,12 +39,8 @@ - - - - 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 9daa3ad..86ba3dd 100644 --- a/plc-tmo-motion/tmo_motion/POUs/PRG_LI2K4_IP1.TcPOU +++ b/plc-tmo-motion/tmo_motion/POUs/PRG_LI2K4_IP1.TcPOU @@ -60,11 +60,11 @@ fbMotionLI2K4X(stMotionStage:=Main.M46); //LI2K4 2DPMPS fbStateSetup(stPositionState:=stDefault, bSetDefault:=TRUE); -fbStateSetup(stPositionState:=aLI2K4XStates[ENUM_LaserCoupling_States.OUT], fDelta := 0.5, sName := 'OUT', fPosition:=-0.75); +fbStateSetup(stPositionState:=aLI2K4XStates[ENUM_LaserCoupling_States.OUT], fDelta := 0.1, sName := 'OUT', fPosition:=-0.214); fbStateSetup(stPositionState:=aLI2K4YStates[ENUM_LaserCoupling_States.OUT], fDelta := 0.5, sName := 'OUT', fPosition:=133.0); -fbStateSetup(stPositionState:=aLI2K4XStates[ENUM_LaserCoupling_States.Mirror1],fDelta := 5.0, sName := 'MIRROR1', fPosition:=-3.375); -fbStateSetup(stPositionState:=aLI2K4YStates[ENUM_LaserCoupling_States.Mirror1],fDelta := 5.0, sName := 'MIRROR1', fPosition:=84.5); +fbStateSetup(stPositionState:=aLI2K4XStates[ENUM_LaserCoupling_States.Mirror1],fDelta := 0.4, sName := 'MIRROR1', fPosition:=-0.795); +fbStateSetup(stPositionState:=aLI2K4YStates[ENUM_LaserCoupling_States.Mirror1],fDelta := 0.5, sName := 'MIRROR1', fPosition:=80.896); aLI2K4YStates[ENUM_LaserCoupling_States.OUT].stPMPS.sPmpsState := 'LI2K4:IP1-OUT'; aLI2K4YStates[ENUM_LaserCoupling_States.Mirror1].stPMPS.sPmpsState := 'LI2K4:IP1-MIRROR1'; @@ -73,18 +73,18 @@ aLI2K4XStates[ENUM_LaserCoupling_States.Mirror1].stPMPS.sPmpsState := 'LI2K4:IP1 //LI2K4 EPS condition: OUT->In move Y then move X + IN->OUT move X thenm move Y //Y only can move up and down when X is OUT -{* + EPS_LI2K4Y_Positive(eps:=Main.M45.stEPSForwardEnable); -EPS_LI2K4Y_Positive.setBit(nBits := 0, bValue:= Main.M46.stAxisStatus.fActPosition > -0.8 OR Main.M45.stAxisStatus.fActPosition < 85); +EPS_LI2K4Y_Positive.setBit(nBits := 0, bValue:= Main.M46.stAxisStatus.fActPosition > -0.3 OR Main.M45.stAxisStatus.fActPosition < 82); EPS_LI2K4Y_Negative(eps:=Main.M45.stEPSBackwardEnable); -EPS_LI2K4Y_Negative.setBit(nBits := 0, bValue:= Main.M46.stAxisStatus.fActPosition > -0.8 OR Main.M45.stAxisStatus.fActPosition > 84); +EPS_LI2K4Y_Negative.setBit(nBits := 0, bValue:= Main.M46.stAxisStatus.fActPosition > -0.3 OR Main.M45.stAxisStatus.fActPosition > 79); EPS_LI2K4X_Positive(eps:=Main.M46.stEPSForwardEnable); -EPS_LI2K4X_Positive.setBit(nBits := 0, bValue:= Main.M45.stAxisStatus.fActPosition < 85 OR Main.M46.stAxisStatus.fActPosition < -0.65); +EPS_LI2K4X_Positive.setBit(nBits := 0, bValue:= Main.M45.stAxisStatus.fActPosition < 82 OR Main.M46.stAxisStatus.fActPosition < -0.114); EPS_LI2K4X_Negative(eps:=Main.M46.stEPSBackwardEnable); -EPS_LI2K4X_Negative.setBit(nBits := 0, bValue:= Main.M45.stAxisStatus.fActPosition < 85 OR Main.M46.stAxisStatus.fActPosition > -0.85); +EPS_LI2K4X_Negative.setBit(nBits := 0, bValue:= Main.M45.stAxisStatus.fActPosition < 82 OR Main.M46.stAxisStatus.fActPosition > -0.314); + -*} //LI2K4 sequenct move : OUT->IN Y move first and then X moves IN->OUT X moves first then Y diff --git a/plc-tmo-motion/tmo_motion/POUs/Sequence_Mover/FB_SequenceMover2D.TcPOU b/plc-tmo-motion/tmo_motion/POUs/Sequence_Mover/FB_SequenceMover2D.TcPOU index b3b3173..b0983f2 100644 --- a/plc-tmo-motion/tmo_motion/POUs/Sequence_Mover/FB_SequenceMover2D.TcPOU +++ b/plc-tmo-motion/tmo_motion/POUs/Sequence_Mover/FB_SequenceMover2D.TcPOU @@ -155,7 +155,9 @@ CASE nState OF stPMPSPlcToEpics=>stPMPSPlcToEpics, ); tonStateSequenceTimeout(IN:=NOT stMotionStage1.bBusy,PT:=tStateSequenceTimeoutTime); - IF eEnumGet1 = nGoal THEN + IF stMotionStage1.Axis.NcToPlc.ActPos >= astPositionState1[nGoal].fPosition - astPositionState1[nGoal].fDelta AND + stMotionStage1.Axis.NcToPlc.ActPos <= astPositionState1[nGoal].fPosition + astPositionState1[nGoal].fDelta THEN + eEnumGet1 := nGoal; eEnumSet := nGoal; tonStateSequenceTimeout(IN:=FALSE); nState := 10; @@ -183,7 +185,9 @@ CASE nState OF stPMPSPlcToEpics=>stPMPSPlcToEpics, ); tonStateSequenceTimeout(IN:=NOT stMotionStage2.bBusy,PT:=tStateSequenceTimeoutTime); - IF eEnumGet2 = nGoal THEN + IF stMotionStage2.Axis.NcToPlc.ActPos >= astPositionState2[nGoal].fPosition - astPositionState2[nGoal].fDelta AND + stMotionStage2.Axis.NcToPlc.ActPos <= astPositionState2[nGoal].fPosition + astPositionState2[nGoal].fDelta THEN + eEnumGet2 := nGoal; eEnumSet := nGoal; tonStateSequenceTimeout(IN:=FALSE); nState := 20; @@ -211,7 +215,9 @@ CASE nState OF stPMPSPlcToEpics=>stPMPSPlcToEpics, ); tonStateSequenceTimeout(IN:=NOT stMotionStage2.bBusy,PT:=tStateSequenceTimeoutTime); - IF eEnumGet2 = nGoal THEN + IF stMotionStage2.Axis.NcToPlc.ActPos >= astPositionState2[nGoal].fPosition - astPositionState2[nGoal].fDelta AND + stMotionStage2.Axis.NcToPlc.ActPos <= astPositionState2[nGoal].fPosition + astPositionState2[nGoal].fDelta THEN + eEnumGet2 := nGoal; nState := 0; tonStateSequenceTimeout(IN:=FALSE); ELSIF tonStateSequenceTimeout.Q THEN @@ -237,7 +243,9 @@ CASE nState OF stPMPSPlcToEpics=>stPMPSPlcToEpics, ); tonStateSequenceTimeout(IN:=NOT stMotionStage1.bBusy,PT:=tStateSequenceTimeoutTime); - IF eEnumGet1 = nGoal THEN + IF stMotionStage1.Axis.NcToPlc.ActPos >= astPositionState1[nGoal].fPosition - astPositionState1[nGoal].fDelta AND + stMotionStage1.Axis.NcToPlc.ActPos <= astPositionState1[nGoal].fPosition + astPositionState1[nGoal].fDelta THEN + eEnumGet1 := nGoal; nState := 0; tonStateSequenceTimeout(IN:=FALSE); ELSIF tonStateSequenceTimeout.Q THEN diff --git a/plc-tmo-motion/tmo_motion/tmo_motion.tmc b/plc-tmo-motion/tmo_motion/tmo_motion.tmc index b5f7ef7..eeaf4af 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 @@ -19263,21 +19263,6 @@ contributing fast faults, unless the FFO is currently vetoed. - - USINT (USINT#1..255) - 8 - USINT - - - LowerBorder - 1 - - - UpperBorder - 255 - - - E_IPCDiag_Datatype parameter datatype 1..15 @@ -20886,7 +20871,7 @@ contributing fast faults, unless the FFO is currently vetoed. nParameterIdx - USINT (USINT#1..255) + USINT (1..255) 8 @@ -24747,7 +24732,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 @@ -24761,6 +24746,21 @@ contributing fast faults, unless the FFO is currently vetoed. + + UINT (1..GVL_Param_TcUnit.MaxNumberOfTestSuites) + 16 + UINT + + + LowerBorder + 1 + + + UpperBorder + 1000 + + + FB_AdsTestResultLogger @@ -24778,7 +24778,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 192 @@ -24816,12 +24816,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 @@ -25754,7 +25754,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 530752 @@ -26156,21 +26156,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 @@ -27794,7 +27779,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 @@ -29329,7 +29314,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 @@ -29914,7 +29899,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 @@ -30362,7 +30347,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 @@ -30736,7 +30721,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 @@ -100443,7 +100428,7 @@ second version of targets paddle 2 We do this by defining an array, in where we can see which current TEST_ORDERED() is the one to be handled right now. The below array is only used for TEST_ORDERED()-tests. 16000 - UINT (UINT#1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite) + UINT (1..GVL_Param_TcUnit.MaxNumberOfTestsForEachTestSuite) 1 1000 @@ -104595,11 +104580,11 @@ second version of targets paddle 2 ChangeDate - 2024-08-22T11:36:35 + 2024-08-28T15:32:09 GeneratedCodeSize - 1282048 + 1228800 GlobalDataSize