• 大小: 3.4MB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2023-10-14
  • 语言: C#
  • 标签: FOCAS  fanuc  

资源简介

FOCAS开发

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Reflection;

namespace FANUC
{
    public partial class alarm : Form
    {
        public alarm()
        {
            InitializeComponent();
        }
        Fanuc.ODBSYS sys = new Focas1.ODBSYS();
        public void rd_sys_info()//读取cnc系统内的信息,比如轴数dengdeng
        {
            Fanuc.cnc_sysinfo(Fanuc.h sys);
            toolStripStatusLabel1.Text = “主轴数:  “ + sys.axes[0].ToString();
            toolStripStatusLabel2.Text = “被控制的伺服轴数;    “ + sys.axes[1].ToString();


        }
        Fanuc.IODBTIMER timer = new Focas1.IODBTIMER();
        public void get_timer()//获取时间
        {
            Fanuc.cnc_gettimer(Fanuc.h timer);
            string time = timer.date.year + “ 年“ + timer.date.month + “  月“ + timer.date.date + “  日“ + timer.time.hour + “  时“ + timer.time.minute + “  分“ + timer.time.second + “  秒“;
            toolStripStatusLabel3.Text = time;


        }
        public void set_timer()//设置时间
        {
            Fanuc.cnc_settimer(Fanuc.h timer);
        }


        //有报警有关的
        Fanuc.OPMSG opmsg = new Focas1.OPMSG();
        public void get_op_msg()//得到 操作信息的内容
        {
            short ret = Fanuc.cnc_rdopmsg(Fanuc.h 0 6 + 256 opmsg);
            string str2 = “msg“;

            System.Type type = opmsg.GetType();


            if (ret == 0)
            {
                for (int i = 1; i < 6; i++)
                {
                    str2 = “msg“ + i;
                    object obj = type.GetField(str2).GetValue(opmsg);
                    System.Type type2 = obj.GetType();
                    if (Convert.ToInt16(type2.GetField(“datano“).GetValue(obj)) != -1)
                    {
                        if (Convert.ToInt16(type2.GetField(“datano“).GetValue(obj)) == 0)
                        {

                            break;
                        }
                        else
                        {
                            listBox3.Items.Add(“操作信息: “ + type2.GetField(“datano“).GetValue(obj).ToString() + type2.GetField(“data“).GetValue(obj).ToString());
                        }
                    }
                    else
                        MessageBox.Show(“无操作信息“);
                }
            }

            else
            {

                MessageBox.Show(ret + “ “);
            }


        }
        Fanuc.ODBST obst = new Focas1.ODBST();
        public void get_state()//获取机器的状态
        {
            Fanuc.cnc_statinfo(Fanuc.h obst);
            listBox4.Items.Add(“运行状态“ + obst.run);//0停止,1待机,开动
            listBox4.Items.Add(“警报状态“ + obst.alarm);//0没有警报,1表示有警报
            listBox4.Items.Add(“自动模式下的选择“ + obst.aut);
            listBox4.Items.Add(“手动模式下的选择“ + obst.mstb);

 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     23040  2016-10-13 13:12  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\.vs\FANUC\v14\.suo

     文件      20175  2016-06-03 15:39  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\alarm.cs

     文件      29690  2016-06-03 13:45  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\alarm.designer.cs

     文件       6190  2016-06-03 15:39  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\alarm.resx

     文件        187  2016-05-28 15:33  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\App.config

     文件     242688  2016-10-13 13:10  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\FANUC.exe

     文件        187  2016-05-28 15:33  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\FANUC.exe.config

     文件     394752  2016-10-13 13:10  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\FANUC.pdb

     文件      22696  2016-10-13 13:12  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\FANUC.vshost.exe

     文件        187  2016-05-28 15:33  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\FANUC.vshost.exe.config

     文件        490  2015-10-22 09:54  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\FANUC.vshost.exe.manifest

     文件    1478721  2012-07-26 19:11  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\fwlib0DN.dll

     文件     393216  2012-07-06 15:09  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\Fwlib0i.dll

     文件     856064  2012-07-06 15:13  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\Fwlib0iB.dll

     文件    1503293  2012-07-26 19:04  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\fwlib0iD.dll

     文件     262144  2012-07-06 15:44  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\Fwlib150.dll

     文件     339968  2012-07-06 15:48  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\Fwlib15i.dll

     文件     856064  2012-07-06 15:52  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\Fwlib160.dll

     文件     212992  2012-07-06 15:56  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\Fwlib16W.dll

     文件    1777725  2012-07-26 19:19  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\fwlib30i.dll

     文件     522373  2011-02-16 15:06  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\fwlib32.cs

     文件     536576  2012-07-26 19:00  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\Fwlib32.dll

     文件    1095254  2012-07-26 18:58  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\Fwlib32.lib

     文件     839680  2012-07-26 20:02  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\fwlibe1.dll

     文件    1753153  2012-07-26 19:57  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\fwlibNCG.dll

     文件     118784  2012-07-06 15:58  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\Fwlibpm.dll

     文件     512000  2012-07-06 16:00  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\Fwlibpmi.dll

     文件       6469  2004-10-20 16:50  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\fwpmcalm.ini

     文件      53370  2011-02-14 10:58  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\bin\Debug\FwSymbol.h

     文件       7574  2016-05-31 19:40  FOCAS_API_DEMO_VS2015_C#_FORM_V1.0\FANUC\control_axis.cs

............此处省略85个文件信息

评论

共有 条评论