&ACCESS RVP &REL 14 &PARAM EDITMASK = * &PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe DEF TestTpCube( ) ;FOLD Declaration DECL INT cmdN DECL BOOL FLAG_END ;ENDFOLD (Declaration) ;FOLD INI;%{PE} ;FOLD BASISTECH INI GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( ) INTERRUPT ON 3 BAS (#INITMOV,0 ) ;ENDFOLD (BASISTECH INI) ;FOLD USER INI ;Make your modifications here ;ENDFOLD (USER INI) ;ENDFOLD (INI) ;FOLD PTP HOME Vel= 100 % DEFAULT;%{PE}%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:100, 7:DEFAULT $BWDSTART = FALSE PDAT_ACT=PDEFAULT FDAT_ACT=FHOME BAS (#PTP_PARAMS,100 ) $H_POS=XHOME PTP XHOME ;ENDFOLD ;FOLD initialisation et ouverture du canal ;Initialize and Open channel RET=EKI_Init("configcomcube") RET=EKI_Open("configcomcube") WAIT FOR $FLAG[1] FLAG_END = FALSE WHILE(NOT FLAG_END) ;Envoi des données OFFSET=0 FOR i=(1) TO (100) Cmd[i]=0 ENDFOR SWRITE(Cmd[],STATE,OFFSET,"%s","getmove") RET=EKI_Send("configcomcube",Cmd[]) wait sec 1.5 ;récupération des données ;RET = EKI_CheckBuffer("configcomcube","Buffer") ;wait sec 1 ;IF RET.Buff <> 0 THEN WAIT FOR $Out[60] RET=EKI_GetString("configcomcube","Buffer",Cmd[]) $Out[60]=FALSE wait sec 1 ;ENDIF ;************************************************************ OFFSET=0 SREAD(Cmd[],STATE,OFFSET,"%d",cmdN) if cmdN == 20 THEN ;msg = {modul[] "Info", nr 123, msg_txt[] "Caractere 20 recu"} ;opt = {vl_stop true, clear_p_reset true, clear_p_SAW false,log_to_DB true} ;nHandle = Set_KrlMsg (#notify, msg,par[], opt) ;wait sec 1 endif if cmdN == 0 THEN ;msg = {modul[] "Info", nr 123, msg_txt[] "Caractere 0 recu"} ;opt = {vl_stop true, clear_p_reset true, clear_p_SAW false,log_to_DB true} ;nHandle = Set_KrlMsg (#notify, msg,par[], opt) ;Fin de programme FLAG_END = TRUE ENDIF ENDWHILE ;FOLD PTP HOME Vel= 100 % DEFAULT;%{PE}%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:HOME, 3:, 5:100, 7:DEFAULT $BWDSTART = FALSE PDAT_ACT=PDEFAULT FDAT_ACT=FHOME BAS (#PTP_PARAMS,100 ) $H_POS=XHOME PTP XHOME ;ENDFOLD END