'!TITLE "ProFZSample.pcs"

Sub Main
	On Error GoTo ErrorProc
	
	Dim ctrl As Object
	Dim vntResult As Variant
	Dim Idx As Long
	
	ctrl = Cao.AddController( "FZ", "CaoProv.OMRON.FZ", "", "conn=eth:10.6.226.201" )
	
	' Change Scene No 1
	ctrl.Scene 1
	
	' Inspection and Get Result
	vntResult = ctrl.Measure
	
	' Display result
	If ( VarType( vntResult ) And 8192 ) Then
		For Idx = 0 To UBound( vntResult )
			PrintDbg "Result(" & Idx & "):" & vntResult( Idx )
		Next
	Else
		PrintDbg "Result:" & vntResult
	End If
	
EndProc:
	Cao.Controllers.Clear
	ctrl = Nothing
	Exit Sub
	
ErrorProc:
	PrintDbg Hex( Err.OriginalNumber )
	GoTo EndProc
End Sub


