パラメーターの例

このセクションでは、パラメーターの例を示し、それをマクロで使用した場合とセットアップ シートで使用した場合の相違について説明します。

[タスク]

マクロ内の使用

セットアップシート内の使用

Comments

出力作業平面に関する 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 は、セットアップ シートでは 1 つのステートメントに表示されますが、マクロでは複数のステートメントに表示されます。どちらも同じ意味です。

セットアップ シートでは、entity()および ncprogram.OutputWorkplane が使用されます。ncprogram は、単独では使用できません。使用する場合は、サブパラメーターが必要になります。

現在の 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)), ',')}

工具リストなどの配列でループする方法はないため、配列はセットアップ シートにカンマ区切りのリストとして表示できるようにストリングに変換されます。