Epson Net 5 사용자 설명서

다운로드
페이지 216
 
VSet Statement 
 
Remarks 
VSet is used to set property values for vision sequences, calibrations, and objects from the SPEL
+
 language. 
For many vision sequences all the proper property settings will be set from within the Vision Guide 
development environment.  However, there are also times when you will want to set property values in a 
SPEL
+
 program prior to running a vision sequence.  For example, you may want to set the NumberToFind 
property before running a sequence, or maybe you want to use the same vision sequence with 2 different 
cameras.  Both of these scenarios can be handled in SPEL
+
 using VSet.  
Shown below is a Vision Guide program which runs the same vision sequence for 2 different cameras to 
calculate the number of holes found in a board. 
It is assumed that a Sequence called "FindHoles" has already been created prior to running this program.  
FindHoles contains a "Part" Blob object which is configured to find the number of holes in the Search 
Window using Holes Result.  In this example, we will run the sequence and then display the number of 
holes which were found.  
)
NOTE
 
When VSet is called from a program, changes are only made in memory and are not saved.  After program 
execution stops, the vision system is restored to the saved state.   
Function test 
 
  Integer count 
  #define CAMERA1 1 
  #define CAMERA2 2 
 
  VSet FindHoles.Camera, CAMERA1        ' Find holes for part at camera 1 
  VRun FindHoles                        ' Run the Vision Sequence 
  VGet FindHoles.Part.Holes, count      ' Get the # of holes which were found 
  Print "Camera1 holes found =", count 
 
  VSet FindHoles.Camera, CAMERA2        ' Repeat for camera 2 
  VRun FindHoles 
  VGet FindHoles.Part.Holes, count      ' Get the # of holes which were found 
  Print "Camera2 holes found =", count  
 
Fend 
 
See Also 
VGet, VRun, VSet, Vision Sequences 
Vision Guide 5.0 Reference (Ver.5.3) Rev.1 
185