Ejemplo n.º 1
0
        //-------------------------------------------------------------------------------------------------
        private void fn_UpdateMotorParameter()
        {
            for (int i = 0; i < motParameterdataTable.Rows.Count; i++)
            {
                //
                if (MOTR.fn_IsSMCMotor((EN_MOTR_ID)i))
                {
                    continue;
                }

                motParameterdataTable.Rows[i][(int)EN_MOTOR_PARAMETER.VEL]  = Math.Round(mc_Acs.fn_GetParameterVelocity(i), 3);
                motParameterdataTable.Rows[i][(int)EN_MOTOR_PARAMETER.JERK] = Math.Round(mc_Acs.fn_GetParameterJerk(i), 3);
                motParameterdataTable.Rows[i][(int)EN_MOTOR_PARAMETER.ACC]  = Math.Round(mc_Acs.fn_GetParameterAcceleration(i), 3);
                motParameterdataTable.Rows[i][(int)EN_MOTOR_PARAMETER.DEC]  = Math.Round(mc_Acs.fn_GetParameterDeceleration(i), 3);
                motParameterdataTable.Rows[i][(int)EN_MOTOR_PARAMETER.KDEC] = Math.Round(mc_Acs.fn_GetParameterKillDeceleration(i), 3);

                if (mc_Acs.fn_GetStateSoftwareRightLimit(i))
                {
                    motParameterdataTable.Rows[i][(int)EN_MOTOR_PARAMETER.SWPOT] = "ON";
                    motParameterdataTable.Rows[i]["POTBACK"] = "Red";
                }
                else
                {
                    motParameterdataTable.Rows[i][(int)EN_MOTOR_PARAMETER.SWPOT] = "OFF";
                    motParameterdataTable.Rows[i]["POTBACK"] = "LightGray";
                }

                if (mc_Acs.fn_GetStateSoftwareLeftLimit(i))
                {
                    motParameterdataTable.Rows[i][(int)EN_MOTOR_PARAMETER.SWNOT] = "ON";
                    motParameterdataTable.Rows[i]["NOTBACK"] = "Red";
                }
                else
                {
                    motParameterdataTable.Rows[i][(int)EN_MOTOR_PARAMETER.SWNOT] = "OFF";
                    motParameterdataTable.Rows[i]["NOTBACK"] = "LightGray";
                }
            }
        }