• 大小: 0.87M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-04-29
  • 语言: C#
  • 标签: focas  demo  FOC  OC  

资源简介

CNC_PMC_FOCAS1_DEMO

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
//using Focas1;

namespace GetAlmMsg
{

    public partial class Form1 : Form
    {
        ushort cncHandle = 0;
        private short preState = 0;
        private Focas1.ODBST cncStatus = new Focas1.ODBST();
        private Focas1.ODBAHIS alarmHis = new Focas1.ODBAHIS();

        private String paramFromFile = ““;
        public Form1()
        {
            InitializeComponent();
        }

        private void btnConnect_Click(object sender EventArgs e)
        {
            try
            {
                Focas1.focas_ret ret = (Focas1.focas_ret)Focas1.cnc_allclibhndl3(“192.168.18.8“ 8193 5 out cncHandle); //眔library handle
                //Focas1.focas_ret ret = (Focas1.focas_ret)Focas1.cnc_allclibhndl3(textBox_IP.Text 8193 5 out cncHandle); //眔library handle
                //textBox_IP
                if (ret != Focas1.focas_ret.EW_OK)
                {
                    this.rdpara.Enabled = false;
                    this.btnFileDown.Enabled = false;
                    this.btnUpload.Enabled = false;
                    throw new Exception(“Can‘t connect to CNC controller!“);
                }
                else
                {
                    this.rdpara.Enabled = true;
                    this.btnFileDown.Enabled = true;
                    this.btnUpload.Enabled = true;
                    btnConnect.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message “Message“);
            }

        }

        private void butGetAlmNo_Click(object sender EventArgs e)
        {
           DoAlmRecord(false);
           //short almNo = 0;
           //string almDate = ““;
           //string almMsg = ““;
           //almMsg = GetAlarmMessage(ref almNo ref almDate);
           //textBox1.Text = almDate;
           //textBox2.Text = almNo.ToString();
           //textBox3.Text = almMsg;

           //DoAlmRecord(true);
        }

        private void Form1_FormClosed(object sender FormClosedEventArgs e)
        {
           if ( cncHandle != 0 )
              Focas1.cnc_freelibhndl(cncHandle);
        }

        private void AlmTimer1_Tick(object sender EventArgs e)
        {
           Focas1.cnc_statinfo(cncHandle cncStatus);

           //Record the start time of Alarm
           if ( cncStatus.alarm==1 && preState==0 )
           {
              DoAlmRecord(false);

              short almNo = 0;
              string almStartTime = ““;
              string almMsg = ““;
              almMsg = GetAlarmMessage(ref almNo ref almStartTime);
              textBox1.Text = almStartTime;
              textBox2.Text = almNo.ToString();
              textBox3.Text = almMsg;

              DoAlmRecord(true);
           }

           //Record the end time of Alarm
 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\
     目录           0  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\
     文件        7431  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\Form1.Designer.cs
     文件        8281  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\Form1.cs
     文件        5889  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\Form1.resx
     文件        3233  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\GetAlmMsg.csproj
     文件         886  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\GetAlmMsg.sln
     文件         452  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\Program.cs
     目录           0  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\Properties\
     文件        1160  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\Properties\AssemblyInfo.cs
     文件        2831  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\Properties\Resources.Designer.cs
     文件        5496  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\Properties\Resources.resx
     文件        1062  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\Properties\Settings.Designer.cs
     文件         242  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\Properties\Settings.settings
     文件      467493  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Backup\fwlib32.cs
     文件        4410  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\CNC_PMC_FOCAS1_DEMO.csproj
     文件        1330  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\CNC_PMC_FOCAS1_DEMO.sln
     文件           3  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\CNC读取操作_法拉克.txt
     文件       13768  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Form1.Designer.cs
     文件       17812  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Form1.cs
     文件        6081  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Form1.resx
     文件       18432  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\GetAlmMsg.suo
     文件         452  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Program.cs
     目录           0  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Properties\
     文件        1160  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Properties\AssemblyInfo.cs
     文件        2795  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Properties\Resources.Designer.cs
     文件        5496  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Properties\Resources.resx
     文件        1083  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Properties\Settings.Designer.cs
     文件         242  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\Properties\Settings.settings
     文件       40804  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\UpgradeLog.htm
     目录           0  2020-08-14 15:24  CNC_PMC_FOCAS1_DEMO-master\bin\
............此处省略44个文件信息

评论

共有 条评论