Linux跨平台免授权CNC数控数据采集协议,TCP协议(Fanuc、三菱、西门子、海德汉、马扎克、兄弟、哈斯、广数、凯恩帝knd)设备联网,cnc采集,数控跨平台,支持Linux系统

    ushort length = 48;
            b = 0;
            char[] c = new char[(int)length];
            ret = Focas1.cnc_rdexecprog(this.h, ref length, out b, c);
            bool flag23 = ret == 0;
            if (flag23)
            {
                this.dangqianyunxingneirong.Text = new string(c);
            }
            b = -1;
            num = 11;
            Focas1.ODBALMMSG2 odbalmmsg2 = new Focas1.ODBALMMSG2();
            ret = Focas1.cnc_rdalmmsg2(this.h, b, ref num, odbalmmsg2);
            string alarmmsg = "";
            Type type3 = odbalmmsg2.GetType();
            bool flag24 = ret == 0;
            if (flag24)
            {
                for (int i = 1; i < 9; i++)
                {
                    string str2 = "msg" + i.ToString();
                    object obj = type3.GetField(str2).GetValue(odbalmmsg2);
                    Type type4 = obj.GetType();
                    bool flag25 = type4.GetField("alm_msg").GetValue(obj).ToString() != "";
                    if (flag25)
                    {
                        string msg = Form1.getalmgrp((short)type4.GetField("type").GetValue(obj)).ToString() + type4.GetField("alm_no").GetValue(obj).ToString() + type4.GetField("alm_msg").GetValue(obj).ToString();
                        alarmmsg = alarmmsg + msg + "/";
                    }
                }
                this.dangqianbaojing.Text = alarmmsg;
            }
            Focas1.ODBM odb = new Focas1.ODBM();
            ret = Focas1.cnc_rdmacro(this.h, 4120, 10, odb);
            bool flag26 = ret == 0;
            if (flag26)
            {
                this.dangqiandaoju.Text = ((double)odb.mcr_val * Math.Pow(10.0, (double)(-(double)odb.dec_val))).ToString();
            }
            bool flag27 = Form1.Get_Func_Type(this.h) == "T";
            if (flag27)
            {
                this.daobubianhao.Text = ((int)(Form1.Get_Func_Mode(this.h, "T") % 100)).ToString();
            }
            else
            {
                bool flag28 = Form1.Get_Func_Type(this.h) == "M";
                if (flag28)
                {
                    this.daobubianhao.Text = Form1.Get_Func_Mode(this.h, "H").ToString();
                }
            }

  • 13
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

cnc设备联网

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值