$$ -------------------------------------------------------------------------
$$ Start Up and Program Number
$$ This is for user to input the program number
$$ after the prompt on the screen and Post read in
$$ the text string then output to the MCD.
CIMFIL/ON,MACHIN $$ Startcode
rslt=POSTF(13) $$ MUST DO
SEQNO/OFF
prmpt=TEXT/'ENTER PROGRAM NUMBER'
rslt=FILEF(0,1,prmpt) $$ File function and write to screen
prgnm=TEXT/READ,0 $$ Read from the screen
INSERT/'O',prgnm,'$'
PREFUN/90,NEXT $$ G90
PREFUN/80,NEXT $$ G80
PREFUN/17,NEXT $$ G17
PREFUN/0 $$ G00
CIMFIL/OFF
$$ The fisrt 0 mean file on the screen and the second block 1 mean write
$$ -------------------------------------------------------------------------
CIMFIL/ON,LOADTL
rslt=POSTF(2,1,1867,1) $$ Set COMMAND value and let PP do the simulation mode
rslt=POSTF(13)
rslt=POSTF(2,1,1867,0) $$ Set back to PP Excution mode
IF(1stc.EQ.0)THEN
1stn=POSTF(7,4)
1stc=1
ENDIF
recnum=POSTF(7,1)
max=999999
DO/presel,inc=1,max $$ start the do-loop
rslt=POSTF(14) $$ Read next record
rectyp=POSTF(7,2) $$ Check the record type for 2000 record
CASE/rectyp
WHEN/2000
subtyp=POSTF(7,3) $$ Check the sub-type record if the loadtl record
IF(subtyp.EQ.(ICODEF(LOADTL)))THEN
nxtnm=POSTF(7,4)
inc=max+1
rslt=POSTF(15,(recnum+1))
ENDIF
WHEN/14000
nxtnm=1stn
inc=max+1
rslt=POSTF(15,(recnum+1))
ENDCAS
presel)CONTIN
AUXFUN/6
POSTN/OUT,T,nxtnm
CIMFIL/OFF
$$ ---------------------------------------------------------------------
$$ Turn the Spindle Off
CIMFIL/ON,SPINDL
recnum=POSTF(7,1)
max=999999
DO/prescn,inc=1,max $$ start the do-loop
rslt=POSTF(14) $$ Read next record
rectyp=POSTF(7,2) $$ Check the record type for 2000 record
CASE/rectyp
WHEN/2000
subtyp=POSTF(7,3) $$ Check the sub-type record if the cycle record
IF(subtyp.EQ.(ICODEF(CYCLE)))THEN
cyctyp=POSTF(7,4)
IF(cyctyp.EQ.(ICODEF(TAP)))THEN
flag=1
inc=max+1
rslt=POSTF(15,(recnum+1))
ENDIF
ENDIF
IF(subtyp.EQ.ICODEF(LOADTL))THEN
flag=0
inc=max+1
rslt=POSTF(15,(recnum+1))
ENDIF
WHEN/14000
flag=0
inc=max+1
rslt=POSTF(15,(recnum+1))
ENDCAS
prescn)CONTIN
IF(flag.EQ.1)INSERT/'Taping Cycle Found$'
CIMFIL/OFF作者: bbzzcl 时间: 2007-7-1 12:55
请高手讲解每段的含义!作者: 84697082 时间: 2008-10-11 20:14
什么意思,不懂啊,请楼主讲解作者: dadidehaizi 时间: 2013-8-26 12:41
翻出来看看