(*SOFTCONTROL: VERSION:2.04.01*) PLC_CONFIG CPU_TYPE := FX2N / FX2NC VERSION := 1.00 MEMORY_PARAMETER MAIN_SEQUENCE := 8 FILE_REGISTER := 0 COMMENT_SPACE := 0 END_MEMORY_PARAMETER LATCH_RANGE LATCH_RELAY_LOWER := 500 LATCH_RELAY_UPPER := 1023 LINK_RELAY_LOWER := 500 LINK_RELAY_UPPER := 999 COUNTER_LOWER := 100 COUNTER_UPPER := 199 DATA_REGISTER_LOWER := 220 DATA_REGISTER_UPPER := 255 LINK_REGISTER_LOWER := 200 LINK_REGISTER_UPPER := 511 END_LATCH_RANGE SYSTEM_VARIABLES WORD_TYPE := 0 WORD_LOWER := 400 WORD_UPPER := 999 BIT_TYPE := 0 BIT_LOWER := 512 BIT_UPPER := 1535 TIMER_LOWER_100MS := 100 TIMER_UPPER_100MS := 199 TIMER_LOWER_10MS := 220 TIMER_UPPER_10MS := 245 TIMER_LOWER_RETENTIVE := -1 TIMER_UPPER_RETENTIVE := -1 COUNTER_LOWER := 100 COUNTER_UPPER := 199 LABEL_LOWER := 30 LABEL_UPPER := 126 STEP_FLAG_LOWER := 20 STEP_FLAG_UPPER := 899 END_SYSTEM_VARIABLES PROJECT_OPTIONS RD_OPTIONS ENABLE_RESET_DEVICES := 0 ENABLE_RESET_LATCHED_DEVICES := 0 ENABLE_D_DEVICES := 0 ENABLE_M_DEVICES := 0 ENABLE_T_DEVICES := 0 ENABLE_C_DEVICES := 0 ENABLE_S_DEVICES := 0 ENABLE_ST_DEVICES := 0 END_RD_OPTIONS END_PROJECT_OPTIONS END_PLC_CONFIG PROGRAM ACTIV_PGU VAR_EXTERNAL DESLOCA_DIR: DINT:=0; DESLOCA_ESQ: DINT:=0; VELOCIDADE_DIR: DINT:=0; VELOCIDADE_ESQ: DINT:=0; END_VAR 'LD' BODY WORKSPACE NETWORK_LIST_TYPE := NWTYPELD ; ACTIVE_NETWORK := 0 ; END_WORKSPACE NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 17 ; NETWORK_BODY B(B_CONTACT,,M102,5,3,7,5,); B(B_CONTACT,,M202,5,6,7,8,); B(B_CONTACT,,M8011,12,3,14,5,); B(B_COIL,,M8,19,3,21,5,); B(B_CONTACT,,M302,5,9,7,11,); B(B_CONTACT,,M402,5,12,7,14,); L(1,4,5,4); L(1,7,5,7); L(7,4,12,4); L(14,4,19,4); L(10,4,10,7); L(7,7,10,7); L(7,10,10,10); L(10,7,10,10); L(1,10,5,10); L(1,0,1,17); L(7,13,10,13); L(10,10,10,13); L(1,13,5,13); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 41 ; NETWORK_BODY B(B_CONTACT,,M102,5,3,7,5,N); B(B_CONTACT,,M202,10,3,12,5,N); B(B_CONTACT,,M302,15,3,17,5,N); B(B_CONTACT,,M402,20,3,22,5,N); B(B_CONTACT,,M8011,27,3,29,5,); B(B_VARIN,,0,35,4,37,6,); B(B_VAROUT,,DESLOCA_DIR,44,4,46,6,); B(B_F,DMOVP_M,,37,2,44,6,); B(B_VARIN,,0,35,20,37,22,); B(B_VAROUT,,VELOCIDADE_ESQ,44,20,46,22,); B(B_F,DMOVP_M,,37,18,44,22,); B(B_VARIN,,0,35,15,37,17,); B(B_VAROUT,,VELOCIDADE_DIR,44,15,46,17,); B(B_F,DMOVP_M,,37,13,44,17,); B(B_VARIN,,0,35,9,37,11,); B(B_VAROUT,,DESLOCA_ESQ,44,9,46,11,); B(B_F,DMOVP_M,,37,7,44,11,); B(B_VARIN,,0,35,25,37,27,); B(B_VARIN,,0,35,26,37,28,); B(B_VARIN,,26,35,27,37,29,); B(B_VARIN,,1,35,28,37,30,); B(B_F,DTOP_M,,37,23,44,30,); B(B_VARIN,,0,35,35,37,37,); B(B_VARIN,,1,35,36,37,38,); B(B_VARIN,,26,35,37,37,39,); B(B_VARIN,,1,35,38,37,40,); B(B_F,DTOP_M,,37,33,44,40,); L(1,4,5,4); L(7,4,10,4); L(12,4,15,4); L(17,4,20,4); L(22,4,27,4); L(32,4,32,8); L(32,8,32,12); L(32,12,32,20); L(32,20,37,20); L(32,9,37,9); L(32,15,37,15); L(32,4,37,4); L(29,4,32,4); L(1,0,1,41); L(32,20,32,25); L(32,25,37,25); L(32,25,32,35); L(32,35,37,35); END_NETWORK_BODY END_NET_WORK END_BODY END_PROGRAM PROGRAM DIREITA VAR_EXTERNAL DIREITA: BOOL:=FALSE; VELOCIDADE_DIR: DINT:=0; DESLOCA_DIR: DINT:=0; VELOCIDADE_ESQ: DINT:=0; DESLOCA_ESQ: DINT:=0; POS_ACTUAL_DIR: DINT:=0; END_VAR 'LD' BODY WORKSPACE NETWORK_LIST_TYPE := NWTYPELD ; ACTIVE_NETWORK := 5 ; END_WORKSPACE NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 6 ; NETWORK_BODY B(B_VAROUT,,M400,15,2,17,4,); B(B_F,PLS_M,,9,0,15,4,); B(B_COMMENT,,activaçao do pulso para activar a memoria.,29,1,40,4,); B(B_CONTACT,,DIREITA,4,1,6,3,); L(1,0,1,6); L(6,2,9,2); L(1,2,4,2); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 7 ; NETWORK_BODY B(B_CONTACT,,M400,4,2,6,4,); B(B_COIL,,M402,22,2,24,4,S); L(1,3,4,3); L(6,3,22,3); L(1,0,1,7); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 20 ; NETWORK_BODY B(B_CONTACT,,M402,4,2,6,4,); B(B_VARIN,,0,13,3,15,5,); B(B_VARIN,,1,13,4,15,6,); B(B_VARIN,,26,13,5,15,7,); B(B_VARIN,,1,13,6,15,8,); B(B_F,DTOP_M,,15,1,22,8,); B(B_VARIN,,0,13,11,15,13,); B(B_VARIN,,0,13,12,15,14,); B(B_VARIN,,26,13,13,15,15,); B(B_VARIN,,1,13,14,15,16,); B(B_F,DTOP_M,,15,9,22,16,); L(1,3,4,3); L(1,0,1,20); L(6,3,15,3); L(8,3,8,11); L(8,11,15,11); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 25 ; NETWORK_BODY B(B_CONTACT,,M402,4,2,6,4,); B(B_VARIN,,0,16,3,18,5,); B(B_VARIN,,POS_ACTUAL_DIR,16,4,18,6,); B(B_F,EQ_E-2,,18,1,23,6,); B(B_VARIN,,-1500,16,12,18,14,); B(B_VARIN,,POS_ACTUAL_DIR,16,13,18,15,); B(B_F,EQ_E-2,,18,10,23,15,); B(B_VARIN,,0,33,21,35,23,); B(B_VAROUT,,DESLOCA_ESQ,42,21,44,23,); B(B_F,DMOVP_M,,35,19,42,23,); B(B_VARIN,,0,33,16,35,18,); B(B_VAROUT,,VELOCIDADE_ESQ,42,16,44,18,); B(B_F,DMOVP_M,,35,14,42,18,); B(B_VARIN,,-750,33,10,35,12,); B(B_VAROUT,,DESLOCA_DIR,42,10,44,12,); B(B_F,DMOVP_M,,35,8,42,12,); B(B_VARIN,,400,33,4,35,6,); B(B_VAROUT,,VELOCIDADE_DIR,42,4,44,6,); B(B_F,DMOVP_M,,35,2,42,6,); B(B_COMMENT,,atribuiçao de valores da velocidade e do sentido de rotaçao dos motores. O valor do deslocamento introduzido corresponde a 1/100 de volta.,54,3,66,20,); L(1,3,4,3); L(6,3,18,3); L(8,3,8,12); L(8,12,18,12); L(1,0,1,25); L(23,4,35,4); L(27,4,27,10); L(27,10,35,10); L(27,10,27,16); L(27,16,35,16); L(27,16,27,21); L(27,21,35,21); L(23,13,25,13); L(25,4,25,13); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 23 ; NETWORK_BODY B(B_CONTACT,,M402,4,2,6,4,); B(B_VARIN,,400,29,4,31,6,); B(B_VAROUT,,VELOCIDADE_DIR,38,4,40,6,); B(B_F,DMOV_M,,31,2,38,6,); B(B_VARIN,,-750,29,9,31,11,); B(B_VAROUT,,DESLOCA_DIR,38,9,40,11,); B(B_F,DMOV_M,,31,7,38,11,); B(B_VARIN,,400,29,14,31,16,); B(B_VAROUT,,VELOCIDADE_ESQ,38,14,40,16,); B(B_F,DMOV_M,,31,12,38,16,); B(B_VARIN,,-750,29,19,31,21,); B(B_VAROUT,,DESLOCA_ESQ,38,19,40,21,); B(B_F,DMOV_M,,31,17,38,21,); B(B_VARIN,,-750,13,3,15,5,); B(B_VARIN,,POS_ACTUAL_DIR,13,4,15,6,); B(B_F,EQ_E-2,,15,1,20,6,); B(B_COMMENT,,atribuiçao de valores da velocidade e do sentido de rotaçao dos motores. O valor do deslocamento introduzido corresponde a 1/100 de volta.,54,2,66,19,); L(1,0,1,23); L(1,3,4,3); L(6,3,15,3); L(20,4,31,4); L(23,4,23,9); L(23,9,31,9); L(23,9,23,14); L(23,14,31,14); L(23,14,23,19); L(23,19,31,19); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 31 ; NETWORK_BODY B(B_CONTACT,,M402,4,2,6,4,); B(B_VARIN,,-2250,14,3,16,5,); B(B_VARIN,,POS_ACTUAL_DIR,14,4,16,6,); B(B_F,EQ_E-2,,16,1,21,6,); B(B_COMMENT,,quando se verificar a igualdade entre a posição actual do motor da direita com 2250 faz e reset a M402 e escreve 0 no endereço 26 das cartas 0 e 1 da rack,60,5,71,24,); B(B_COIL,,M402,33,3,35,5,E); B(B_VARIN,,0,25,7,27,9,); B(B_VARIN,,1,25,8,27,10,); B(B_VARIN,,26,25,9,27,11,); B(B_VARIN,,1,25,10,27,12,); B(B_F,DTOP_M,,27,5,34,12,); B(B_VARIN,,0,25,17,27,19,); B(B_VARIN,,0,25,18,27,20,); B(B_VARIN,,26,25,19,27,21,); B(B_VARIN,,1,25,20,27,22,); B(B_F,DTOP_M,,27,15,34,22,); L(1,0,1,31); L(1,3,4,3); L(6,3,16,3); L(21,4,33,4); L(23,4,23,7); L(23,7,27,7); L(23,7,23,17); L(23,17,27,17); END_NETWORK_BODY END_NET_WORK END_BODY END_PROGRAM PROGRAM ESQUERDA VAR_EXTERNAL VELOCIDADE_DIR: DINT:=0; DESLOCA_DIR: DINT:=0; VELOCIDADE_ESQ: DINT:=0; DESLOCA_ESQ: DINT:=0; ESQUERDA: BOOL:=FALSE; POS_ACTUAL_ESQ: DINT:=0; END_VAR 'LD' BODY WORKSPACE NETWORK_LIST_TYPE := NWTYPELD ; ACTIVE_NETWORK := 1 ; END_WORKSPACE NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 6 ; NETWORK_BODY B(B_VAROUT,,M300,15,2,17,4,); B(B_F,PLS_M,,9,0,15,4,); B(B_COMMENT,,activaçao do pulso para activar a memoria.,29,1,40,4,); B(B_CONTACT,,ESQUERDA,4,1,6,3,); L(1,0,1,6); L(6,2,9,2); L(1,2,4,2); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 5 ; NETWORK_BODY B(B_CONTACT,,M300,4,2,6,4,); B(B_COIL,,M302,16,2,18,4,S); L(1,3,4,3); L(6,3,16,3); L(1,0,1,5); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 19 ; NETWORK_BODY B(B_CONTACT,,M302,5,2,7,4,); B(B_VARIN,,0,13,13,15,15,); B(B_VARIN,,1,13,14,15,16,); B(B_VARIN,,26,13,15,15,17,); B(B_VARIN,,1,13,16,15,18,); B(B_F,DTOP_M,,15,11,22,18,); B(B_VARIN,,0,13,3,15,5,); B(B_VARIN,,0,13,4,15,6,); B(B_VARIN,,26,13,5,15,7,); B(B_VARIN,,1,13,6,15,8,); B(B_F,DTOP_M,,15,1,22,8,); L(1,0,1,19); L(1,3,5,3); L(7,3,15,3); L(10,3,10,13); L(10,13,15,13); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 22 ; NETWORK_BODY B(B_CONTACT,,M302,4,2,6,4,); B(B_COMMENT,,atribuiçao de valores da velocidade e do sentido de rotaçao dos motores. O valor do deslocamento introduzido corresponde a 1/100 de volta.,39,2,51,19,); B(B_VARIN,,0,7,3,9,5,); B(B_VARIN,,POS_ACTUAL_ESQ,7,4,9,6,); B(B_F,EQ_E-2,,9,1,14,6,); B(B_VARIN,,1500,7,10,9,12,); B(B_VARIN,,POS_ACTUAL_ESQ,7,11,9,13,); B(B_F,EQ_E-2,,9,8,14,13,); B(B_VARIN,,0,20,4,22,6,); B(B_VAROUT,,VELOCIDADE_DIR,29,4,31,6,); B(B_F,DMOV_M,,22,2,29,6,); B(B_VARIN,,0,20,9,22,11,); B(B_VAROUT,,DESLOCA_DIR,29,9,31,11,); B(B_F,DMOV_M,,22,7,29,11,); B(B_VARIN,,400,20,14,22,16,); B(B_VAROUT,,VELOCIDADE_ESQ,29,14,31,16,); B(B_F,DMOV_M,,22,12,29,16,); B(B_VARIN,,750,20,19,22,21,); B(B_VAROUT,,DESLOCA_ESQ,29,19,31,21,); B(B_F,DMOV_M,,22,17,29,21,); L(1,3,4,3); L(1,0,1,22); L(6,3,9,3); L(7,3,7,10); L(7,10,9,10); L(14,4,22,4); L(14,11,17,11); L(17,4,17,11); L(19,4,19,9); L(19,9,22,9); L(19,9,19,14); L(19,14,22,14); L(19,14,19,19); L(19,19,22,19); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 23 ; NETWORK_BODY B(B_CONTACT,,M302,4,2,6,4,); B(B_COMMENT,,atribuiçao de valores da velocidade e do sentido de rotaçao dos motores. O valor do deslocamento introduzido corresponde a 1/100 de volta.,42,2,54,19,); B(B_VARIN,,750,9,3,11,5,); B(B_VARIN,,POS_ACTUAL_ESQ,9,4,11,6,); B(B_F,EQ_E-2,,11,1,16,6,); B(B_VARIN,,400,20,4,22,6,); B(B_VAROUT,,VELOCIDADE_DIR,29,4,31,6,); B(B_F,DMOV_M,,22,2,29,6,); B(B_VARIN,,750,20,9,22,11,); B(B_VAROUT,,DESLOCA_DIR,29,9,31,11,); B(B_F,DMOV_M,,22,7,29,11,); B(B_VARIN,,400,20,14,22,16,); B(B_VAROUT,,VELOCIDADE_ESQ,29,14,31,16,); B(B_F,DMOV_M,,22,12,29,16,); B(B_VARIN,,750,20,20,22,22,); B(B_VAROUT,,DESLOCA_ESQ,29,20,31,22,); B(B_F,DMOV_M,,22,18,29,22,); L(1,3,4,3); L(6,3,11,3); L(1,0,1,23); L(16,4,22,4); L(18,4,18,9); L(18,9,22,9); L(18,9,18,14); L(18,14,22,14); L(18,14,18,20); L(18,20,22,20); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 23 ; NETWORK_BODY B(B_COIL,,M302,25,3,27,5,E); B(B_VARIN,,2250,11,3,13,5,); B(B_VARIN,,POS_ACTUAL_ESQ,11,4,13,6,); B(B_F,EQ_E-2,,13,1,18,6,); B(B_VARIN,,0,24,9,26,11,); B(B_VARIN,,0,24,10,26,12,); B(B_VARIN,,26,24,11,26,13,); B(B_VARIN,,1,24,12,26,14,); B(B_F,DTOP_M,,26,7,33,14,); B(B_VARIN,,0,24,18,26,20,); B(B_VARIN,,1,24,19,26,21,); B(B_VARIN,,26,24,20,26,22,); B(B_VARIN,,1,24,21,26,23,); B(B_F,DTOP_M,,26,16,33,23,); B(B_CONTACT,,M302,4,2,6,4,); L(18,4,25,4); L(1,0,1,23); L(6,3,13,3); L(1,3,4,3); L(20,4,20,9); L(20,9,26,9); L(20,9,20,18); L(20,18,26,18); END_NETWORK_BODY END_NET_WORK END_BODY END_PROGRAM PROGRAM FRENTE VAR_EXTERNAL FRENTE: BOOL:=FALSE; VELOCIDADE_DIR: DINT:=0; DESLOCA_DIR: DINT:=0; VELOCIDADE_ESQ: DINT:=0; DESLOCA_ESQ: DINT:=0; END_VAR 'LD' BODY WORKSPACE NETWORK_LIST_TYPE := NWTYPELD ; ACTIVE_NETWORK := 0 ; END_WORKSPACE NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 6 ; NETWORK_BODY B(B_COMMENT,,activaçao do pulso para activar a memoria.,29,1,40,4,); B(B_CONTACT,,FRENTE,4,1,6,3,); B(B_VAROUT,,M102,17,2,19,4,); B(B_F,ALTP_M,,10,0,17,4,); L(1,0,1,6); L(1,2,4,2); L(6,2,10,2); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 21 ; NETWORK_BODY B(B_VARIN,,750,9,8,11,10,); B(B_VAROUT,,DESLOCA_DIR,18,8,20,10,); B(B_F,DMOV_M,,11,6,18,10,); B(B_VARIN,,400,9,3,11,5,); B(B_VAROUT,,VELOCIDADE_DIR,18,3,20,5,); B(B_F,DMOV_M,,11,1,18,5,); B(B_VARIN,,400,9,13,11,15,); B(B_VAROUT,,VELOCIDADE_ESQ,18,13,20,15,); B(B_F,DMOV_M,,11,11,18,15,); B(B_VARIN,,-750,9,18,11,20,); B(B_VAROUT,,DESLOCA_ESQ,18,18,20,20,); B(B_F,DMOV_M,,11,16,18,20,); B(B_CONTACT,,M102,4,2,6,4,); B(B_COMMENT,,atribuiçao de valores da velocidade e do sentido de rotaçao dos motores. O valor do deslocamento introduzido corresponde a 1/100 de volta.,32,2,44,19,); L(1,0,1,21); L(1,3,4,3); L(6,3,11,3); L(7,3,7,8); L(7,8,11,8); L(7,8,7,13); L(7,13,11,13); L(7,13,7,18); L(7,18,11,18); END_NETWORK_BODY END_NET_WORK END_BODY END_PROGRAM PROGRAM MOTOR_DIR VAR_EXTERNAL VELOCIDADE_DIR: DINT:=0; DESLOCA_DIR: DINT:=0; FRENTE: BOOL:=FALSE; POS_ACTUAL_DIR: DINT:=0; END_VAR 'LD' BODY WORKSPACE NETWORK_LIST_TYPE := NWTYPELD ; ACTIVE_NETWORK := 0 ; END_WORKSPACE NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 5 ; NETWORK_BODY B(B_CONTACT,,M8000,4,2,6,4,); B(B_COIL,,M7,14,2,16,4,); B(B_COMMENT,,activa a memoria M7 - relative/absolute position,25,2,41,4,); L(6,3,14,3); L(1,3,4,3); L(1,0,1,5); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 32 ; NETWORK_BODY B(B_CONTACT,,M8000,4,1,6,3,); B(B_VARIN,,H2102,14,2,16,4,); B(B_VARIN,,1,14,3,16,5,); B(B_VARIN,,3,14,4,16,6,); B(B_VARIN,,1,14,5,16,7,); B(B_F,TO_M,,16,0,21,7,); B(B_VARIN,,1000,14,10,16,12,); B(B_VARIN,,1,14,11,16,13,); B(B_VARIN,,4,14,12,16,14,); B(B_VARIN,,1,14,13,16,15,); B(B_F,DTO_M,,16,8,22,15,); B(B_VARIN,,2000,14,26,16,28,); B(B_VARIN,,1,14,27,16,29,); B(B_VARIN,,15,14,28,16,30,); B(B_VARIN,,1,14,29,16,31,); B(B_F,TO_M,,16,24,21,31,); B(B_COMMENT,,definiçao da velocidade maxima.,25,9,43,12,); B(B_COMMENT,,definiçao do tempo de aceleraçao/desaceleraçao,25,25,44,27,); B(B_COMMENT,,parametrizaçao da Vbias,25,18,44,20,); B(B_COMMENT,,definiçao dos parametros do endereço 3 (H2002 - codigo hexadecimal resultante da parametrizaçao),25,2,43,7,); B(B_VARIN,,0,14,18,16,20,); B(B_VARIN,,1,14,19,16,21,); B(B_VARIN,,6,14,20,16,22,); B(B_VARIN,,1,14,21,16,23,); B(B_F,TO_M,,16,16,21,23,); L(6,2,16,2); L(1,2,4,2); L(9,2,9,10); L(9,10,16,10); L(9,10,9,18); L(1,0,1,32); L(9,18,9,26); L(9,26,16,26); L(9,18,16,18); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 16 ; NETWORK_BODY B(B_CONTACT,,M8000,5,1,7,3,); B(B_VARIN,,DESLOCA_DIR,14,2,16,4,); B(B_VARIN,,1,14,3,16,5,); B(B_VARIN,,17,14,4,16,6,); B(B_VARIN,,1,14,5,16,7,); B(B_F,DTO_M,,16,0,22,7,); B(B_VARIN,,VELOCIDADE_DIR,14,10,16,12,); B(B_VARIN,,1,14,11,16,13,); B(B_VARIN,,19,14,12,16,14,); B(B_VARIN,,1,14,13,16,15,); B(B_F,DTO_M,,16,8,22,15,); B(B_COMMENT,,envio de informaçao (sentido e velocidade) para os respectivos endereços~ 17 e 19.,25,3,42,9,); L(1,2,5,2); L(1,0,1,16); L(9,2,9,10); L(9,10,16,10); L(9,2,16,2); L(7,2,9,2); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 10 ; NETWORK_BODY B(B_VARIN,,K4M0,14,4,16,6,); B(B_VARIN,,1,14,5,16,7,); B(B_VARIN,,25,14,6,16,8,); B(B_VARIN,,1,14,7,16,9,); B(B_F,TO_M,,16,2,21,9,); B(B_CONTACT,,M8000,5,3,7,5,); L(1,0,1,10); L(1,4,5,4); L(7,4,16,4); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 8 ; NETWORK_BODY B(B_CONTACT,,M8000,4,2,6,4,); B(B_VARIN,,1,10,3,12,5,); B(B_VARIN,,26,10,4,12,6,); B(B_VARIN,,1,10,5,12,7,); B(B_VAROUT,,POS_ACTUAL_DIR,19,3,21,5,); B(B_F,DFROM_M,,12,1,19,7,); L(1,0,1,8); L(1,3,4,3); L(6,3,12,3); END_NETWORK_BODY END_NET_WORK END_BODY END_PROGRAM PROGRAM MOTOR_ESQ VAR_EXTERNAL VELOCIDADE_ESQ: DINT:=0; DESLOCA_ESQ: DINT:=0; FRENTE: BOOL:=FALSE; POS_ACTUAL_ESQ: DINT:=0; END_VAR 'LD' BODY WORKSPACE NETWORK_LIST_TYPE := NWTYPELD ; ACTIVE_NETWORK := 0 ; END_WORKSPACE NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 5 ; NETWORK_BODY B(B_CONTACT,,M8000,4,2,6,4,); B(B_COIL,,M7,14,2,16,4,); B(B_COMMENT,,activa a memoria M7 - relative/absolute position,25,2,41,4,); L(6,3,14,3); L(1,3,4,3); L(1,0,1,5); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 32 ; NETWORK_BODY B(B_CONTACT,,M8000,4,1,6,3,); B(B_VARIN,,H2102,14,2,16,4,); B(B_VARIN,,0,14,3,16,5,); B(B_VARIN,,3,14,4,16,6,); B(B_VARIN,,1,14,5,16,7,); B(B_F,TO_M,,16,0,21,7,); B(B_VARIN,,1000,14,10,16,12,); B(B_VARIN,,0,14,11,16,13,); B(B_VARIN,,4,14,12,16,14,); B(B_VARIN,,1,14,13,16,15,); B(B_F,DTO_M,,16,8,22,15,); B(B_VARIN,,0,14,18,16,20,); B(B_VARIN,,0,14,19,16,21,); B(B_VARIN,,6,14,20,16,22,); B(B_VARIN,,1,14,21,16,23,); B(B_F,TO_M,,16,16,21,23,); B(B_VARIN,,2000,14,26,16,28,); B(B_VARIN,,0,14,27,16,29,); B(B_VARIN,,15,14,28,16,30,); B(B_VARIN,,1,14,29,16,31,); B(B_F,TO_M,,16,24,21,31,); B(B_COMMENT,,definiçao da velocidade maxima.,25,9,43,12,); B(B_COMMENT,,definiçao do tempo de aceleraçao/desaceleraçao,25,25,44,27,); B(B_COMMENT,,parametrizaçao da Vbias,25,18,44,20,); B(B_COMMENT,,definiçao dos parametros do endereço 3 (H2102 - codigo hexadecimal resultante da parametrizaçao),25,2,43,7,); L(6,2,16,2); L(1,2,4,2); L(9,2,9,10); L(9,10,16,10); L(9,10,9,18); L(9,18,16,18); L(1,0,1,32); L(9,18,9,26); L(9,26,16,26); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 16 ; NETWORK_BODY B(B_CONTACT,,M8000,5,1,7,3,); B(B_VARIN,,DESLOCA_ESQ,14,2,16,4,); B(B_VARIN,,0,14,3,16,5,); B(B_VARIN,,17,14,4,16,6,); B(B_VARIN,,1,14,5,16,7,); B(B_F,DTO_M,,16,0,22,7,); B(B_VARIN,,VELOCIDADE_ESQ,14,10,16,12,); B(B_VARIN,,0,14,11,16,13,); B(B_VARIN,,19,14,12,16,14,); B(B_VARIN,,1,14,13,16,15,); B(B_F,DTO_M,,16,8,22,15,); B(B_COMMENT,,envio de informaçao (sentido e velocidade) para os respectivos endereços~ 17 e 19.,25,3,42,9,); L(7,2,16,2); L(1,2,5,2); L(1,0,1,16); L(9,2,9,10); L(9,10,16,10); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 10 ; NETWORK_BODY B(B_VARIN,,K4M0,14,4,16,6,); B(B_VARIN,,0,14,5,16,7,); B(B_VARIN,,25,14,6,16,8,); B(B_VARIN,,1,14,7,16,9,); B(B_F,TO_M,,16,2,21,9,); B(B_CONTACT,,M8000,5,3,7,5,); B(B_COMMENT,,escreve M0,25,2,38,7,); L(1,0,1,10); L(1,4,5,4); L(7,4,16,4); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 8 ; NETWORK_BODY B(B_CONTACT,,M8000,4,2,6,4,); B(B_VARIN,,0,10,3,12,5,); B(B_VARIN,,26,10,4,12,6,); B(B_VARIN,,1,10,5,12,7,); B(B_VAROUT,,POS_ACTUAL_ESQ,19,3,21,5,); B(B_F,DFROM_M,,12,1,19,7,); L(1,0,1,8); L(1,3,4,3); L(6,3,12,3); END_NETWORK_BODY END_NET_WORK END_BODY END_PROGRAM PROGRAM OBSTACULOS VAR_EXTERNAL POS_ACTUAL_ESQ: DINT:=0; T_COIL: BOOL:=FALSE; T_SAIDA: BOOL:=FALSE; END_VAR 'LD' BODY WORKSPACE NETWORK_LIST_TYPE := NWTYPELD ; ACTIVE_NETWORK := 2 ; END_WORKSPACE NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 15 ; NETWORK_BODY B(B_CONTACT,,X3,5,2,7,4,); B(B_CONTACT,,M102,10,2,12,4,); B(B_COIL,,M104,29,9,31,11,S); B(B_COIL,,M102,29,12,31,14,E); B(B_COIL,,M106,29,2,31,4,S); L(1,3,5,3); L(7,3,10,3); L(14,3,14,7); L(14,7,14,10); L(14,10,29,10); L(14,13,29,13); L(14,10,14,13); L(1,0,1,15); L(12,3,14,3); L(14,3,29,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 8 ; NETWORK_BODY B(B_CONTACT,,M106,5,2,7,4,); B(B_VARIN,,T_COIL,22,3,24,5,); B(B_VARIN,,10,22,4,24,6,); B(B_F,TIMER_M,,24,1,31,6,); L(1,0,1,8); L(7,3,24,3); L(1,3,5,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 8 ; NETWORK_BODY B(B_CONTACT,,T_SAIDA,5,2,7,4,); B(B_COIL,,M202,25,2,27,4,S); B(B_COIL,,M106,25,5,27,7,E); L(1,3,5,3); L(7,3,25,3); L(1,0,1,8); L(13,3,13,6); L(13,6,25,6); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 9 ; NETWORK_BODY B(B_CONTACT,,M202,5,2,7,4,); B(B_CONTACT,,M104,11,2,13,4,); B(B_VARIN,,745,17,3,19,5,); B(B_VARIN,,POS_ACTUAL_ESQ,17,4,19,6,); B(B_F,EQ_E-2,,19,1,24,6,); B(B_COIL,,M202,30,3,32,5,E); B(B_COIL,,M105,30,6,32,8,); L(24,4,30,4); L(1,3,5,3); L(7,3,11,3); L(13,3,19,3); L(27,7,30,7); L(27,4,27,7); L(1,0,1,9); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 15 ; NETWORK_BODY B(B_CONTACT,,M104,9,2,11,4,); B(B_CONTACT,,M202,14,2,16,4,N); B(B_CONTACT,,M8013,22,2,24,4,); B(B_CONTACT,,M8013,22,9,24,11,N); B(B_COIL,,M302,32,2,34,4,S); B(B_COIL,,M104,32,4,34,6,E); B(B_COIL,,M402,32,9,34,11,S); B(B_COIL,,M104,32,12,34,14,E); B(B_CONTACT,,M105,4,2,6,4,); L(11,3,14,3); L(16,3,22,3); L(24,3,32,3); L(28,3,28,5); L(28,5,32,5); L(19,3,19,10); L(19,10,22,10); L(28,10,28,13); L(28,13,32,13); L(28,10,32,10); L(24,10,28,10); L(6,3,9,3); L(1,3,4,3); L(1,0,1,15); END_NETWORK_BODY END_NET_WORK END_BODY END_PROGRAM PROGRAM TRAS VAR_EXTERNAL TRAS: BOOL:=FALSE; VELOCIDADE_DIR: DINT:=0; DESLOCA_DIR: DINT:=0; VELOCIDADE_ESQ: DINT:=0; DESLOCA_ESQ: DINT:=0; END_VAR 'LD' BODY WORKSPACE NETWORK_LIST_TYPE := NWTYPELD ; ACTIVE_NETWORK := 0 ; END_WORKSPACE NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 6 ; NETWORK_BODY B(B_COMMENT,,activaçao do pulso para activar a memoria.,29,1,40,4,); B(B_CONTACT,,TRAS,4,1,6,3,); B(B_VAROUT,,M202,19,2,21,4,); B(B_F,ALTP_M,,12,0,19,4,); L(1,0,1,6); L(1,2,4,2); L(6,2,12,2); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 21 ; NETWORK_BODY B(B_VARIN,,-750,9,8,11,10,); B(B_VAROUT,,DESLOCA_DIR,18,8,20,10,); B(B_F,DMOV_M,,11,6,18,10,); B(B_VARIN,,500,9,3,11,5,); B(B_VAROUT,,VELOCIDADE_DIR,18,3,20,5,); B(B_F,DMOV_M,,11,1,18,5,); B(B_VARIN,,500,9,13,11,15,); B(B_VAROUT,,VELOCIDADE_ESQ,18,13,20,15,); B(B_F,DMOV_M,,11,11,18,15,); B(B_VARIN,,750,9,18,11,20,); B(B_VAROUT,,DESLOCA_ESQ,18,18,20,20,); B(B_F,DMOV_M,,11,16,18,20,); B(B_CONTACT,,M202,4,2,6,4,); B(B_COMMENT,,atribuiçao de valores da velocidade e do sentido de rotaçao dos motores. O valor do deslocamento introduzido corresponde a 1/100 de volta.,32,2,44,19,); L(1,0,1,21); L(1,3,4,3); L(6,3,11,3); L(7,3,7,8); L(7,8,11,8); L(7,8,7,13); L(7,13,11,13); L(7,13,7,18); L(7,18,11,18); END_NETWORK_BODY END_NET_WORK END_BODY END_PROGRAM CONFIGURATION scConfiguration RESOURCE scResource ON scResourceType VAR_GLOBAL FRENTE AT %IX1: BOOL:=FALSE; TRAS AT %IX2: BOOL:=FALSE; VELOCIDADE_DIR AT %MD0.36: DINT:=0; DESLOCA_DIR AT %MD0.113: DINT:=0; VELOCIDADE_ESQ AT %MD0.38: DINT:=0; DESLOCA_ESQ AT %MD0.115: DINT:=0; ESQUERDA AT %IX4: BOOL:=FALSE; DIREITA AT %IX5: BOOL:=FALSE; POS_ACTUAL_DIR AT %MD0.0: DINT:=0; POS_ACTUAL_ESQ AT %MD0.5: DINT:=0; T_COIL AT %MX5.1: BOOL:=FALSE; T_ACTUAL AT %MW3.1: INT:=0; T_SAIDA AT %MX3.1: BOOL:=FALSE; END_VAR TASK (*CJ*) MECHEX(SINGLE:=TRUE, INTERVAL:=0, PRIORITY:=31) PROGRAM FRENTE WITH MECHEX: scProgramType PROGRAM ACTIV_PGU WITH MECHEX: scProgramType PROGRAM TRAS WITH MECHEX: scProgramType PROGRAM MOTOR_DIR WITH MECHEX: scProgramType PROGRAM MOTOR_ESQ WITH MECHEX: scProgramType PROGRAM ESQUERDA WITH MECHEX: scProgramType PROGRAM DIREITA WITH MECHEX: scProgramType PROGRAM OBSTACULOS WITH MECHEX: scProgramType END_RESOURCE END_CONFIGURATION