0% found this document useful (0 votes)
32 views4 pages

CNC - Rdmacroinfo: / Read Custom Macro Variable Information

This document summarizes a CNC macro variable reading function. It declares the function prototype, describes that it reads macro variable information, lists the parameters as the library handle and output structure, and provides examples of available common variable ranges for different CNC models.

Uploaded by

Kession Hou
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views4 pages

CNC - Rdmacroinfo: / Read Custom Macro Variable Information

This document summarizes a CNC macro variable reading function. It declares the function prototype, describes that it reads macro variable information, lists the parameters as the library handle and output structure, and provides examples of available common variable ranges for different CNC models.

Uploaded by

Kession Hou
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

cnc_rdmacroinfo

声明
/* read custom macro variable information */
[DllImport("FWLIB32.dll", EntryPoint = "cnc_rdmacroinfo")]
public static extern short cnc_rdmacroinfo(ushort FlibHndl, [Out,
MarshalAs(UnmanagedType.LPStruct)] ODBMVINF a);

描述
读宏变量信息。

参数
(1)FlibHndl 库句柄;[ in ]
(2)mvinf [ out ]
/* cnc_rdmacroinfo:read custom macro variable information */
[StructLayout(LayoutKind.Sequential, Pack = 4)]
public class ODBMVINF
{
public short use_no1;
public short use_no2;
}
use_no1

use_no1 Available number of local macro variable (33 sets)

use_no2

Indicator of available common variable

 Series 15

M/T 0 : 100,..,149, 500,..,549

1 : 100,..,199, 500,..,599

2 : 100,..,199, 500,..,699

3 : 100,..,199, 500,..,999

TT 0 : 100,..,149, 500,..,524

1 : 100,..,149, 500,..,549

2 : 100,..,149, 500,..,599

3 : 100,..,149, 500,..,749

 Series 15i
3 : 100,..,199, 500,..,999

4 : 100,..,199, 200,..,999

 Series 16/18/21, 16i/18i/21i, 0i-A/B/C

0 : 100,..,149, 500,..,531

1 : 100,..,199, 500,..,999

2 : 100,..,199, 500,..,599

 Series 16i/18i-W

0 : 100,..,149, 500,..,531

1 : 100,..,314, 500,..,699

2 : 100,..,149, 500,..,699

3 : 100,..,314, 500,..,531

4 : 100,..,149, 500,..,999

5 : 100,..,314, 500,..,999

 Power Mate i

0 : 100,..,149, 500,..,531

1 : 100,..,199, 500,..,999

2 : 100,..,199, 500,..,699

 Series 30i/31i/32i, 0i-D, PMi-A

0 : 100,..,149, 500,..,549

1 : 100,..,199, 500,..,999

2 : 100,..,149, 200,..,499, 500,..,549

3 : 100,..,499, 500,..,999

4 : 100,..,199, 500,..,999, 98000,..,98499

5 : 100,..,499, 500,..,999, 98000,..,98499

函数返回值
函数运行正常返回 EW_OK。
Return code Meaning/Error handling

EW_NOOPT No option
(6) This function needs the custom macro option.
代码
class Program
{
static void Main(string[] args)
{
ushort Flibhndl = 0;

short ret; // 返回值

// 获取库句柄 ( Ethernet )
ret = Focas1.cnc_allclibhndl3("192.168.0.224", 8193, 10, out
Flibhndl);
if (ret != Focas1.EW_OK)
{
Console.WriteLine("发生异常,请检查!");
return;
}

#region cnc_rdmacroinfo

Focas1.ODBMVINF mvinf = new Focas1.ODBMVINF();


ret = Focas1.cnc_rdmacroinfo(Flibhndl, mvinf);
Console.WriteLine("Available number of local macro variable:" +
mvinf.use_no1);
switch(mvinf.use_no2)
{
case 0:
Console.WriteLine("available common variable:"+"100,..,149,
500,..,549");
break;
case 1:
Console.WriteLine("available common variable:" +
"100,..,199, 500,..,999");
break;
case 2:
Console.WriteLine("available common variable:" +
"100,..,149, 200,..,499, 500,..,549");
break;
case 3:
Console.WriteLine("available common variable:" +
"100,..,499, 500,..,999");
break;
case 4:
Console.WriteLine("available common variable:" +
"100,..,199, 500,..,999, 98000,..,98499");
break;
case 5:
Console.WriteLine("available common variable:" +
"100,..,499, 500,..,999, 98000,..,98499");
break;
}
#endregion
}
}

You might also like