Issued: 11.10.2013 Version: KST VisionTech 2.1 V1
12 Example programs
12
Example programs
12.1
Example program
Program
1 DEF Example( )
2
3 DECL CHAR AppData[100,100]
4 DECL BOOL InGrippingZone, CheckPose_ok, Result_valid
5 DECL INT Part
6 DECL FRAME CorrFrame,GrippingPoint
7
8 INI
9
10 INTERRUPT DECL 98 WHEN $FLAG[998]==TRUE DO DO_GETVTRESULTS
("VisionTechConfig",RESULTS[],PARTCOUNTER,1,998)
11 INTERRUPT ON 98
12
13 PTP StartPos Vel=100 % PDAT1 Tool[0] Base[0]
14
15 BASE_DATA[11]=$NULLFRAME
16 $FLAG[1]=FALSE
17 InGrippingZone=False
18 Result_valid=False
19 PARTCOUNTER=0
20
21 VT_INIT("VisionTechConfig")
22 VT_OPENCONNECTION("VisionTechConfig")
23 VT_TASKTRIGGER_REFBASE("VisionTechConfig","Demo",BASE_DATA[16])
24 VT_WAIT(1)
25
26 Get_vtuserdata("VisionTechConfig",appdata[,])
27
28 FOR Part = 1 TO PARTCOUNTER STEP 1
29
30 Result_valid=VT_RESULTCHECK2(RESULTS[PART])
31
32 CorrFrame=Get_VTCORRECTIONFRAME(RESULTS[PART])
33 Base_Data[11]=BASE_DATA[16]:Corrframe
34 CheckPose_ok=VT_CHECKPOSE(12,700,950,950,11,xGrippingPos,1)
35
36 ;halt
37
38 IF(CheckPose_ok==True) then
39
40 IF(Part==1) then
41 VT_DIRECT(XStartPos,XProGrippingPos,$nullframe,base_data[11],
$nullframe,tool_data[1])
42 ELSE
43 VT_DIRECT(XPostGrippingPos,XProGrippingPos,base_data[11],
base_data[11],tool_data[1],tool_data[1])
44 ENDIF
45 PTP ProGrippingPos Vel=100 % PDAT2 Tool[1] Base[11]
46
47 VT_DIRECT(XProGrippingPos,XGrippingPos,base_data[11],
base_data[11],tool_data[1],tool_data[1])
48 PTP GrippingPos Vel=100 % PDAT3 Tool[1] Base[11]
49
50 VT_DIRECT(XGrippingPos,XPostGrippingPos,base_data[11],
base_data[11],tool_data[1],tool_data[1])
51 PTP PostGrippingPos Vel=100 % PDAT4 Tool[1] Base[11]
52 ENDIF
53 ENDFOR
54
55 VT_Closeconnection("VisionTechConfig")
56 VT_Clear("VisionTechConfig")
57
58 END
Summary of Contents for VisionTech 2.1
Page 6: ...6 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 10: ...10 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 18: ...18 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 26: ...26 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 28: ...28 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 32: ...32 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 36: ...36 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 50: ...50 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 78: ...78 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 82: ...82 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 90: ...90 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 92: ...92 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 94: ...94 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 96: ...96 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 98: ...98 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 106: ...106 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...
Page 109: ...109 109 Issued 11 10 2013 Version KST VisionTech 2 1 V1 KUKA VisionTech 2 1 ...