private void MainForm_Load(object sender, EventArgs e)
        {
            rtbResult       = richTextBox1;
            btnClear        = button1;
            btnClear.Click += BtnClear_Click;

            this.CenterToScreen();

            string strADD = System.AppDomain.CurrentDomain.BaseDirectory;

            mCom = new BaseSpace.SERIALPORT(strADD + "COM.INI", false);
            mCom.TRIGGERMESSIGE += MCom_TRIGGERMESSIGE;
            mMotor = new BaseSpace.ControlMotorClass(mCom, strADD + "MOTOR_X.INI");
            mMotor.TRIGGERMESSIGE += Motor_TRIGGERMESSIGE;
            mMotorX = motorControl1;
            mMotorX.Initial(mMotor);

            timer.Interval = 20;
            timer.Tick    += Timer_Tick;
            timer.Start();
        }
 /// <summary>
 /// 初始化马达
 /// </summary>
 /// <param name="iPro">站号</param>
 /// <param name="motor">Com口 类</param>
 public JMC_MODBUS_MOTOR(byte iPro, SERIALPORT motor)
 {
     PRO         = iPro;
     mSERIALPORT = motor;
     Initial();
 }
 /// <summary>
 /// 初始化马达
 /// </summary>
 /// <param name="iPro">站号</param>
 /// <param name="INIAddress">Com口INI地址</param>
 /// <param name="isDebug">是否Debug</param>
 public JMC_MODBUS_MOTOR(byte iPro, string INIAddress, bool isDebug)
 {
     PRO         = iPro;
     mSERIALPORT = new SERIALPORT(INIAddress, isDebug);
     Initial();
 }
Exemple #4
0
 /// <summary>
 /// 初始化马达
 /// </summary>
 /// <param name="iPro">站号</param>
 /// <param name="motor">Com口 类</param>
 public ControlMotorClass(SERIALPORT motor, string Motor_INIAddress)
 {
     base.mSERIALPORT = motor;
     LOADING(Motor_INIAddress);
 }