PGNO_PARITY set 3207 regardless of TRUE or flash PGNO is 0
KCP shows Wait For $Input[PGNO_VALID]==TRUE
PGNO_PARITY set 3207 regardless of TRUE or flash PGNO is 0
KCP shows Wait For $Input[PGNO_VALID]==TRUE
This is the $config.dat setting not called with CELL.scr
Setting 1
Setting 1
- thread should be in Kuka section.
- What is the question?
Have you seen the diagram and explanations for auto extern signals in robot documentation?
You can use the version from newer robots, as there are no changes since first generation.
post content of the CELL.SRC. evaluation of the signals is done by P00.SRC and CELL() has loop and several calls to P00(). sometimes people mess with the structure and remove or swap the call lines without paying attention to parameters.
post content of the CELL.SRC. evaluation of the signals is done by P00.SRC and CELL() has loop and several calls to P00(). sometimes people mess with the structure and remove or swap the call lines without paying attention to parameters.
SCR module is not available in the KUKA system, so delete it.
As shown in the figure, there is no CELL.SCR file under the R1 file.
SCR module is not available in the KUKA system, so delete it.
As shown in the figure, there is no CELL.SCR file under the R1 file.
...what? You need to open the /R1 folder.
If the robot did not have CELL.SRC, you would not be getting that message.
What is that photo from? It's not the KUKA File Navigator.
...what? You need to open the /R1 folder.
If the robot did not have CELL.SRC, you would not be getting that message.
What is that photo from? It's not the KUKA File Navigator.
You can write your own logic without cell.scr, but I didn't write it
- thread should be in Kuka section.
- What is the question?
Have you seen the diagram and explanations for auto extern signals in robot documentation?
You can use the version from newer robots, as there are no changes since first generation.
The HMI writes the program number. The program number has been written to the KUKA system, but the PGNO remains at 0.
Only CELL.SRC uses PGNO. Why would someone write a different program that also uses PGNO? Is this an old Volkswagen or GM robot? If this robot is not using CELL.SRC, then the value of PGNO may be irrelevant. What program is this robot using in place of CELL? Post the actual code.
Anyway, PGNO only gets set if CELL.SRC is running and calls P00. P00 can only set PGNO correctly if PGNO_FBIT, PGNO_TYPE, PGNO_LENGTH, PGNO_PARITY, have all been configured correctly, and the PLC receives PGNO_REQ correctly and responds with PGNO_VALID in the correct method.
Only CELL.SRC uses PGNO. Why would someone write a different program that also uses PGNO? Is this an old Volkswagen or GM robot? If this robot is not using CELL.SRC, then the value of PGNO may be irrelevant. What program is this robot using in place of CELL? Post the actual code.
Anyway, PGNO only gets set if CELL.SRC is running and calls P00. P00 can only set PGNO correctly if PGNO_FBIT, PGNO_TYPE, PGNO_LENGTH, PGNO_PARITY, have all been configured correctly, and the PLC receives PGNO_REQ correctly and responds with PGNO_VALID in the correct method.
It's not VW welding, it's the old Mercedes welding robot, but it feels the same as the VW welding robot.
DEF P00_SUBM (COMMAND :IN,PGNO_FUNCT :IN )
;----------------------------
;Version: DC-W211
; KUKA SW3.2.6/SP04
;----------------------------
DECL P00_COMMAND COMMAND
DECL FUNCT_TYPE PGNO_FUNCT
SWITCH COMMAND
CASE #INIT_EXT
IF ERROR_FLAG==TRUE THEN
$H_POS=XHOME
CHK_HOME ( )
INIT_EXT ( )
ENDIF
CASE #EXT_PGNO
IF (ERROR_FLAG==FALSE) AND (CHK_STEP==2) THEN
EXT_PGNO (PGNO_FUNCT )
ENDIF
ENDSWITCH
END
DEF INIT_EXT ( )
;********************************
; Function: initializing of the
; external interface
;********************************
PGNO_ERROR=0
ERROR_FLAG=FALSE
;********************************
;INIT PGNO_REQ UND APPL_RUN
;********************************
IF (PGNO_REQ>0) THEN
$OUT[PGNO_REQ]=FALSE
ENDIF
IF (PGNO_REQ<0) THEN
$OUT[-PGNO_REQ]=TRUE
ENDIF
IF (APPL_RUN>0) THEN
$OUT[APPL_RUN]=FALSE
ENDIF
SWITCH PGNO_TYPE
;*********************************************************
CASE 1,2 ;bci-coding,bcd-coding
;*********************************************************
;***** CHECK PGNO_LENGTH *****
IF (PGNO_LENGTH<1) THEN
ERROR_FLAG=TRUE ;pgno_length
P01_MSG (2 )
ENDIF
IF (PGNO_TYPE==1) THEN ;bci-coding
IF (PGNO_LENGTH>16) THEN
ERROR_FLAG=TRUE ;pgno_length
P01_MSG (2 )
ENDIF
ENDIF
IF (PGNO_TYPE==2) THEN ;bcd-coding
SWITCH PGNO_LENGTH
CASE 4,8,12,16
DEFAULT
ERROR_FLAG=TRUE ;pgno_length
P01_MSG (3 )
ENDSWITCH
ENDIF
;***** CHECK PGNO_FBIT *****
IF (PGNO_FBIT<1) THEN
ERROR_FLAG=TRUE ;pgno_fbit
P01_MSG (4 )
ENDIF
;***** CHECK PGNO_REQ *****
IF (PGNO_REQ==0) THEN
ERROR_FLAG=TRUE ;pgno_req
P01_MSG (7 )
ENDIF
IF (PGNO_REQ>0) THEN ;active high
$OUT[PGNO_REQ]=FALSE ;reset
WAIT SEC 0.2 ;delay for plc
ENDIF
IF (PGNO_REQ<0) THEN ;active low
$OUT[PGNO_REQ*(-1)]=TRUE ;reset
WAIT SEC 0.2 ;delay for plc
ENDIF
;*********************************************************
CASE 3 ;one out of n
;*********************************************************
;***** CHECK PGNO_LENGTH *****
IF (PGNO_LENGTH<1) THEN
ERROR_FLAG=TRUE ;pgno_length
P01_MSG (2 )
ENDIF
IF (PGNO_LENGTH>16) THEN
ERROR_FLAG=TRUE ;pgno_length
P01_MSG (2 )
ENDIF
;***** CHECK PGNO_FBIT *****
IF (PGNO_FBIT<1) THEN
ERROR_FLAG=TRUE ;pgno_fbit
P01_MSG (4 )
ENDIF
;*********************************************************
DEFAULT ;PGNO_TYPE wrong type
;*********************************************************
ERROR_FLAG=TRUE ;pgno_type
P01_MSG (1 )
ENDSWITCH
;***********************************************************
END
DEF EXT_PGNO (FUNCT )
;********************************
; Function: communication program
; for external mode
;********************************
DECL FUNCT_TYPE FUNCT
INT I,J,K,L,M,N
BOOL P_RECV
BOOL P_CALC
J=1
K=0
L=1
P_RECV=FALSE
P_CALC=FALSE
IF (APPL_RUN>0) AND (P01_STEP<>3) THEN
$OUT[APPL_RUN]=FALSE
ENDIF
SWITCH FUNCT
;*******************
CASE #PGNO_ACKN
;*******************
IF (PGNO_REQ>0) AND (P01_STEP==3) THEN
$OUT[PGNO_REQ]=FALSE
ENDIF
IF (PGNO_REQ<0) AND (P01_STEP==3) THEN
$OUT[PGNO_REQ*(-1)]=TRUE
ENDIF
IF (APPL_RUN>0) AND (P01_STEP==3) THEN
$OUT[APPL_RUN]=TRUE
ENDIF
;*******************
CASE #PGNO_GET
;*******************
SWITCH PGNO_TYPE
;*******************
CASE 1,2
;*******************
SWITCH P01_STEP
CASE 0
IF PGNO_VALID>0 THEN
IF $IN[PGNO_VALID]==FALSE THEN
P01_STEP=1
$LOOP_MSG[]=" "
ELSE
$LOOP_MSG[]="Wait For $Input[PGNO_VALID]==FALSE"
ENDIF
ELSE
IF PGNO_VALID<0 THEN
IF $IN[PGNO_VALID*(-1)]==TRUE THEN
P01_STEP=1
$LOOP_MSG[]=" "
ELSE
$LOOP_MSG[]="Wait For $Input[PGNO_VALID]==TRUE"
ENDIF
ELSE
IF PGNO_VALID==0 THEN
IF $EXT_START==FALSE THEN
P01_STEP=1
$LOOP_MSG[]=" "
ELSE
$LOOP_MSG[]="Wait For $EXT_START==FALSE"
ENDIF
ENDIF
ENDIF
ENDIF
CASE 1
IF PGNO_REQ>0 THEN
$OUT[PGNO_REQ]=TRUE
P01_STEP=2
ELSE
IF PGNO_REQ<0 THEN
$OUT[PGNO_REQ*(-1)]=FALSE
P01_STEP=2
ENDIF
ENDIF
CASE 2
IF PGNO_VALID>0 THEN
IF $IN[PGNO_VALID]==TRUE THEN
P01_STEP=3
$LOOP_MSG[]=" "
ELSE
$LOOP_MSG[]="Wait For $Input[PGNO_VALID]==TRUE"
ENDIF
ELSE
IF PGNO_VALID<0 THEN
IF $IN[PGNO_VALID*(-1)]==FALSE THEN
P01_STEP=3
$LOOP_MSG[]=" "
ELSE
$LOOP_MSG[]="Wait For $Input[PGNO_VALID]==FALSE"
ENDIF
ELSE
IF PGNO_VALID==0 THEN
IF $EXT_START==TRUE THEN
P01_STEP=3
$LOOP_MSG[]=" "
ELSE
$LOOP_MSG[]="Wait For $EXT_START==TRUE"
ENDIF
ENDIF
ENDIF
ENDIF
CASE 3
P01_STEP=0
DEFAULT
ENDSWITCH
PGNO=0
SWITCH PGNO_TYPE
;*******************
CASE 1
;*******************
FOR I=0 TO PGNO_LENGTH-1
IF $IN[PGNO_FBIT+I] THEN
PGNO=PGNO+J
ENDIF
J=J*2
ENDFOR
;*******************
CASE 2
;*******************
FOR I=0 TO PGNO_LENGTH-1 STEP 4
N=0
J=1
FOR M=I TO I+3
IF $IN[PGNO_FBIT+M] THEN
N=N+J
ENDIF
J=J*2
ENDFOR
IF (N>9) THEN
PGNO_ERROR=2
PGNO=0
EXIT
ELSE
PGNO=PGNO+N*L
L=L*10
ENDIF
ENDFOR
ENDSWITCH
IF P01_STEP==3 THEN
PGNO_FLAG=PGNO
ENDIF
IF (PGNO_ERROR<>2) THEN
IF (PGNO_PARITY>0) THEN
P_RECV=$IN[PGNO_PARITY]
FOR I=0 TO PGNO_LENGTH-1
P_CALC=P_CALC EXOR $IN[PGNO_FBIT+I]
ENDFOR
IF (P_RECV<>P_CALC) THEN
PGNO=0
PGNO_ERROR=1
ELSE
PGNO_ERROR=0
ENDIF
ENDIF
IF (PGNO_PARITY<0) THEN
P_RECV=$IN[PGNO_PARITY*(-1)]
FOR I=0 TO PGNO_LENGTH-1
P_CALC=P_CALC EXOR $IN[PGNO_FBIT+I]
ENDFOR
IF (P_RECV<> NOT (P_CALC)) THEN
PGNO=0
PGNO_ERROR=1
ELSE
PGNO_ERROR=0
ENDIF
ENDIF
ENDIF
;*******************
CASE 3
;*******************
SWITCH P01_STEP
CASE 0
IF PGNO>0 THEN
PGNO_FLAG=PGNO ;remember old program number
IF $IN[PGNO_FBIT+PGNO-1]==FALSE THEN
P01_STEP=2
ELSE
$LOOP_MSG[]="Wait for $Input[PGNO_FBIT+PGNO-1]==FALSE"
P01_STEP=1
ENDIF
ELSE
P01_STEP=2
ENDIF
CASE 1
IF $IN[PGNO_FBIT+PGNO_FLAG-1]==FALSE THEN
$LOOP_MSG[]=" "
P01_STEP=2
ELSE
$LOOP_MSG[]="Wait for $Input[PGNO_FBIT+PGNO-1]==FALSE"
ENDIF
CASE 2
K=0
IF $IN[PGNO_FBIT+PGNO_FLAG-1]==FALSE THEN
FOR I=0 TO PGNO_LENGTH-1
IF $IN[PGNO_FBIT+I] THEN
IF K==0 THEN
K=I+1
ELSE
PGNO_ERROR=0
K=0
ENDIF
ENDIF
ENDFOR
ELSE
P01_STEP=1
ENDIF
PGNO=K
IF PGNO<>0 THEN
P01_STEP=3
ENDIF
CASE 3
P01_STEP=0
ENDSWITCH
ENDSWITCH
;***********************************************************
CASE #PGNO_FAULT
;***********************************************************
IF PGNO_ERROR==1 THEN
P01_MSG (10 )
ENDIF
IF PGNO_ERROR==2 THEN
P01_MSG (12 )
ENDIF
IF PGNO_ERROR==0 THEN
IF (PGNO_TYPE==3) THEN
P01_MSG (15 )
ELSE
IF $PERI_RDY AND $MOVE_ENABLE THEN ;17_01_2002
P01_MSG (11 )
ELSE
IF NOT $PERI_RDY THEN
P01_MSG (14 )
ENDIF
IF NOT $MOVE_ENABLE THEN
P01_MSG (13 )
ENDIF
ENDIF
ENDIF
ENDIF
PGNO_ERROR=0
IF (PGNO_REQ>0) THEN
$OUT[PGNO_REQ]=FALSE
ENDIF
IF (PGNO_REQ<0) THEN
$OUT[PGNO_REQ*(-1)]=TRUE
ENDIF
;WAIT SEC 0.5
;IF PGNO_TYPE<>3 THEN
; P01_STEP=3
;ENDIF
ENDSWITCH
END
;********************************
;CHECK HOME
;********************************
DEF CHK_HOME ( )
SWITCH CHK_STEP
CASE 0
IF IsInHome()==FALSE THEN
CHK_STEP=1
$LOOP_MSG[]="Robot not in Home-Position!"
ELSE
CHK_STEP=2
ENDIF
CASE 1
ERROR_FLAG=TRUE
IF IsInHome()==TRUE THEN
$LOOP_MSG[]=" "
CHK_STEP=2
ENDIF
ENDSWITCH
END
DEF P01_MSG (MSG_NR :IN )
DECL INT MSG_NR
DECL INT OFFSET
DECL STATE_T STATE
DECL MSG_T P_MSG
DECL MSG_T EMPTY_MSG
$LOOP_MSG[]=" "
EMPTY_MSG={MSG_T: VALID FALSE,RELEASE FALSE,TYP #NOTIFY,MODUL[] " ",KEY[] " ",PARAM_TYP #VALUE,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0}
P_MSG={MSG_T: VALID FALSE,RELEASE FALSE,TYP #NOTIFY,MODUL[] "P00",KEY[] " ",PARAM_TYP #KEY,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0}
$MSG_T=P_MSG
SWITCH MSG_NR
CASE 1
$MSG_T.KEY[]="PgNo_TypeWrong"
CASE 2
$MSG_T.KEY[]="PgNo_LengthTooSmall"
CASE 3
$MSG_T.KEY[]="PgNo_LengthWrong"
CASE 4
$MSG_T.KEY[]="PgNo_FBitWrong"
CASE 7
$MSG_T.KEY[]="PgNo_ReqWrong"
CASE 10
$MSG_T.KEY[]="ParityFault"
OFFSET=0
SWRITE($MSG_T.PARAM[],STATE,OFFSET,"%d",PGNO)
CASE 11
$MSG_T.KEY[]="ProgramNotAvailable"
OFFSET=0
SWRITE($MSG_T.PARAM[],STATE,OFFSET,"%d",PGNO)
CASE 12
$MSG_T.KEY[]="BCDCodeError"
OFFSET=0
SWRITE($MSG_T.PARAM[],STATE,OFFSET,"%d",PGNO)
CASE 13 ;17_01_2002
$MSG_T.KEY[]="SelectionRequiresMoveEnable"
CASE 14
$MSG_T.KEY[]="SelectionRequiresDrivesOn"
CASE 15
$MSG_T.KEY[]="ProgNumberWrong"
ENDSWITCH
$MSG_T.VALID=TRUE
WHILE $MSG_T.VALID
WAIT SEC 0.05
ENDWHILE
WAIT SEC 0.2
$MSG_T=EMPTY_MSG
END
Display More
DEF P00 (COMMAND :IN,PGNO_FUNCT :IN,P_ID[] :OUT,E_NO :IN )
DECL P00_COMMAND COMMAND
DECL FUNCT_TYPE PGNO_FUNCT
DECL CHAR P_ID[]
E6AXIS AK_AXIS
REAL AX_DIST
INT E_NO
SWITCH COMMAND
CASE #INIT_EXT
INIT_EXT ( )
CASE #EXT_PGNO
EXT_PGNO (PGNO_FUNCT )
CASE #CHK_HOME
CHK_HOME ( )
CASE #EXT_ERR
EXT_ERR (P_ID[],E_NO )
ENDSWITCH
END
DEF INIT_EXT ( )
;********************************
; Function: initializing of the
; external interface
;********************************
BOOL ERROR
INT N
PGNO_ERROR=0
;********************************
;CHECK HOME
;********************************
;********************************
;INIT PGNO_REQ UND APPL_RUN
;********************************
IF (PGNO_REQ>0) THEN
$OUT[PGNO_REQ]=FALSE
ENDIF
IF (PGNO_REQ<0) THEN
$OUT[-PGNO_REQ]=TRUE
ENDIF
IF (APPL_RUN>0) THEN
$OUT[APPL_RUN]=FALSE
ENDIF
IF PLC_ENABLE AND (ERR_TO_PLC>0) THEN
$OUT[ERR_TO_PLC]=FALSE
ENDIF
IF REFLECT_PROG_NR==1 THEN
FOR N=0 TO PGNO_LENGTH-1
$OUT[PGNO_FBIT_REFL+N]=FALSE
ENDFOR
ENDIF
$LOOP_MSG[]=" "
;*******************
REPEAT
;***********************************************************
ERROR=FALSE
REPEAT
IF ($I_O_ACTCONF==FALSE) THEN
ERROR=TRUE
P00_MSG (13)
ENDIF
UNTIL ($I_O_ACTCONF==TRUE)
SWITCH PGNO_TYPE
;*********************************************************
CASE 1,2 ;bci-coding,bcd-coding
;*********************************************************
;***** CHECK PGNO_LENGTH *****
IF (PGNO_LENGTH<1) THEN
ERROR=TRUE ;pgno_length
P00_MSG (2)
ENDIF
IF (PGNO_TYPE==1) THEN ;bci-coding
IF (PGNO_LENGTH>16) THEN
ERROR=TRUE ;pgno_length
P00_MSG (2)
ENDIF
ENDIF
IF (PGNO_TYPE==2) THEN ;bcd-coding
SWITCH PGNO_LENGTH
CASE 4,8,12,16
DEFAULT
ERROR=TRUE ;pgno_length
P00_MSG (3)
ENDSWITCH
ENDIF
;***** CHECK PGNO_FBIT *****
IF (PGNO_FBIT<1) THEN
ERROR=TRUE ;pgno_fbit
P00_MSG (4)
ENDIF
;***** CHECK PGNO_REQ *****
IF (PGNO_REQ==0) THEN
ERROR=TRUE ;pgno_req
P00_MSG (7)
ENDIF
IF (PGNO_REQ>0) THEN ;active high
$OUT[PGNO_REQ]=FALSE ;reset
WAIT SEC 0.2 ;delay for plc
ENDIF
IF (PGNO_REQ<0) THEN ;active low
$OUT[PGNO_REQ*(-1)]=TRUE ;reset
WAIT SEC 0.2 ;delay for plc
ENDIF
;*********************************************************
CASE 3 ;one out of n
;*********************************************************
;***** CHECK PGNO_LENGTH *****
IF (PGNO_LENGTH<1) THEN
ERROR=TRUE ;pgno_length
P00_MSG (2)
ENDIF
IF (PGNO_LENGTH>16) THEN
ERROR=TRUE ;pgno_length
P00_MSG (2)
ENDIF
;***** CHECK PGNO_FBIT *****
IF (PGNO_FBIT<1) THEN
ERROR=TRUE ;pgno_fbit
P00_MSG (4)
ENDIF
;*********************************************************
DEFAULT ;PGNO_TYPE wrong type
;*********************************************************
ERROR=TRUE ;pgno_type
P00_MSG (1)
ENDSWITCH
;***********************************************************
UNTIL (ERROR==FALSE)
END
DEF EXT_PGNO (FUNCT )
;********************************
; Function: communication program
; for external mode
;********************************
DECL FUNCT_TYPE FUNCT
INT I,J,K,L,M,N
BOOL P_RECV
BOOL P_CALC
J=1
K=0
L=1
P_RECV=FALSE
P_CALC=FALSE
IF (APPL_RUN>0) THEN
$OUT[APPL_RUN]=FALSE
ENDIF
SWITCH FUNCT
;*******************
CASE #PGNO_ACKN
;*******************
IF (PGNO_REQ>0) THEN
$OUT[PGNO_REQ]=FALSE
ENDIF
IF (PGNO_REQ<0) THEN
$OUT[PGNO_REQ*(-1)]=TRUE
ENDIF
IF (APPL_RUN>0) THEN
$OUT[APPL_RUN]=TRUE
ENDIF
;*******************
CASE #PGNO_GET
;*******************
IF REFLECT_PROG_NR==1 THEN
FOR N=0 TO PGNO_LENGTH-1
$OUT[PGNO_FBIT_REFL+N]=FALSE
ENDFOR
ENDIF
SWITCH PGNO_TYPE
;*******************
CASE 1,2
;*******************
IF (PGNO_VALID>0) THEN
WAIT FOR $IN[PGNO_VALID]==FALSE
ENDIF
IF (PGNO_VALID==0) THEN
WAIT FOR $EXT_START==FALSE
ENDIF
IF (PGNO_VALID<0) THEN
WAIT FOR $IN[PGNO_VALID*(-1)]==TRUE
ENDIF
IF (PGNO_REQ>0) THEN
$OUT[PGNO_REQ]=TRUE
ENDIF
IF (PGNO_REQ<0) THEN
$OUT[PGNO_REQ*(-1)]=FALSE
ENDIF
IF (PGNO_VALID>0) THEN
REPEAT
IF REFLECT_PROG_NR==1 THEN
FOR I=0 TO PGNO_LENGTH-1
IF $IN[PGNO_FBIT+I]==TRUE THEN
$OUT[PGNO_FBIT_REFL+I]=TRUE
ELSE
$OUT[PGNO_FBIT_REFL+I]=FALSE
ENDIF
ENDFOR
ENDIF
$LOOP_MSG[]="Wait for PGNO_VALID=True"
UNTIL $IN[PGNO_VALID]==TRUE
$LOOP_MSG[]=" "
ENDIF
IF (PGNO_VALID==0) THEN
REPEAT
IF REFLECT_PROG_NR==1 THEN
FOR I=0 TO PGNO_LENGTH-1
IF $IN[PGNO_FBIT+I]==TRUE THEN
$OUT[PGNO_FBIT_REFL+I]=TRUE
ELSE
$OUT[PGNO_FBIT_REFL+I]=FALSE
ENDIF
ENDFOR
ENDIF
$LOOP_MSG[]="Wait for $EXT_START=True"
UNTIL $EXT_START==TRUE
$LOOP_MSG[]=" "
ENDIF
IF (PGNO_VALID<0) THEN
REPEAT
IF REFLECT_PROG_NR==1 THEN
FOR I=0 TO PGNO_LENGTH-1
IF $IN[PGNO_FBIT+I]==TRUE THEN
$OUT[PGNO_FBIT_REFL+I]=TRUE
ELSE
$OUT[PGNO_FBIT_REFL+I]=FALSE
ENDIF
ENDFOR
ENDIF
$LOOP_MSG[]="Wait for PGNO_VALID=False"
UNTIL $IN[PGNO_VALID*(-1)]==FALSE
$LOOP_MSG[]=" "
ENDIF
PGNO=0
SWITCH PGNO_TYPE
;*******************
CASE 1
;*******************
FOR I=0 TO PGNO_LENGTH-1
IF $IN[PGNO_FBIT+I] THEN
IF REFLECT_PROG_NR==1 THEN
$OUT[PGNO_FBIT_REFL+I]=TRUE
ENDIF
PGNO=PGNO+J
ENDIF
J=J*2
ENDFOR
;*******************
CASE 2
;*******************
FOR I=0 TO PGNO_LENGTH-1 STEP 4
N=0
J=1
FOR M=I TO I+3
IF $IN[PGNO_FBIT+M] THEN
N=N+J
IF REFLECT_PROG_NR==1 THEN
$OUT[PGNO_FBIT_REFL+M]=TRUE
ENDIF
ENDIF
J=J*2
ENDFOR
IF (N>9) THEN
PGNO_ERROR=2
PGNO=0
EXIT
ELSE
PGNO=PGNO+N*L
L=L*10
ENDIF
ENDFOR
ENDSWITCH
IF (PGNO_ERROR<>2) THEN
IF (PGNO_PARITY>0) THEN
P_RECV=$IN[PGNO_PARITY]
FOR I=0 TO PGNO_LENGTH-1
P_CALC=P_CALC EXOR $IN[PGNO_FBIT+I]
ENDFOR
IF (P_RECV<>P_CALC) THEN
PGNO=0
PGNO_ERROR=1
ELSE
PGNO_ERROR=0
ENDIF
ENDIF
IF (PGNO_PARITY<0) THEN
P_RECV=$IN[PGNO_PARITY*(-1)]
FOR I=0 TO PGNO_LENGTH-1
P_CALC=P_CALC EXOR $IN[PGNO_FBIT+I]
ENDFOR
IF (P_RECV<> NOT (P_CALC)) THEN
PGNO=0
PGNO_ERROR=1
ELSE
PGNO_ERROR=0
ENDIF
ENDIF
ENDIF
;*******************
CASE 3
;*******************
IF PGNO>0 THEN
WAIT FOR $IN[PGNO_FBIT+PGNO-1]==FALSE
ENDIF
K=0
REPEAT
FOR I=0 TO PGNO_LENGTH-1
IF $IN[PGNO_FBIT+I] THEN
IF K==0 THEN
K=I+1
ELSE
PGNO_ERROR=0
K=0
ENDIF
ENDIF
ENDFOR
UNTIL ((K<>0) OR (PGNO_ERROR==0))
PGNO=K
ENDSWITCH
;***********************************************************
CASE #PGNO_FAULT
;***********************************************************
IF PGNO_ERROR==1 THEN
P00_MSG (10)
ENDIF
IF PGNO_ERROR==2 THEN
P00_MSG (12)
ENDIF
IF PGNO_ERROR==0 THEN
IF (PGNO_TYPE==3) THEN
P00_MSG (15)
ELSE
P00_MSG (11)
ENDIF
ENDIF
PGNO_ERROR=0
IF (PGNO_REQ>0) THEN
$OUT[PGNO_REQ]=FALSE
ENDIF
IF (PGNO_REQ<0) THEN
$OUT[PGNO_REQ*(-1)]=TRUE
ENDIF
WAIT SEC 0.5
ENDSWITCH
END
DEF CHK_HOME ( )
BOOL H
DECL MSG_T P_MSG
DECL MSG_T EMPTY_MSG
IF ($I_O_ACTCONF==TRUE) THEN
EMPTY_MSG={MSG_T: VALID FALSE,RELEASE FALSE,TYP #NOTIFY,MODUL[] " ",KEY[] " ",PARAM_TYP #VALUE,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0}
P_MSG={MSG_T: VALID FALSE,RELEASE FALSE,TYP #QUIT,MODUL[] "P00",KEY[] "MoveHomeInT1",PARAM_TYP #KEY,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0}
$MSG_T=P_MSG
WAIT SEC 1.0
REPEAT
H=TRUE
IF (IsInHome()==FALSE) THEN
H=FALSE
$MSG_T.VALID=TRUE
REPEAT
HALT
IF (($MODE_OP==#T1) OR ($MODE_OP==#T2)) THEN
$MSG_T.RELEASE=TRUE
$MSG_T=EMPTY_MSG
RETURN
ENDIF
UNTIL IsInHome()==TRUE
ELSE
H=TRUE
ENDIF
UNTIL ((H==TRUE) OR ($I_O_ACTCONF==FALSE))
ENDIF
END
DEF EXT_ERR (P_ID,E_NO :IN )
;******************************
;Function : ext. error messages
; for package P00
;******************************
CHAR P_ID[]
INT E_NO,M
;********* MODUL-/FEHLER-NUMMER AUSWERTEN ********
I=1
FOUND=FALSE
IF (E_NO==0) THEN
IF PLC_ENABLE THEN
ERR=0
WAIT SEC 0.2
IF (ERR_TO_PLC >0) THEN
$OUT[ERR_TO_PLC]=FALSE
WAIT SEC 0.2
ENDIF
ENDIF
ELSE
IF PLC_ENABLE THEN
FOUND=FALSE
;******************************
; APPLIKATIONS-FEHLER AUSWERTEN
;******************************
I=1
REPEAT
IF (E_NO==P[I].ERR) THEN
IF (P_ID[1]==P[I].PKG[1]) THEN
IF (P_ID[2]==P[I].PKG[2]) THEN
IF (P_ID[3]==P[I].PKG[3]) THEN
FOUND=TRUE
ERR=P[I].OUT
F_WRITE ( )
ENDIF
ENDIF
ENDIF
ENDIF
I=I+1
UNTIL (I>MAXERR_A) OR FOUND
;***************************
; $STOPMESS-FEHLER AUSWERTEN
;***************************
I=128
IF (P_ID[1]=="C") THEN
IF (P_ID[2]=="T") THEN
IF (P_ID[3]=="L") THEN
M=MBX_REC(1,MLD)
IF M==0 THEN
REPEAT
IF (MLD.MESSNO==P[I].ERR) THEN
FOUND=TRUE
ERR=P[I].OUT
F_WRITE ( )
ENDIF
I=I+1
UNTIL (I>MAXERR_C+128-1) OR FOUND
ENDIF
ENDIF
ENDIF
ENDIF
IF (ERR_TO_PLC >0) THEN
$OUT[ERR_TO_PLC]=TRUE
ENDIF
ENDIF
ENDIF
END
DEF F_WRITE ( )
IF (F_NO>64) THEN
F_NO=1
ENDIF
ERR_FILE[F_NO].P[1]=P[I].PKG[1]
ERR_FILE[F_NO].P[2]=P[I].PKG[2]
ERR_FILE[F_NO].P[3]=P[I].PKG[3]
ERR_FILE[F_NO].E=P[I].ERR
F_NO=F_NO+1
END
DEF P00_MSG (MSG_NO :IN )
DECL INT OFFSET,MSG_NO
DECL STATE_T STATE
DECL MSG_T P_MSG
DECL MSG_T EMPTY_MSG
EMPTY_MSG={MSG_T: VALID FALSE,RELEASE FALSE,TYP #NOTIFY,MODUL[] " ",KEY[] " ",PARAM_TYP #VALUE,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0}
P_MSG={MSG_T: VALID FALSE,RELEASE FALSE,TYP #QUIT,MODUL[] "P00",KEY[] " ",PARAM_TYP #KEY,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0}
$MSG_T=P_MSG
SWITCH MSG_NO
CASE 1
$MSG_T.KEY[]="PgNo_TypeWrong"
CASE 2
$MSG_T.KEY[]="PgNo_LengthRangeWrong"
CASE 3
$MSG_T.KEY[]="PgNo_LengthWrong"
CASE 4
$MSG_T.KEY[]="PgNo_FBitWrong"
CASE 7
$MSG_T.KEY[]="PgNo_ReqWrong"
CASE 10
$MSG_T.KEY[]="ParityFault"
OFFSET=0
SWRITE($MSG_T.PARAM[],STATE,OFFSET,"%d",PGNO)
CASE 11
$MSG_T.KEY[]="ProgramNotAvailable"
OFFSET=0
SWRITE($MSG_T.PARAM[],STATE,OFFSET,"%d",PGNO)
CASE 12
$MSG_T.KEY[]="BCDCodeError"
OFFSET=0
SWRITE($MSG_T.PARAM[],STATE,OFFSET,"%d",PGNO)
CASE 13
$MSG_T.KEY[]="OperatorModeWrong"
CASE 14
$MSG_T.KEY[]="MoveHomeInT1"
CASE 15
$MSG_T.KEY[]="ProgNumberWrong"
ENDSWITCH
$MSG_T.VALID=TRUE
HALT
$MSG_T.RELEASE=TRUE
WHILE $MSG_T.VALID
WAIT SEC 0.05
ENDWHILE
WAIT SEC 0.2
$MSG_T=EMPTY_MSG
END
Display More
DEF SPS ( )
;FOLD DECLARATIONS
;FOLD BASISTECH DECL
;Automatik extern
DECL STATE_T STAT
DECL MODUS_T MODE
;ENDFOLD (BASISTECH DECL)
;FOLD USER DECL
; Please insert user defined declarations
DECL INT OFFSET,K,REP,INDEX
DECL BOOL CALL_BY_SPS
DECL BOOL EX_PROG_STOP
DECL INT RedOverSave
DECL INT SpsSubRunCount
;ENDFOLD (USER DECL)
;ENDFOLD (DECLARATIONS)
;FOLD INI
;FOLD DEFAULT MSG_T
$MSG_T={MSG_T: VALID FALSE,RELEASE FALSE,TYP #NOTIFY,MODUL[] " ",KEY[] " ",PARAM_TYP #VALUE,PARAM[] " ",DLG_FORMAT[] " ",ANSWER 0}
;ENDFOLD (DEFAULT MSG_T)
;FOLD AUTOEXT INIT
INTERRUPT DECL 91 WHEN $PRO_STATE1==#P_FREE DO RESET_OUT ()
INTERRUPT ON 91
$LOOP_MSG[]=" "
MODE=#SYNC
$H_POS=$H_POS
Kaltstart=True
if SpsSubRun <> 0 then
$Out[SpsSubRun]=False
SpsSubRunCount=0
endif
;FOLD SpsSubStop4UpdateInit
SpsSubStop4Update=False
SpsSubStopped=False
;ENDFOLD SpsSubStop4UpdateInit
;ENDFOLD (AUTOEXT INIT)
;FOLD USER INIT
; Please insert user defined initialization commands
CALL_BY_SPS=FALSE
EX_PROG_STOP=FALSE
REP=0
P01_STEP=0
CHK_STEP=0
PGNO_FLAG=0
ERROR_FLAG=TRUE
RED_OVER_SAVE=0
;Fold WasserstopInit
WasserStopInit()
;Endfold WasserstopInit
;Fold FeldBusInit
FeldBusON=-1
FeldBusOff=-1
;EndFold (FeldBusInit)
;ENDFOLD (USER INIT)
;ENDFOLD (INI)
LOOP
WAIT FOR NOT($POWER_FAIL)
;FOLD GRIPPERTECH PLC;%{E}%MKUKATPGRP,%CSPS,%VSPS,%P
IF (ZANGEN_FUNKT>0) THEN
H50 (5,AKT_ZANGE,DUMMY,GDEFAULT )
ZANGEN_FUNKT=0
ENDIF
;ENDFOLD (GRIPPERTECH PLC)
;FOLD USER PLC
;FOLD AUTOEXT_DC;%{E}%V3.2.0,%MKUKATPBASIS,%CSPS,%VAUTOEXT,%P
CheckKWE_Magazin()
;FOLD SpsSubStop4UpdateLoop
if SpsSubStop4Update==True then
if (($PRO_STATE1==#P_END) or ($PRO_STATE1==#P_FREE) or ($PRO_STATE1==#P_RESET)) then
SpsSubStopped=True
Halt
SpsSubStopped=false
SpsSubStop4Update=false
endif
endif
;ENDFOLD SpsSubStop4UpdateLoop
if SpsSubRun <> 0 then
SpsSubRunCount=SpsSubRunCount+1
if SpsSubRunCount>SpsSubRunCountMax then
$Out[SpsSubRun] = not $Out[SpsSubRun]
SpsSubRunCount=0
endif
endif
if (RobWaitForIn>0) and (CycFlagWaitForOn>0) then
$OUT[RobWaitForIn]=$CycFlag[CycFlagWaitForOn]
endif
if RobDialogmeldungAktiv <> 0 then
$OUT[RobDialogmeldungAktiv]=$MSG_T.Valid and (($MSG_T.TYP==#DIALOG) or ($MSG_T.TYP==#QUIT))
endif
;FOLD RedOverSave
RedOverSave = RED_OVER_SAVE ;Globalen Wert in lokale Variable speichern
if ((RedOverSave > 0) and ($OV_PRO > RedOverSave)) then
$OV_PRO = RedOverSave
$LOOP_MSG[]="(RED_OVER_SAVE) Suchbeweg. akt. OV kann nicht erhoeht werden "
endif
;ENDFOLD RedOverSave
IF IsInHome() THEN
WorkspaceOFF ()
else
WorkspaceON ()
endif
IF ($MODE_OP==#EX) THEN
GhostBetrieb( )
SWITCH $PRO_STATE1
CASE #P_END,#P_FREE
P00_SUBM (#INIT_EXT,#PGNO_GET )
IF IsInHome() THEN
SPS_INI ( )
ENDIF
P00_SUBM (#EXT_PGNO,#PGNO_GET )
PRO_NAME1_L[]=" "
PRO_NAME1_A[]=" "
EX_PROG_STOP=FALSE
P00_SUBM (#EXT_PGNO,#PGNO_ACKN )
IF P01_STEP==3 THEN
INDEX=FIND_INDEX(PGNO)
IF (INDEX>0) THEN ;Prog-Nr in Tabelle gefunden
OFFSET=0
SWRITE(TMPNAME[],STAT,OFFSET,"RUN /R1/%s",SPS_PROG[INDEX].PROG_NAME[])
CWRITE($CMD,STAT,MODE,TMPNAME[])
WAIT SEC 0.2
IF (($PRO_STATE1==#P_ACTIVE) AND (STAT.RET1==#CMD_OK)) THEN
CALL_BY_SPS=TRUE
ELSE
ERROR_FLAG=FALSE
P00_SUBM (#EXT_PGNO,#PGNO_FAULT )
ENDIF
ELSE
ERROR_FLAG=FALSE
P00_SUBM (#EXT_PGNO,#PGNO_FAULT )
ENDIF
ENDIF
CASE #P_STOP,#P_RESET
IF APPL_RUN>0 THEN
IF $OUT[APPL_RUN] THEN
$OUT[APPL_RUN]=FALSE
ENDIF
ENDIF
IF PROG_CONTROL THEN
EX_PROG_STOP=TRUE
ENDIF
CASE #P_ACTIVE
IF APPL_RUN>0 THEN
IF NOT $OUT[APPL_RUN] THEN
$OUT[APPL_RUN]=TRUE
ENDIF
ENDIF
IF CALL_BY_SPS THEN
OFFSET=0
SREAD($PRO_NAME1[],STAT,OFFSET,"%s",PRO_NAME1_L[])
CALL_BY_SPS=FALSE
ENDIF
IF EX_PROG_STOP THEN
OFFSET=0
SREAD($PRO_NAME1[],STAT,OFFSET,"%s",PRO_NAME1_A[])
FOR K=1 TO 8
IF PRO_NAME1_L[K]<>PRO_NAME1_A[K] THEN
$LOOP_MSG[]="Programm wurde nicht von der SPS angewaehlt !"
ERROR_FLAG=FALSE
CWRITE($CMD,STAT,MODE,"STOP 1")
EXIT
ENDIF
ENDFOR
EX_PROG_STOP=FALSE
ENDIF
ENDSWITCH
ELSE
IF (($MODE_OP==#T1) OR ($MODE_OP==#T2) OR ($MODE_OP==#AUT)) THEN
IF (PGNO_REQ>0) THEN
$OUT[PGNO_REQ]=FALSE
ENDIF
IF (PGNO_REQ<0) THEN
$OUT[-PGNO_REQ]=TRUE
ENDIF
IF ERROR_FLAG==FALSE THEN
$LOOP_MSG[]=" "
ERROR_FLAG=TRUE
P01_STEP=0
CHK_STEP=0
ENDIF
ENDIF
ENDIF
;ENDFOLD (AUTOEXT_DC)
SPS_IO_DUPL ( )
;FOLD WasserstopLoop
WasserStopLoop()
;ENDFOLD WasserstopLoop
;Fold FeldbusLoop
FeldBus_On_Off()
;EndFold FeldbusLoop
;Fold Kleberloop
Autopurge()
;ENDFOLD
achsen ( )
;ENDFOLD (USER PLC)
ENDLOOP
END
;FOLD Reset_Out
DEF RESET_OUT ( )
INT N
$LOOP_MSG[]=" "
IF REFLECT_PROG_NR == 1 THEN
FOR N = 0 TO PGNO_LENGTH - 1
$OUT[PGNO_FBIT_REFL + N] = FALSE
ENDFOR
ENDIF
IF (PGNO_REQ>0) THEN
$OUT[PGNO_REQ]=FALSE
ELSE
IF (PGNO_REQ<0) THEN
$OUT[-PGNO_REQ]=TRUE
ENDIF
ENDIF
END
;ENDFOLD (Reset_Out)
;FOLD IsInHome
Global DefFct Bool IsInHome()
Decl Bool HomeStatus
switch MaxHome
case 1
HomeStatus=$IN_Home
case 2
HomeStatus=$IN_Home or $IN_HOME1
case 3
HomeStatus=$IN_Home or $IN_HOME1 or $IN_HOME2
default
HomeStatus=False
endswitch
return(HomeStatus)
EndFct
;ENDFOLD (IsInHome)
;FOLD USER SUBROUTINE
; Integrate your user defined subroutines
;FOLD SPS_IO_DUPL
DEF SPS_IO_DUPL ( )
; Vervielfaeltigung von Ein- / Ausgaengen auf Ausgaenge
; Version: V1.1
; Stand: 29.05.99 / RW
INT I
FOR I=1 TO MAX_DUPL
IF ((SIGNAL_DUPL[I].SRC_NO>0) AND (SIGNAL_DUPL[I].SRC_NO<=4096) AND (SIGNAL_DUPL[I].DST_NO>0) AND (SIGNAL_DUPL[I].DST_NO<=4096)) THEN
SWITCH SIGNAL_DUPL[I].SRC_TYP
CASE #INP
SWITCH SIGNAL_DUPL[I].INVERT
CASE #N
$OUT[SIGNAL_DUPL[I].DST_NO]=$IN[SIGNAL_DUPL[I].SRC_NO]
CASE #Y
$OUT[SIGNAL_DUPL[I].DST_NO]= NOT $IN[SIGNAL_DUPL[I].SRC_NO]
DEFAULT
$LOOP_MSG[]="Projektierungsfehler INVERT in IO-Duplizierung"
HALT
$LOOP_MSG[]=" "
ENDSWITCH ;SIGNAL_DUPL[I].INVERT
CASE #OUTP
SWITCH SIGNAL_DUPL[I].INVERT
CASE #N
$OUT[SIGNAL_DUPL[I].DST_NO]=$OUT[SIGNAL_DUPL[I].SRC_NO]
CASE #Y
$OUT[SIGNAL_DUPL[I].DST_NO]= NOT $OUT[SIGNAL_DUPL[I].SRC_NO]
DEFAULT
$LOOP_MSG[]="Projektierungsfehler INVERT in IO-Duplizierung"
HALT
$LOOP_MSG[]=" "
ENDSWITCH ;SIGNAL_DUPL[I].INVERT
DEFAULT
$LOOP_MSG[]="Projektierungsfehler SRC_TYP in IO-Duplizierung"
HALT
$LOOP_MSG[]=" "
ENDSWITCH ;SIGNAL_DUPL[I].SRC_TYP
ELSE
IF ((SIGNAL_DUPL[I].SRC_NO<>0) OR (SIGNAL_DUPL[I].DST_NO<>0)) THEN
$LOOP_MSG[]="Projektierungsfehler SRC_NO oder DST_NO in IO-Duplizierung"
HALT
$LOOP_MSG[]=" "
ENDIF ;((SIGNAL_DUPL[I].SRC_NO<>0) OR ...
ENDIF ;((SIGNAL_DUPL[I].SRC_NO>0) AND ...
ENDFOR ;I=1 TO ...
END ;SPS_IO_DUPL()
;ENDFOLD (SPS_IO_DUPL)
;FOLD FIND_INDEX
DEFFCT INT FIND_INDEX(PGNO :IN)
INT PGNO,II
FOR II=1 TO MAX_SPS_PROG
IF SPS_PROG[II].PROG_NR==PGNO THEN
RETURN II
ENDIF
ENDFOR
RETURN 0
ENDFCT
;ENDFOLD (FIND_INDEX)
;Fold Wasserstopventil
DEF WasserStopInit ( )
decl int k
WSV_Quit = False
$TIMER_STOP[WSV_TI]=TRUE ;¨¹bewachungstimer stop
$TIMER[WSV_TI]=0
for K = 1 to MaxWerkzeuge
if (wkz[k].o_wsv>0) then
$OUT[WKZ[k].O_WSV] = WSV_WasserON ;Wasservorlauf einschalten
$OUT[O_WDFOK] = TRUE
endif
WKZ[k].WDFOK = TRUE
endfor
WSV_AktTimeout=-WSV_Timeout
END
DEF WasserStopLoop ( )
decl int k
for k = 1 to MaxWerkzeuge
if WKZ[k].O_WSV > 0 then ;Wasserstopventil vorhanden ?
;Wasserabsaugung aktiv oder Quittung
if ($IN[I_WASA] or $IN[I_WSVQ] or WSV_QUIT) then
$OUT[WKZ[k].O_WSV]=WSV_WasserON ;Wasservorlauf einschalten
$TIMER_STOP[WSV_TI]=TRUE ;Timer stop
$TIMER[WSV_TI]=0
WSV_AktTimeout=-WSV_QuitTimeout
endif
if $IN[I_WASA_Ein] then ;fuer dezentrale Wasserabsaugung
$OUT[WKZ[k].O_WSV]=not WSV_WasserON ;Wasservorlauf (Y1) abschalten
endif
endif
endfor
if ($Alarm_Stop and ($User_SAF or ($MODE_OP==#T1) or ($MODE_OP==#T2) )) then ;kein Notaus ?
for k = 1 to MaxWerkzeuge
if WKZ[k].O_WSV > 0 then ;Wasserstopventil vorhanden ?
;Bahnhof frei und Werkzeug verriegelt (=Werkzeug angedockt)
if (($in[WKZ[k].I_BHFBEL]==FALSE) and ($in[MPS_Verriegelt] or (not (WKZ[k].Typ==#Wechsel)))) then
;nicht Wasserabsaugung aktiv, keine Quittung
if not ($IN[I_WASA] or $IN[I_WSVQ] or WSV_QUIT) then
;hat Durchflu?waechter angesprochen ?
if (not($in[WKZ[k].I_DFWT] and $in[WKZ[k].I_DFWE])) then
if ($TIMER_STOP[WSV_TI]) then
$TIMER[WSV_TI]=WSV_AktTimeout ;Ueberwachungszeit
$TIMER_STOP[WSV_TI]=FALSE ;Ueberwachungstimer start
endif
else
;HK 8.2.2007
; $TIMER_STOP[WSV_TI]=TRUE ;Timer stoppen
; $TIMER[WSV_TI]=0
endif
if $TIMER_flag[WSV_TI] then ;Wenn Zeit abgelaufen
$TIMER_STOP[WSV_TI]=TRUE ;Timer stoppen
$TIMER[WSV_TI]=0
;Wenn Durchflu?waechter immer noch angesprochen
if (not($in[WKZ[k].I_DFWT] and $in[WKZ[k].I_DFWE])) then
$OUT[WKZ[k].O_WSV] = not WSV_WasserON ;Wasservorlauf ausschalten
endif
endif
endif
;Status Durchflu?w?chter merken
WKZ[k].WDFOK = ($in[WKZ[k].I_DFWT] and $in[WKZ[k].I_DFWE])
else
;wenn Werkzeug nicht angedockt
WKZ[k].WDFOK = TRUE
endif
else ;kein Wasserstopventil vorhanden
WKZ[k].WDFOK = TRUE
endif
endfor
WSV_Quit = False
;Status Durchflu?w?chter an SPS
$OUT[O_WDFOK] = (WKZ[1].WDFOK and WKZ[2].WDFOK and WKZ[3].WDFOK and WKZ[4].WDFOK and WKZ[5].WDFOK and WKZ[6].WDFOK)
if $OUT[O_WDFOK] then
WSV_AktTimeout=-WSV_Timeout
endif
endif
END
;ENDFOLD (WasserstopVentil)
;FOLD ArbeitsraumUeberwachung
DEF WorkSpaceON ( )
decl int i
for i = 1 to 8
if WorkSpace[i].Mode <> #OFF then
$WORKSPACE[i].MODE=WorkSpace[i].Mode
endif
endfor
END
DEF WorkSpaceOFF ( )
decl int i
for i = 1 to 8
if WorkSpace[i].Mode <> #OFF then
$WORKSPACE[i].MODE=#OFF
endif
endfor
END
;ENDFOLD (ArbeitsraumUeberwachung)
;Fold Feldbus
DEF FeldBus_On_Off( )
if FeldBusOn > -1 then
Feldbus(FeldBusOn,0)
FeldBusOn = -1
endif
if FeldBusOff > -1 then
Feldbus(FeldBusOff,1)
FeldBusOff = -1
endif
END
;EndFold (Feldbus)
;ENDFOLD (USER SUBROUTINE)
Display More
Only CELL.SRC uses PGNO. Why would someone write a different program that also uses PGNO? Is this an old Volkswagen or GM robot? If this robot is not using CELL.SRC, then the value of PGNO may be irrelevant. What program is this robot using in place of CELL? Post the actual code.
Anyway, PGNO only gets set if CELL.SRC is running and calls P00. P00 can only set PGNO correctly if PGNO_FBIT, PGNO_TYPE, PGNO_LENGTH, PGNO_PARITY, have all been configured correctly, and the PLC receives PGNO_REQ correctly and responds with PGNO_VALID in the correct method.
I now suspect that PGNO_FBIT_REFL and REFLECT_PROG_NR are not high enough to understand, I set REFLECT_PROG_NR to 1 RKC2 system to submit directly to stop .
The procedure inside the SPS is to activate the interrupt procedure INTERRUPT DECL 91 WHEN $PRO_STATE1==#P_FREE DO RESET_OUT ().
$Out[SpsSubRun]=False This program is supposed to stop Submit.
I tried to start Submit but there is a $OUT[1001] variable write protected in module SPS line 205.
1001 is related to $ROB_CAL.
Fault display
Use code boxes.
On a cursory examination, P00.SRC does not appear to be called. So we can probably ignore that module entirely, since none of its subroutines are DECL'd Globally.
Mercedes appears to have substituted their own modified copy of P00 but called by the SPS, P00_SUBM. Which the SPS has multiple calls to.
You provided no data on the setup of the various PGNO variables. But the message you listed in the first post only occurs at lines 176 and 205 of P00_SUBM. Line 176 only executes if PGNO_VALID is a negative number, and 205 if PGNO_VALID is a positive number.
Going by your photo in post 4, PGNO_VALID is 3206, and the photo from Post 3 shows that Input 3206 is not coming on. So either your PLC is not sending that signal, or your IOSYS mapping is incorrect.
$Out[SpsSubRun]=False This program is supposed to stop Submit.
That has nothing to do with Waiting for PGNO_VALID
I now suspect that PGNO_FBIT_REFL and REFLECT_PROG_NR are not high enough to understand, I set REFLECT_PROG_NR to 1 RKC2 system to submit directly to stop .
What? That sentence made no sense. Regardless, the REFL signals are not related to the issue from the first post.
I tried to start Submit but there is a $OUT[1001] variable write protected in module SPS line 205.
1001 is related to $ROB_CAL.
This means that you have the REFL outputs conflicting with a system output. Your various PGNO variables need to be set correctly.
Use code boxes.
On a cursory examination, P00.SRC does not appear to be called. So we can probably ignore that module entirely, since none of its subroutines are DECL'd Globally.
Mercedes appears to have substituted their own modified copy of P00 but called by the SPS, P00_SUBM. Which the SPS has multiple calls to.
You provided no data on the setup of the various PGNO variables. But the message you listed in the first post only occurs at lines 176 and 205 of P00_SUBM. Line 176 only executes if PGNO_VALID is a negative number, and 205 if PGNO_VALID is a positive number.
Going by your photo in post 4, PGNO_VALID is 3206, and the photo from Post 3 shows that Input 3206 is not coming on. So either your PLC is not sending that signal, or your IOSYS mapping is incorrect.
Settings