示例#1
0
        /// <summary>
        /// 定时器刷新处理数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void timer1_Tick(object sender, EventArgs e)//03
        {
            //你的定时处理

            //建立与plc连接
            int result = Sharp7AndPlcComm.ConnectToPlc(client);

            //判断通讯状态
            Sharp7AndPlcComm.JudgeCommStu(result, ref labCommStu);
            //调用报警列表,刷新报警文本
            AlarmList.AlarmListView(client, listView, dbNum, dbLength, dbStartElement, dbStartBit);
        }
示例#2
0
        /// <summary>
        /// 定时器刷新处理数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void timer1_Tick(object sender, EventArgs e)
        {
            //你的定时处理

            //建立与plc连接
            int result = Sharp7AndPlcComm.ConnectToPlc(client);

            //判断通讯状态
            Sharp7AndPlcComm.JudgeCommStu(result, ref labCommStu);

            if (result == 0)
            {
                strs = ReadPlcData.ReadAutoStep(client, 14, 209, 206);
                txbAutoStep1.Text = strs[0]; //当前步骤
                txbAutoStep2.Text = strs[1]; //下一步骤

                current = ReadPlcData.ReadWeldingCurrent(client);
            }

            AnimatedPlot();
        }
示例#3
0
        /// <summary>
        /// 定时器刷新处理数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void timer1_Tick(object sender, EventArgs e)
        {
            //你的定时处理

            //建立与plc连接
            int result = Sharp7AndPlcComm.ConnectToPlc(client);

            //判断通讯状态
            Sharp7AndPlcComm.JudgeCommStu(result, ref labCommStu);

            //如果通讯成功,则调用读取或写入函数
            if (result == 0)
            {
                // ReadPlcData.ReadValveSignals(ref ellipses, client, ref txtReadServoPos);
                //WritePlcData.WriteDb(client, ref txtWriteServoPos);
            }
            else//如果通讯失败,清除所有气缸信号
            {
                ReadPlcData.ClearValveSignals(client, ref ellipses);
            }
        }
示例#4
0
        /// <summary>
        /// 定时器刷新处理数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void timer1_Tick(object sender, EventArgs e)
        {
            //你的定时处理

            //建立与plc连接
            result = Sharp7AndPlcComm.ConnectToPlc(client);
            //判断通讯状态
            Sharp7AndPlcComm.JudgeCommStu(result, ref labCommStu);
            //如果通讯成功,则调用读取或写入函数
            if (result == 0)
            {
                ReadPlcData.ReadValveSignals(client, ref ellipses, readValveDbNum, readValveDbByteLength, readValveDbStartElement, readValveDbStartBit);
                position.Text = ReadPlcData.ReadManualData(client, 14, 208, 52);
                WritePlcData.WriteDb(client, ref setPosition, ref setSpeed, 14, new int[] { 60, 68 });
                //WritePlcData.WriteDb(client, ref txtWriteServoPos);
                //WritePlcData.BtnToPLC(client,ref btns, writeBtnDbNum, writeBtnDbStartElement, writeBtnDbStartBit);
            }
            else//如果通讯失败,清除所有气缸信号
            {
                ReadPlcData.ClearValveSignals(client, ref ellipses);
            }
        }