VRun Statement

Applies To
Vision Sequence

Description
VRun is a SPEL+ language statement used to initiate execution of vision sequences which were created in the Vision Guide development environment or at runtime using VCreateSequence.

Usage

VRun  Sequence
Sequence
Name of a sequence or string variable containing a sequence name.

Remarks
The VRun SPEL+ Language statement initiates execution of vision sequences.

When VRun is initiated the vision sequence specified begins execution. First, an image is acquired (unless the user has set the RuntimeAcquire property to None) into the image buffer, and then vision objects are applied to that image as defined in the vision sequence.

It is important to note that when AsyncMode is "True", VRun returns prior to completing execution of the vision sequence specified with VRun. Once the image is acquired, VRun returns control to the next SPEL+ statement which follows VRun. This improves the throughput of the overall cycle time by allowing other SPEL+ statements to execute while vision processing occurs. (For example, the robot can move during vision processing, or a calculation could be performed during this time.) When AsyncMode is "False", VRun acquires the image (if necessary) and runs all objects before returning.

Once VRun is executed, VGet is normally used to get the results of the vision sequence such as part position data, good part bad part status, part count information or many other results.

Shown below is a simple program which uses VRun and VGet to execute a vision sequence and then use results from that sequence to display useful information to the user.

Before running the program, create a sequence called "FindHoles” and a blob object called “Part”.

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

See Also
VGet, VSet, Vision Sequences