Using Variables for Sequence and Object Names
String variables can be used for the calibration, sequence, and object name arguments in the VRun, VGet and VSet commands.
The example below uses the string variables seq$ and obj$ to specify which vision sequence and which vision object to work with.
Function visTest
#define PICKZ -100.0
String seq$, obj$
Boolean found
Real x, y, u
seq$ = "test"
obj$ = "Blob01"
VSet seq$.Camera, 1
VSet seq$.Calibration, "CAMCAL1"
VRun seq$
VGet seq$.obj$.RobotXYU, found, x, y, u
If found Then
pick = XY(x, y, PICKZ, u)
Jump pick
On vacuum
Wait .1
Jump place
Off vacuum
Wait .1
EndIf
Jump park
Fend
Arrays can also be used for sequence and object name arguments in the VRun, VGet, and VSet commands. See the example below.
Function test
String obj$(10)
Integer count
obj$(0) = "corr01"
obj$(1) = “corr02”
obj$(2) = “blob01”
obj$(3) = “blob02”
For count = 0 to 3
VRun seqname
VGet seqname.obj$(count).Found, found
Next count
Fend