.Program SORT
C ---------------------------------------------------------
C ????? ??????? ??? ??-01 ??? ?????? ?????
C ---------------------------------------------------------
C ?????? ???????:
C 1 GO.HOME - ??? ? ?????? ?????????
C 2 SET.SPEED - ???????? ????? ???????? ???
C 3 TAKE - ????? ???? ? ????????
C 4 Exit - ??? ?? ?????
C
C ??????????
CALL INIT
C
GO READY
GO #READY0
GO #SPACE
GO #HOME
OPEN
C
PRINT 'Robot is ready'
C ==> ???
SET MARKER. = NULL.
CALL TRANSC.
C ????
RETURN
C ------
10 PRINT '$'
C <==> ??? - ???????? ???????
CALL SWITCH.
JUMP 101
JUMP 10
C 1 ??????
CALL GO.HOME
JUMP 101
JUMP 10
C 2 ??????
CALL SET.SPEED
JUMP 101
JUMP 10
C 3 ??????
CALL TAKE
JUMP 101
JUMP 10
C 4 ?????? - ??? ?? ?????
GO #SPACE
GO #READY0
GO READY
RETURN
C ------
C
101 CALL ERROR.
JUMP 10
.End
C
C==============================================================
C ????? ???????
C==============================================================
C
.Program GO.HOME
C --------------------------
C 1 ??? ? ?????? ?????????
C --------------------------
C ?????? ???
C
PRINT 'Go home position'
ENABLE INCALLS
OPEN
GO #SPACE
GO #HOME
DISABLE INCALLS
C ==> ???
SET MARKER. = NULL.
CALL TRANSC.
JUMP 101
C
RETURN 1
C ????
101 RETURN
.End
C
.Program SET.SPEED
C ---------------------------------------
C 2 ???????? ????? ???????? ??? (%)
C ---------------------------------------
C ??????:
C PAR1. - ?????? ????? ??? (1%-300%)
C
PRINT 'Set speed % ',PAR1.
IF PAR1. < 1 THEN JUMP 102
IF PAR1. > 300 THEN JUMP 102
SET SPEED = PAR1.
SPEED% SPEED
C ==> ???
SET MARKER. = NULL.
CALL TRANSC.
JUMP 101
C
RETURN 1
C ???? ? ??????
102 SET ERRORW. = ER1
C ==> ???
SET MARKER. = ERRORW.
CALL TRANSC.
JUMP 101
C ????
101 RETURN
.End
C
.Program TAKE
C -----------------------------------
C 3 ????? ???? ? ???????? ?? ?????
C -----------------------------------
C ???????:
C PAR1. - ? ???? (1-4)
C PAR2. - ????? ???? (1-4)
C PAR3. - ????? ???? (1,2)
C
PRINT 'Take object'
PRINT PAR1.
PRINT PAR2.
PRINT PAR3.
C ?????? ???????? ????
CALL POS.XY
JUMP 102
C ????? ????
ENABLE INCALLS
GO #WAIT
OPEN
C ???????? ?????????? ??? ????
WAIT IN I.WORK.N
C ?????? ????? ????
OUT O.WORK.Y
C
GO #WORK
GONEAR POS,30
SPEED% 100
SPEED NEXT 50
GOS POS
CLOSE
SPEED% SPEED
GOSNEAR POS,30
GO #WORK
GO #SPACE
C ???????? ????? ????
OUT O.WORK.N
C
GO #PUT
GONEAR #POS,100
SPEED% 100
SPEED NEXT 100
GOS #POS
DELAY 0.5
OPEN
SPEED% SPEED
GOSNEAR #POS,100
GO #PUT
GO #SPACE
GO #HOME
DISABLE INCALLS
C ==> ???
100 SET MARKER. = NULL.
CALL TRANSC.
JUMP 101
C
RETURN 1
C ==> ???
102 SET MARKER. = ERRORW.
CALL TRANSC.
JUMP 101
C ????
101 RETURN
.End
C
C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C ????????
C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C==============================================================
.Program POS.XY
C -------------------------------------
C ?????? ???????? ???? ? ????
C -------------------------------------
C ???????:
C PAR1. - ? ???? (1-4)
C PAR2. - ????? ???? (1-4)
C PAR3. - ????? ???? (1,2)
C
IF PAR1. < 1 THEN JUMP 102
IF PAR1. > MAX.TYPE THEN JUMP 102
C
IF PAR2. < 1 THEN JUMP 102
IF PAR2. > MAX.DET THEN JUMP 102
C
IF PAR3. < 1 THEN JUMP 102
IF PAR3. > 2 THEN JUMP 102
C ??? ???? (1-4)
IF PAR1. = 1 THEN JUMP 1
IF PAR1. = 2 THEN JUMP 2
IF PAR1. = 3 THEN JUMP 3
IF PAR1. = 4 THEN JUMP 4
JUMP 102
C ???? 1?? ??
C ????? ???? (1-4)
1 IF PAR2. = 1 THEN JUMP 11
IF PAR2. = 2 THEN JUMP 12
IF PAR2. = 3 THEN JUMP 13
IF PAR2. = 4 THEN JUMP 14
JUMP 102
C
11 LOCATE POS = CHECK(POS11)
JUMP 10
12 LOCATE POS = CHECK(POS12)
JUMP 10
13 LOCATE POS = CHECK(POS13)
JUMP 10
14 LOCATE POS = CHECK(POS14)
JUMP 10
C ???? 2?? ??
C ????? ???? (1-4)
2 IF PAR2. = 1 THEN JUMP 21
IF PAR2. = 2 THEN JUMP 22
IF PAR2. = 3 THEN JUMP 23
IF PAR2. = 4 THEN JUMP 24
JUMP 102
C
21 LOCATE POS = CHECK(POS21)
JUMP 10
22 LOCATE POS = CHECK(POS22)
JUMP 10
23 LOCATE POS = CHECK(POS23)
JUMP 10
24 LOCATE POS = CHECK(POS24)
JUMP 10
C ???? 3?? ??
C ????? ???? (1-4)
3 IF PAR2. = 1 THEN JUMP 31
IF PAR2. = 2 THEN JUMP 32
IF PAR2. = 3 THEN JUMP 33
IF PAR2. = 4 THEN JUMP 34
JUMP 102
C
31 LOCATE POS = CHECK(POS31)
JUMP 10
32 LOCATE POS = CHECK(POS32)
JUMP 10
33 LOCATE POS = CHECK(POS33)
JUMP 10
34 LOCATE POS = CHECK(POS34)
JUMP 10
C ???? 4?? ??
C ????? ???? (1-4)
4 IF PAR2. = 1 THEN JUMP 41
IF PAR2. = 2 THEN JUMP 42
IF PAR2. = 3 THEN JUMP 43
IF PAR2. = 4 THEN JUMP 44
JUMP 102
C
41 LOCATE POS = CHECK(POS41)
JUMP 10
42 LOCATE POS = CHECK(POS42)
JUMP 10
43 LOCATE POS = CHECK(POS43)
JUMP 10
44 LOCATE POS = CHECK(POS44)
C
C ????? ???? (1,2)
10 IF PAR3. = 1 THEN JUMP 91
IF PAR3. = 2 THEN JUMP 92
JUMP 102
C
91 LOCATE #POS = #POS1
JUMP 100
92 LOCATE #POS = #POS2
C
100 RETURN 1
C --------
102 SET ERRORW. = ER1
C ???? ? ???????
101 RETURN
C ------
.End
C
C##############################################################
.Program ALARM
C ----------------------------
C ??????? ?? ????? ????
C ----------------------------
C
PRINT 'ALARM'
C
WAIT IN I.ALARM.N
C
STOP 'Continue ?'
C
ENABLE INCALLS
RETURN
.End
C##############################################################
C
C==============================================================
.Program INIT
C ------------------------------------
C ?????????? ????? ???? ? ??
C ------------------------------------
C
C ?????????? ??????????? ????
CALL INID2.
C
C************ ?????????? ??? / ???? ****************
C
OUTGROUP 1 = 0
OUTGROUP 2 = 0
C
C--------------------------- ??? ----------------------------
C ?????
C ??
SET I.ALARM.Y = 15
C ???
SET I.ALARM.N = -15
C ?????? ????
C ?????
SET I.WORK.Y = 14
C ??????
SET I.WORK.N = -14
C
C--------------------------- ???? ---------------------------
C ?????? ????
C ??????
SET O.WORK.Y = 14
C ????????
SET O.WORK.N = -14
C
C**************************************************************
C
SPEED 166
ODELAY 1
CDELAY 1
TOOL
FRAME CHECK = O,X,Y
C
C*************************** ???? *************************
C ?????? ?????? (A)
SET ER1 = 65
C
C************************* ??????? ***********************
C
C ??? ??????
SET MAX.FR. = 4
C ???????? ?? ??? ?????
SET MAX.TYPE = 4
C ???????? ?? ????? ??? ??
SET MAX.DET = 4
C ?????? ?????? ????? ???
SET SPEED = 200
SPEED% SPEED
C
INCALL I.ALARM.Y, ALARM
RETURN
C ------
C
C************************* ????????? ************************
C ??????:
C #READY0 - ????? ????????? ??? READY
C #SPACE - ??????? ?????????
C #HOME - ?????? ?????????
C #POS1 - ????????? ???? 1
C #POS2 - ????????? ???? 2
C O - ???? ???? ??????? ???
C X - ??? X ???
C Y - ??? Y ???
C #PUT - ????????? ??? ????
C #WAIT - ????????? ? ??? ????
C #WORK - ????????? ??? ????
C ??????:
C CHECK, POS, #POS
.End





Чтобы не видеть здесь видео-рекламу достаточно стать зарегистрированным пользователем.
Чтобы не видеть никакую рекламу на сайте, нужно стать VIP-пользователем.
Это можно сделать совершенно бесплатно. Читайте подробности тут.