Please help with Function Generator .
For the groundwork took code from "Expert Documentation System Variables For KUKA System Software 8.1, 8.2 and 8.3" page 100. The same code is posted on the forum https://www.robot-forum.com/ro…orks/msg127112/#msg127112.
When you write it in WorkVisual marked the 2nd error in 34 line.
[list type=decimal]
- Unexpected character string 'BrackedSquareLeft' was found.
- Unexpected character '=' found
[/list]
What's wrong?
.SRC
Code
1 &ACCESS RVP
2 &REL 40
3 &PARAM EDITMASK = *
4 &PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe
5 DEF test( )
6
7 ; using sensor at analog input 1
8 SIGNAL Z_CORRECTION $ANIN[1]
9
10
11
12
13 ; Monitor sensor correction value
14 INTERRUPT DECL 11 WHEN $TECHVAL[1] > 20.0 DO UPPER_LIMIT()
15 INTERRUPT DECL 12 WHEN $TECHVAL[1] < -20.0 DO LOWER_LIMIT()
16
17
18
19 ;FOLD INI;%{PE}
20 ;FOLD BASISTECH INI
21 GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
22 INTERRUPT ON 3
23 BAS (#INITMOV,0 )
24 ;ENDFOLD (BASISTECH INI)
25 ;FOLD USER INI
26 ;Make your modifications here
27
28 ;ENDFOLD (USER INI)
29 ;ENDFOLD (INI)
30
31
32 ; Activate cyclical reading of the analog input and
33 ; scaling of $TECHIN[1]
34 ANIN ON $TECHIN[1] = SCALE * Z_CORRECTION + OFFSET
35
36 ; Define correction direction
37 $TECHSYS = #TTS
38 $TECH[1].FCTCTRL.GEOREF = #Z ; Correction is in Z direction (you may want to change it to #Y)
39 ; Sensor correction using the function generator
40 $TECH[1].CLASS = #SENSOR
41 $TECH[1].FCTCTRL.SCALE_IN = 2.0 ; Definition of control parameters
42 $TECH[1].FCTCTRL.OFFSET_IN = 0.0 ; ”
43 $TECH[1].FCTCTRL.SCALE_OUT = 20.0; ”
44 $TECH[1].FCTCTRL.OFFSET_OUT = 0.0; ”
45 $TECH[1].FCT.ORDER = 1 ; ”
46 $TECH[1].FCT.CPNUM = 3 ; ”
47 $TECH[1].FCT.CPS1.X1 = 0.0 ; ”
48 $TECH[1].FCT.CPS1.Y1 = -1.0 ; ”
49 $TECH[1].FCT.CPS1.X2 = 0.5 ; ”
50 $TECH[1].FCT.CPS1.Y2 = 0.0 ; ”
51 $TECH[1].FCT.CPS1.X3 = 1.0 ; ”
52 $TECH[1].FCT.CPS1.Y3 = 1.0 ; ”
52 $TECHPAR[1,1] = 0.056 ; Smoothing constant in s
53
54
55 PTP P1 ; initial position before correction
56 INTERRUPT ON 11
57 INTERRUPT ON 12
58
59 ; Activate sensor correction
60 $TECH[1].MODE = #CYCLE
61 LIN P2 C_DIS
62 LIN P3 C_DIS
63 LIN P4
64
65 ; Deactivate sensor correction
66 $TECH[1].MODE = #OFF
67 INTERRUPT OFF 11
68 INTERRUPT OFF 12
69
70 LIN_REL {X 0.0} ; Zero block for accepting advance run data
71
72 ; in the main run data --> Deactivation of
73 ; the function generator
74 ; Deactivate cyclical analog input
75 ANIN OFF Z_CORRECTION
76 END
77
78 DEF UPPER_LIMIT()
79 ; upper limit...
80 END
81
82 DEF LOWER_LIMIT()
83 ; lower limit...
84 END
85
Display More
.DAT
Code
&ACCESS RVP
&REL 40
&PARAM EDITMASK = *
&PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe
DEFDAT test
;FOLD EXTERNAL DECLARATIONS;%{PE}%MKUKATPBASIS,%CEXT,%VCOMMON,%P
;FOLD BASISTECH EXT;%{PE}%MKUKATPBASIS,%CEXT,%VEXT,%P
EXT BAS (BAS_COMMAND :IN,REAL :IN )
;ENDFOLD (BASISTECH EXT)
;FOLD USER EXT;%{E}%MKUKATPUSER,%CEXT,%VEXT,%P
;Make your modifications here
;ENDFOLD (USER EXT)
;ENDFOLD (EXTERNAL DECLARATIONS)
DECL REAL SCALE = 0.1
DECL REAL OFFSET = 0.5
DECL E6POS P1={X 0}
DECL E6POS P2={X 0}
DECL E6POS P3={X 0}
DECL E6POS P4={X 0}
ENDDAT
Display More
In 60 and 61 lines, too, were mistakes, there were omitted $.