参数示例

本部分提供一些参数示例,以及它们在宏和设置清单之间的使用差别。

任务

在宏中使用

在设置清单中使用

备注

获取 NC 程序在其输出工作平面方面的限界。

ENTITY ncp = entity('ncprogram', '')

REAL LIST nc_limits = ${limits_workplane_rel (ncp, ncp. OutputWorkplane)}

PRINT $nc_limits[0]

PRINT $nc_limits[1]

...

PRINT $nc_limits[5]

${limits_workplane_rel(entity('ncprogram', ncprogram.Name), ncprogram.OutputWorkplane)[0]}

...

${limits_workplane_rel(entity('ncprogram', ncprogram.Name), ncprogram.OutputWorkplane)[5]}

X Min 在设置清单中显示在一个语句中,但在宏中出现在多个语句中。它们的含义都相同。

在设置清单中,使用 entity()ncprogram.OutputWorkplanencprogram 无法单独使用:只能作为子参数使用。

打印当前 NC 程序的夹具偏移。

REAL nctoolpath_index = // get the toolpath number by looping the NC Toolpaths

REAL LIST fixture_offset = ${nctoolpath_fixtureoffset(entity('ncprogram', '').nctoolpath[nctoolpath_index])}

PRINT $fixture_offset[0]

PRINT $fixture_offset[1]

PRINT $fixture_offset[2]

${nctoolpath_fixtureoffset(nctoolpath)[0]}

${nctoolpath_fixtureoffset(nctoolpath)[1]}

${nctoolpath_fixtureoffset(nctoolpath)[2]}

通过 ${nctoolpath.*} 访问 nctoolpath 参数。

显示 NC 程序中的刀具列表。

STRING LIST nctool_list = ${list_nctools(entity('ncprogram', ''))}

PRINT ${nctool_list[0]}

PRINT ${nctool_list[size(nctool_list)-1]}

${list_nctools(entity('ncprogram', ncprogram.Name))[0]}

${join(list_nctools(entity('ncprogram', ncprogram.name)), ',')}

无法为刀具列表等阵列建立循环,因此它将转换为字符串,以便作为以逗号分隔的列表显示在设置清单中。