'!TITLE "ProCognexSample.pcs"

Sub Main 
	Dim caoCtrl As Object
	Dim bstrResult As String
	
	' Connect Cognex In-Sight
	caoCtrl = Cao.AddController( "InSight", "caoProv.Cognex.In-Sight", "", "conn=eth:127.0.0.1, timeout=1000" )
	
	' Sets the In-Sight sensor Offline.
	caoCtrl.SetOnline 0
	
	' Loads the specified job from flash memory on the In-Sight sensor, making it the active job.
	caoCtrl.LoadFile "Sample.job"
	Delay 500
	
	' Sets the In-Sight sensor Online. 
	caoCtrl.SetOnline 1
	
	' Acquire an image and update the spreadsheet. Get Result.
	bstrResult = caoCtrl.SendMessageAndWait
	
	' Put result in V11
	PrintDbg bstrResult
	V11 = "V(" & bstrResult & ")"
	
End Sub


