VRun陳述式

套用至
視覺序列

說明
VRun為SPEL+語言陳述式,可用於執行Vision Guide開發環境或執行階段中使用VCreateSequence建立的視覺序列。

用途

VRun  Sequence
Sequence
序列名稱或表示序列名稱的字串變數

詳細說明
VRun SPEL+語言陳述式可執行視覺序列。

VRun開始時,指定的視覺序列會開始執行。首先,影像會擷取至(除非使用者已將RuntimeAcquire屬性設為None)影像緩衝區中,視覺物件接著會依視覺序列中的定義套用至該影像。

請注意,AsyncMode為“True”時,VRun會在執行VRun指定的視覺序列完畢前傳回。擷取影像後,VRun會將控制傳回VRun後的下一個SPEL+陳述式。這可透過在視覺處理期間,允許其他SPEL+陳述式執行的方式,改善整體循環時間的傳輸量。(例如,機器人可在視覺處理期間移動,或可在此時執行計算。)AsyncMode為“False”時,VRun會在傳回前擷取影像(如有需要)並執行所有物件。

執行VRun後,通常會使用VGet取得視覺序列結果,如部件位置資料、部件優劣狀態、部件數資訊或其他結果。

以下為使用VRun及VGet執行視覺序列,接著使用該序列結果為使用者顯示實用資訊的簡易程式。

執行程式前,請建立「FindHoles」序列及「Part」Blob物件。

Function test
'It is assumed that a sequence called FindHoles has already been created
'prior to running this program. FindHoles contains a Blob object called Part 'which is configured to find how many holes are in the search window.
'In this example, we will run the sequence and then display the number
'of holes which were found.

	Integer count

	VRun FindHoles                    'Run the vision sequence
	VGet FindHoles.Part.Holes, count  'Get the # of holes found

	Print "HoleCnt found", count, "holes!"	'Display a msg with # of holes found
Fend

參考
VGet、VSet、視覺序列