tune
This commit is contained in:
+30
-25
@@ -2,9 +2,9 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>步階變數 | HiAPI-C# 2025 </title>
|
||||
<title>加工步變數 | HiAPI-C# 2025 </title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="title" content="步階變數 | HiAPI-C# 2025 ">
|
||||
<meta name="title" content="加工步變數 | HiAPI-C# 2025 ">
|
||||
|
||||
|
||||
<link rel="icon" href="../../../../../img/HiAPI.favicon.ico">
|
||||
@@ -85,22 +85,22 @@
|
||||
</div>
|
||||
|
||||
<article data-uid="Cmd-StepVariables">
|
||||
<h1 id="步階變數">步階變數</h1>
|
||||
<h1 id="加工步變數">加工步變數</h1>
|
||||
|
||||
<p><a class="xref" href="../../../../../api/Hi.MachiningProcs.RuntimeApi.html">RuntimeApi</a><small>(API)</small> 提供了多個方法來處理和存取加工步階的變數。</p>
|
||||
<h2 id="預設步階輸出資訊">預設步階輸出資訊</h2>
|
||||
<p>每個加工步階都包含豐富的預設輸出資訊,涵蓋來源行、運動學、載荷、力/力矩、功率、熱與磨耗等。</p>
|
||||
<p>完整的預設步階輸出資訊說明,請參考 <a class="xref" href="../../output/simulation-step-output.html">仿真步輸出資訊(Simulation Step Output)</a>。</p>
|
||||
<p><a class="xref" href="../../../../../api/Hi.MachiningProcs.RuntimeApi.html">RuntimeApi</a><small>(API)</small> 提供了多個方法來處理和存取加工步的變數。</p>
|
||||
<h2 id="預設步輸出資訊">預設步輸出資訊</h2>
|
||||
<p>每個加工步都包含豐富的預設輸出資訊,涵蓋來源行、運動學、載荷、力/力矩、功率、熱與磨耗等。</p>
|
||||
<p>完整的預設步輸出資訊說明,請參考 <a class="xref" href="../../output/simulation-step-output.html">仿真步輸出資訊(Simulation Step Output)</a>。</p>
|
||||
<div class="TIP">
|
||||
<h5>Tip</h5>
|
||||
<p><strong>存取預設步階資訊範例</strong></p>
|
||||
<p><strong>存取預設步資訊範例</strong></p>
|
||||
<pre><code class="lang-csharp">PlayNcFile("NC/file1.nc");
|
||||
|
||||
// 取得步階並存取預設資訊
|
||||
var step = GetMillingStep(100); // 見下方「存取步階資訊」
|
||||
// 取得步並存取預設資訊
|
||||
var step = GetMillingStep(100); // 見下方「存取步資訊」
|
||||
if (step != null)
|
||||
{
|
||||
// 存取預設的步階資訊
|
||||
// 存取預設的步資訊
|
||||
Message($"ToolId: {step.ToolId}");
|
||||
Message($"Feedrate: {step.Feedrate_mmdmin} mm/min");
|
||||
Message($"ChipVolume: {step.ChipVolume_mm3} mm³");
|
||||
@@ -108,10 +108,15 @@ if (step != null)
|
||||
}
|
||||
</code></pre>
|
||||
</div>
|
||||
<h2 id="註冊步階變數">註冊步階變數</h2>
|
||||
<p>除了預設的步階輸出資訊外,您可以使用 <a class="xref" href="../../../../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_RegisterStepVariable_">RegisterStepVariable</a><small>(API)</small> 註冊自訂的步階變數,用於追蹤特定的計算結果或資料。</p>
|
||||
<h2 id="註冊步變數">註冊步變數</h2>
|
||||
<p>除了預設的步輸出資訊外,您可以使用 <a class="xref" href="../../../../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_RegisterStepVariable_">RegisterStepVariable</a><small>(API)</small> 註冊自訂的步變數,用於追蹤特定的計算結果或資料。</p>
|
||||
<p>註冊的步變數主要用於人類檢視,可透過工件幾何體上的顏色顯示數值分布。搭配 <a class="xref" href="../../../../../api/Hi.MachiningSteps.MachiningStep.html#Hi_MachiningSteps_MachiningStep_Item_System_String_">this[string]</a><small>(API)</small> 索引器可實現完整的資料檢查功能:</p>
|
||||
<ul>
|
||||
<li><code>RegisterStepVariable</code>:註冊變數供介面顯示及輸出</li>
|
||||
<li><code>MachiningStep[key]</code>:在腳本中讀寫步的自訂資料</li>
|
||||
</ul>
|
||||
<h3 id="registerstepvariable">RegisterStepVariable</h3>
|
||||
<p><a class="xref" href="../../../../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_RegisterStepVariable_">RegisterStepVariable</a><small>(API)</small> 註冊一個步階變數,用於在執行過程中追蹤特定資料。</p>
|
||||
<p><a class="xref" href="../../../../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_RegisterStepVariable_">RegisterStepVariable</a><small>(API)</small> 註冊一個步變數,用於在執行過程中追蹤特定資料。</p>
|
||||
<div class="NOTE">
|
||||
<h5>Note</h5>
|
||||
<p><strong>指令格式</strong></p>
|
||||
@@ -121,7 +126,7 @@ if (step != null)
|
||||
<div class="TIP">
|
||||
<h5>Tip</h5>
|
||||
<p><strong>指令範例</strong></p>
|
||||
<pre><code class="lang-csharp">// 註冊一個計算切削體積的步階變數
|
||||
<pre><code class="lang-csharp">// 註冊一個計算切削體積的步變數
|
||||
RegisterStepVariable(
|
||||
"ChipVolume",
|
||||
"Chip Volume",
|
||||
@@ -139,19 +144,19 @@ PlayNcFile("NC/file1.nc");
|
||||
<li><code><名稱></code>: 變數的顯示名稱</li>
|
||||
<li><code><單位></code>: 變數的物理單位(可為 null)</li>
|
||||
<li><code><格式字串></code>: 數值格式化字串(可為 null)</li>
|
||||
<li><code><變數函數></code>: 從步階計算變數值的函數(可為 null)</li>
|
||||
<li><code><變數函數></code>: 從步計算變數值的函數(可為 null)</li>
|
||||
</ul>
|
||||
<div class="NOTE">
|
||||
<h5>Note</h5>
|
||||
<p>註冊的步階變數可以在輸出檔案(如 <a class="xref" href="../WriteStepFiles/index.html">輸出步資料檔案</a>)中使用,並在介面中顯示。</p>
|
||||
<p>註冊的步變數可以在輸出檔案(如 <a class="xref" href="../WriteStepFiles/index.html">輸出步資料檔案</a>)中使用,並在介面中顯示。</p>
|
||||
</div>
|
||||
<h2 id="存取步階資訊">存取步階資訊</h2>
|
||||
<h2 id="存取步資訊">存取步資訊</h2>
|
||||
<h3 id="getmillingstep">GetMillingStep</h3>
|
||||
<p><a class="xref" href="../../../../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_GetMillingStep_">GetMillingStep</a><small>(API)</small> 取得指定索引的加工步階。</p>
|
||||
<p><a class="xref" href="../../../../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_GetMillingStep_">GetMillingStep</a><small>(API)</small> 取得指定索引的加工步。</p>
|
||||
<div class="NOTE">
|
||||
<h5>Note</h5>
|
||||
<p><strong>指令格式</strong></p>
|
||||
<pre><code class="lang-csharp">var step = GetMillingStep(<步階索引>);
|
||||
<pre><code class="lang-csharp">var step = GetMillingStep(<步索引>);
|
||||
</code></pre>
|
||||
</div>
|
||||
<div class="TIP">
|
||||
@@ -159,7 +164,7 @@ PlayNcFile("NC/file1.nc");
|
||||
<p><strong>指令範例</strong></p>
|
||||
<pre><code class="lang-csharp">PlayNcFile("NC/file1.nc");
|
||||
|
||||
// 取得第100個步階
|
||||
// 取得第100個步
|
||||
var step = GetMillingStep(100);
|
||||
if (step != null)
|
||||
{
|
||||
@@ -168,7 +173,7 @@ if (step != null)
|
||||
</code></pre>
|
||||
</div>
|
||||
<h3 id="stepcount">StepCount</h3>
|
||||
<p><a class="xref" href="../../../../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_StepCount">StepCount</a><small>(API)</small> 取得總步階數量。</p>
|
||||
<p><a class="xref" href="../../../../../api/Hi.MachiningProcs.RuntimeApi.html#Hi_MachiningProcs_RuntimeApi_StepCount">StepCount</a><small>(API)</small> 取得總步數量。</p>
|
||||
<div class="NOTE">
|
||||
<h5>Note</h5>
|
||||
<p><strong>指令格式</strong></p>
|
||||
@@ -180,15 +185,15 @@ if (step != null)
|
||||
<p><strong>指令範例</strong></p>
|
||||
<pre><code class="lang-csharp">PlayNcFile("NC/file1.nc");
|
||||
|
||||
// 取得總步階數
|
||||
// 取得總步數
|
||||
var totalSteps = StepCount;
|
||||
Message($"Total steps: {totalSteps}");
|
||||
|
||||
// 遍歷所有步階
|
||||
// 遍歷所有步
|
||||
for (int i = 0; i < StepCount; i++)
|
||||
{
|
||||
var step = GetMillingStep(i);
|
||||
// 處理步階...
|
||||
// 處理步...
|
||||
}
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user