资源简介
适用于带以太网接口的FANUC数控机床,通过FANUC自带插件获取数据

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FANUC
{
public class Fanuc : Focas1
{
public static ushort h;
//下载程序
//开始
private static short dwnstart(ushort handle short type)
{
return Fanuc.cnc_dwnstart3(handle type);
}
//结束
private static short dwnend(ushort handle)
{
return Fanuc.cnc_dwnend3(handle);
}
//下载
private static short dwnload(ushort handle ref int datalength string data)
{
//开始下载程序 datalength将会被返回,实际的输出的字符数量
return Fanuc.cnc_download3(handle ref datalength data);
}
//获取详细的错误信息
private static short getdtailerr(ushort handle Fanuc.ODBERR odberr)
{
return Fanuc.cnc_getdtailerr(handle odberr);
}
//下载程序的入口点
///
/// 向CNC下载指定类型的程序
///
/// 句柄
/// 程序类型
/// 程序的内容
/// 保存返回错误信息的详细内容为null不返回
/// 错误码
public static short download(ushort handle short type string data Fanuc.ODBERR odberr)
{
int datalength = data.Length;
short ret = dwnstart(handle type);
if (ret == 0)
{
int olddata = datalength;
while (true)
{
ret = dwnload(handle ref datalength data);
//说明缓存已满或为空,继续尝试
if (ret == (short)Fanuc.focas_ret.EW_BUFFER)
{
continue;
}
if (ret == Fanuc.EW_OK)
{
//说明当前下载完成temp记录剩余下载量
int temp = olddata - datalength;
if (temp <= 0)
{
break;
}
else
{
data = data.Substring(datalength temp);
datalength = temp; olddata = temp;
}
}
else
{
//下载出现错误,解析出具体的错误信息
if (odberr != null)
{
getdtailerr(handle odberr);
}
//下载出错
break;
}
}
//判断是哪里出的问题
if (ret == 0)
{
ret = dwnend(handle);
//结束下载出错
return ret;
}
else
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 49152 2017-12-28 23:24 FANUC_TEST\FANUC_TEST\.vs\FANUC_TEST\v15\.suo
文件 0 2017-12-28 14:05 FANUC_TEST\FANUC_TEST\.vs\FANUC_TEST\v15\Server\sqlite3\db.lock
文件 1028096 2017-12-28 23:24 FANUC_TEST\FANUC_TEST\.vs\FANUC_TEST\v15\Server\sqlite3\storage.ide
文件 187 2017-12-28 14:05 FANUC_TEST\FANUC_TEST\FANUC_TEST\App.config
文件 172544 2018-01-02 07:35 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\FANUC_TEST.exe
文件 187 2017-12-28 14:05 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\FANUC_TEST.exe.config
文件 286208 2018-01-02 07:35 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\FANUC_TEST.pdb
文件 22984 2018-01-02 09:32 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\FANUC_TEST.vshost.exe
文件 187 2017-12-28 14:05 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\FANUC_TEST.vshost.exe.config
文件 490 2010-03-17 22:39 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\FANUC_TEST.vshost.exe.manifest
文件 1478721 2012-07-26 19:11 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\fwlib0DN.dll
文件 393216 2012-07-06 15:09 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\Fwlib0i.dll
文件 856064 2012-07-06 15:13 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\Fwlib0iB.dll
文件 1503293 2012-07-26 19:04 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\fwlib0iD.dll
文件 262144 2012-07-06 15:44 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\Fwlib150.dll
文件 339968 2012-07-06 15:48 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\Fwlib15i.dll
文件 856064 2012-07-06 15:53 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\Fwlib160.dll
文件 212992 2012-07-06 15:56 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\Fwlib16W.dll
文件 1777725 2012-07-26 19:19 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\fwlib30i.dll
文件 536576 2012-07-26 19:00 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\Fwlib32.dll
文件 839680 2012-07-26 20:02 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\fwlibe1.dll
文件 1753153 2012-07-26 19:57 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\fwlibNCG.dll
文件 118784 2012-07-06 15:58 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\Fwlibpm.dll
文件 512000 2012-07-06 16:00 FANUC_TEST\FANUC_TEST\FANUC_TEST\bin\Debug\Fwlibpmi.dll
文件 10029 2017-12-28 17:54 FANUC_TEST\FANUC_TEST\FANUC_TEST\Fanuc.cs
文件 4565 2017-12-28 16:36 FANUC_TEST\FANUC_TEST\FANUC_TEST\FANUC_TEST.csproj
文件 7951 2018-01-02 09:34 FANUC_TEST\FANUC_TEST\FANUC_TEST\frm_nccontrol.cs
文件 21293 2017-12-28 22:04 FANUC_TEST\FANUC_TEST\FANUC_TEST\frm_nccontrol.Designer.cs
文件 6016 2017-12-28 22:04 FANUC_TEST\FANUC_TEST\FANUC_TEST\frm_nccontrol.resx
文件 399 2017-12-28 15:58 FANUC_TEST\FANUC_TEST\FANUC_TEST\frm_ncpro.cs
............此处省略52个文件信息
- 上一篇:数值分析第五版答案(全).docx
- 下一篇:大数据组件介绍PPT
相关资源
- 双通道数据采集系统加界面美化.vi(
- 数据采集系统——ADC0808的应用,单片
- 基于AT89C51的数据采集系统设计新方法
- 发那科fanuc机器人robot(电气调试启动
- FANUC各硬件连接规格,型号,和连接方
- Fanuc机器人PNS程序和RSR程序启动改.d
- LabVIEW 数据采集 模拟量+编码器(Daq
- 多通道数据采集.vi(labview)
- 基于labVIEW的虚拟数据采集与输出仿真
- 一种用ARM7+UC/OS-II设计的信号采集系统
- 基于LabVIEW的并行数据采集系统设计
- TD-SCDMA网络测试仪中E1数据采集卡的驱
- BEIJING-FANUCOi-MA数控系统在X53T立式铣床
- 基于51单片机的多通道数据采集范围控
- 数据采集系统——ADC0808的应用
- CC2530的分布式无线数据采集系统设计
- 基于ZigBee的工业无线数据采集器设计
- 基于ZigBee的油井无线数据采集系统的
- 基于Zigbee的连采工作面机械设备数据
- 基于ADS5517的无线数据采集模块设计
- UG fanuc 18i后处理
- Profibus GSD文件.rar
- 淘你妹淘宝店铺数据采集大师 v1.0
- 12位、1 MSPS、单电源、低功耗数据采集
- 基于LINUX与GPRS网络的无线数据采集与
- 使用LabVIEW软件进行数据采集和信号处
- 电信运营计费管理系统中数据采集与
- FANUC机器人Socket Message通讯设置及使用
- 基于C8051F320 USB接口的数据采集存储电
- 安卓版GIS数据采集系统软件及使用说
评论
共有 条评论