SHDEFMODEL (Statement)


Register the search model.


SHDEFMODEL <model number>, <coordinate X>, <coordinate Y>, <width>, <height>, <offset X>, <offset Y>[, <offset angle>]


<model number>
Designates the model number to register (0 to 99).
<coordinate X>
Designates the home position X coordinate (16 to 485).
<coordinate Y>
Designates the home position Y coordinate (16 to 463).
<width>
Designates the width of the registered model (10 to 256).
<height>
Designates the height of the registered model (10 to 255).
<offset X>
Designates Offset X measured from the origin (-511 to +511)
<offset Y>
Designates Offset Y measured from the origin (-511 to +511)
<offset angle>
Designates Offset angle measured from the angular origin (-360 to 360)
[V1.4 or later]
  • If the model to be registered is not more than 16 pixels inside from the edge of the screen, it cannot be registered.
  • The reference coordinates are used to designate a point to detect when a model is searched.
  • A registered model requires a certain amount of brightness distribution. If the brightness distribution is too flat or there are many small differences in the model, it cannot be registered.
  • If you designate a number already registered, it overwrites the already registered model.
  • You can find the availability of registration by using VISSTATUS after the instruction is executed.
  • When this command is executed, the process screen 3 (VISWORKPLN 3) is used as a work area and data on the process screen 3 are not guaranteed. Also, you cannot use the process screen 3 for processing.
    VISSTATUS (n)
    n
    Item
    0
    Execution result
    0 = Normal
    -1 = Designated area error
    -2 = Space full
    -3 = Uniform model
    -4 = Complicated
    1,2 = Search time long
    3,4 = Angle unidentifiable [V1.4 or later]
    1
    Not Used 0
    2
    Execution time

  • For this instruction, a µVision board (option) is required.
  • During execution of this instruction, do not power off the controller. If you do so, the controller will recognize in the next powering-on sequence that it has not been normally terminated, so it will initialize the vision-related information.



VISSCREEN 1,0,1
'Instantaneously draw on draw screen No. 0
VISCLS 0
VISRECT 100,100,100,100
CAMIN 1
'Obtain a camera image from the storage memory
SHDEFMODEL 1,100,100,100,100,50,50
'Register the model
I1 = VISSTATUS(0)
VISLOC 10,10
IF I1 = 0 THEN VISPRINT "Registration completed" ELSE VISPRINT "Cannot register."
VISCAMOUT 1


Top