(*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; POS_ACTUAL_DIR: DINT:=0; 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 := 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 := 8 ; NETWORK_BODY B(B_VARIN,,1,5,3,7,5,); B(B_VARIN,,28,5,4,7,6,); B(B_VARIN,,1,5,5,7,7,); B(B_VAROUT,,K3M20,14,3,16,5,); B(B_F,FROM_M,,7,1,14,7,); L(1,0,1,8); L(1,3,7,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 42 ; NETWORK_BODY B(B_CONTACT,,M102,5,2,7,4,N); B(B_CONTACT,,M202,10,2,12,4,N); B(B_CONTACT,,M302,15,2,17,4,N); B(B_CONTACT,,M402,20,2,22,4,N); B(B_VARIN,,0,37,3,39,5,); B(B_VAROUT,,DESLOCA_DIR,46,3,48,5,); B(B_F,DMOVP_M,,39,1,46,5,); B(B_VARIN,,0,37,19,39,21,); B(B_VAROUT,,VELOCIDADE_ESQ,46,19,48,21,); B(B_F,DMOVP_M,,39,17,46,21,); B(B_VARIN,,0,37,14,39,16,); B(B_VAROUT,,VELOCIDADE_DIR,46,14,48,16,); B(B_F,DMOVP_M,,39,12,46,16,); B(B_VARIN,,0,37,8,39,10,); B(B_VAROUT,,DESLOCA_ESQ,46,8,48,10,); B(B_F,DMOVP_M,,39,6,46,10,); B(B_VARIN,,0,37,24,39,26,); B(B_VARIN,,0,37,25,39,27,); B(B_VARIN,,26,37,26,39,28,); B(B_VARIN,,1,37,27,39,29,); B(B_F,DTOP_M,,39,22,46,29,); B(B_VARIN,,0,37,34,39,36,); B(B_VARIN,,1,37,35,39,37,); B(B_VARIN,,26,37,36,39,38,); B(B_VARIN,,1,37,37,39,39,); B(B_F,DTOP_M,,39,32,46,39,); B(B_CONTACT,,M20,25,2,27,4,); B(B_CONTACT,,M8011,29,2,31,4,); L(1,3,5,3); L(7,3,10,3); L(12,3,15,3); L(17,3,20,3); L(34,3,34,7); L(34,7,34,11); L(34,11,34,19); L(34,19,39,19); L(34,8,39,8); L(34,14,39,14); L(34,3,39,3); L(34,19,34,24); L(34,24,39,24); L(34,24,34,34); L(34,34,39,34); L(22,3,25,3); L(1,0,1,42); L(31,3,34,3); L(27,3,29,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 9 ; NETWORK_BODY B(B_COIL,,Y0,53,3,55,5,S); B(B_VARIN,,0,39,3,41,5,); B(B_VARIN,,POS_ACTUAL_ESQ,39,4,41,6,); B(B_F,EQ_E-2,,41,1,46,6,); B(B_VARIN,,0,24,3,26,5,); B(B_VARIN,,POS_ACTUAL_DIR,24,4,26,6,); B(B_F,EQ_E-2,,26,1,31,6,); B(B_CONTACT,,M402,17,2,19,4,N); B(B_CONTACT,,M302,12,2,14,4,N); B(B_CONTACT,,M202,8,2,10,4,N); B(B_CONTACT,,M102,4,2,6,4,N); B(B_CONTACT,,M8011,48,3,50,5,); L(19,3,26,3); L(14,3,17,3); L(10,3,12,3); L(6,3,8,3); L(1,3,4,3); L(31,4,32,4); L(32,3,32,4); L(32,3,41,3); L(1,0,1,9); L(46,4,48,4); L(50,4,53,4); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 18 ; NETWORK_BODY B(B_F,EQ_E-2,,12,1,17,6,0000N); B(B_VARIN,,0,10,3,12,5,); B(B_VARIN,,POS_ACTUAL_DIR,10,4,12,6,); B(B_F,EQ_E-2,,12,10,17,15,0000N); B(B_VARIN,,0,10,12,12,14,); B(B_VARIN,,POS_ACTUAL_ESQ,10,13,12,15,); B(B_COIL,,Y0,53,3,55,5,E); B(B_CONTACT,,M202,25,7,27,9,); B(B_CONTACT,,M302,25,11,27,13,); B(B_CONTACT,,M402,25,15,27,17,); B(B_CONTACT,,M102,25,3,27,5,); L(1,3,12,3); L(1,12,12,12); L(21,4,21,8); L(21,8,25,8); L(21,8,21,12); L(21,12,25,12); L(21,12,21,16); L(21,16,25,16); L(17,13,19,13); L(19,4,19,13); L(27,8,35,8); L(35,4,35,8); L(27,12,35,12); L(35,8,35,12); L(27,16,35,16); L(35,12,35,16); L(35,4,53,4); L(1,0,1,18); L(17,4,21,4); L(27,4,35,4); L(21,4,25,4); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 27 ; NETWORK_BODY B(B_COIL,,M102,25,2,27,4,S); B(B_CONTACT,,M112,12,2,14,4,); B(B_COIL,,M202,25,14,27,16,S); B(B_CONTACT,,M109,17,14,19,16,); B(B_CONTACT,,M104,17,2,19,4,); B(B_COIL,,M112,25,6,27,8,E); B(B_COIL,,M112,25,19,27,21,E); B(B_COIL,,M104,25,9,27,11,E); B(B_COIL,,M109,25,23,27,25,E); B(B_CONTACT,,M302,4,2,6,4,N); B(B_CONTACT,,M402,8,2,10,4,N); L(14,3,17,3); L(15,3,15,15); L(15,15,17,15); L(21,3,21,7); L(21,7,25,7); L(21,15,21,20); L(21,20,25,20); L(19,15,21,15); L(21,15,25,15); L(19,3,21,3); L(21,3,25,3); L(21,20,21,24); L(21,24,25,24); L(21,7,21,10); L(21,10,25,10); L(1,0,1,27); L(1,3,4,3); L(6,3,8,3); L(10,3,12,3); 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; POS_ACTUAL_ESQ: DINT:=0; 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 := 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 := 12 ; NETWORK_BODY B(B_COIL,,M403,22,3,24,5,S); B(B_COIL,,M102,22,6,24,8,E); B(B_COIL,,M202,22,9,24,11,E); B(B_CONTACT,,M400,4,3,6,5,); B(B_CONTACT,,M303,9,3,11,5,N); L(15,4,22,4); L(15,4,15,7); L(15,7,22,7); L(15,7,15,10); L(15,10,22,10); L(1,4,4,4); L(11,4,15,4); L(6,4,9,4); L(1,0,1,12); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 9 ; NETWORK_BODY B(B_CONTACT,,M403,3,3,5,5,); B(B_VARIN,,POS_ACTUAL_DIR,15,4,17,6,); B(B_VARIN,,0,15,5,17,7,); B(B_F,EQ_E-2,,17,2,22,7,); B(B_VARIN,,POS_ACTUAL_ESQ,32,5,34,7,); B(B_VARIN,,0,32,6,34,8,); B(B_F,EQ_E-2,,34,3,39,8,); B(B_COIL,,M402,44,5,46,7,S); L(1,4,3,4); L(5,4,17,4); L(22,5,34,5); L(39,6,44,6); L(1,0,1,9); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 25 ; NETWORK_BODY B(B_CONTACT,,M402,9,2,11,4,); B(B_VARIN,,0,21,3,23,5,); B(B_VARIN,,POS_ACTUAL_DIR,21,4,23,6,); B(B_F,EQ_E-2,,23,1,28,6,); B(B_VARIN,,-1500,21,12,23,14,); B(B_VARIN,,POS_ACTUAL_DIR,21,13,23,15,); B(B_F,EQ_E-2,,23,10,28,15,); B(B_VARIN,,0,38,21,40,23,); B(B_VAROUT,,DESLOCA_ESQ,47,21,49,23,); B(B_F,DMOVP_M,,40,19,47,23,); B(B_VARIN,,0,38,16,40,18,); B(B_VAROUT,,VELOCIDADE_ESQ,47,16,49,18,); B(B_F,DMOVP_M,,40,14,47,18,); B(B_VARIN,,-750,38,10,40,12,); B(B_VAROUT,,DESLOCA_DIR,47,10,49,12,); B(B_F,DMOVP_M,,40,8,47,12,); B(B_VARIN,,400,38,4,40,6,); B(B_VAROUT,,VELOCIDADE_DIR,47,4,49,6,); B(B_F,DMOVP_M,,40,2,47,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.,59,3,71,20,); B(B_VARIN,,-2250,21,19,23,21,); B(B_VARIN,,POS_ACTUAL_DIR,21,20,23,22,); B(B_F,EQ_E-2,,23,17,28,22,); B(B_CONTACT,,M112,14,18,16,20,); B(B_CONTACT,,M112,14,11,16,13,N); L(11,3,23,3); L(28,4,40,4); L(32,4,32,10); L(32,10,40,10); L(32,10,32,16); L(32,16,40,16); L(32,16,32,21); L(32,21,40,21); L(28,13,30,13); L(30,4,30,13); L(30,13,30,20); L(28,20,30,20); L(16,12,23,12); L(16,19,23,19); L(12,12,14,12); L(12,3,12,12); L(12,19,14,19); L(12,12,12,19); L(1,0,1,25); L(1,3,9,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 23 ; NETWORK_BODY B(B_CONTACT,,M402,10,2,12,4,); B(B_VARIN,,400,35,4,37,6,); B(B_VAROUT,,VELOCIDADE_DIR,44,4,46,6,); B(B_F,DMOV_M,,37,2,44,6,); B(B_VARIN,,-750,35,9,37,11,); B(B_VAROUT,,DESLOCA_DIR,44,9,46,11,); B(B_F,DMOV_M,,37,7,44,11,); B(B_VARIN,,400,35,14,37,16,); B(B_VAROUT,,VELOCIDADE_ESQ,44,14,46,16,); B(B_F,DMOV_M,,37,12,44,16,); B(B_VARIN,,-750,35,19,37,21,); B(B_VAROUT,,DESLOCA_ESQ,44,19,46,21,); B(B_F,DMOV_M,,37,17,44,21,); B(B_VARIN,,-750,19,3,21,5,); B(B_VARIN,,POS_ACTUAL_DIR,19,4,21,6,); B(B_F,EQ_E-2,,21,1,26,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.,60,2,72,19,); L(12,3,21,3); L(26,4,37,4); L(29,4,29,9); L(29,9,37,9); L(29,9,29,14); L(29,14,37,14); L(29,14,29,19); L(29,19,37,19); L(1,0,1,23); L(1,3,10,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 31 ; NETWORK_BODY B(B_CONTACT,,M402,7,2,9,4,); B(B_VARIN,,-2250,17,3,19,5,); B(B_VARIN,,POS_ACTUAL_DIR,17,4,19,6,); B(B_F,EQ_E-2,,19,1,24,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,65,11,76,30,); B(B_COIL,,M402,38,3,40,5,E); B(B_VARIN,,0,30,13,32,15,); B(B_VARIN,,1,30,14,32,16,); B(B_VARIN,,26,30,15,32,17,); B(B_VARIN,,1,30,16,32,18,); B(B_F,DTOP_M,,32,11,39,18,); B(B_VARIN,,0,30,23,32,25,); B(B_VARIN,,0,30,24,32,26,); B(B_VARIN,,26,30,25,32,27,); B(B_VARIN,,1,30,26,32,28,); B(B_F,DTOP_M,,32,21,39,28,); B(B_CONTACT,,M112,12,2,14,4,N); B(B_VARIN,,-3000,17,16,19,18,); B(B_VARIN,,POS_ACTUAL_DIR,17,17,19,19,); B(B_F,EQ_E-2,,19,14,24,19,); B(B_CONTACT,,M112,12,15,14,17,); B(B_COIL,,M403,38,6,40,8,E); L(24,4,38,4); L(28,4,28,13); L(28,13,32,13); L(28,13,28,23); L(28,23,32,23); L(9,3,12,3); L(14,3,19,3); L(25,4,25,17); L(24,17,25,17); L(14,16,19,16); L(10,3,10,16); L(10,16,12,16); L(33,4,33,7); L(33,7,38,7); L(1,0,1,31); L(1,3,7,3); 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; POS_ACTUAL_DIR: DINT:=0; 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 := 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 := 12 ; NETWORK_BODY B(B_COIL,,M303,16,2,18,4,S); B(B_COIL,,M202,16,9,18,11,E); B(B_COIL,,M102,16,5,18,7,E); B(B_CONTACT,,M403,8,2,10,4,N); B(B_CONTACT,,M300,4,2,6,4,); L(12,3,16,3); L(12,3,12,6); L(12,6,12,10); L(12,10,16,10); L(12,6,16,6); L(10,3,12,3); L(6,3,8,3); L(1,3,4,3); L(1,0,1,12); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 10 ; NETWORK_BODY B(B_CONTACT,,M303,3,3,5,5,); B(B_VARIN,,POS_ACTUAL_DIR,15,4,17,6,); B(B_VARIN,,0,15,5,17,7,); B(B_F,EQ_E-2,,17,2,22,7,); B(B_VARIN,,POS_ACTUAL_ESQ,32,5,34,7,); B(B_VARIN,,0,32,6,34,8,); B(B_F,EQ_E-2,,34,3,39,8,); B(B_COIL,,M302,44,5,46,7,S); L(1,4,3,4); L(5,4,17,4); L(22,5,34,5); L(39,6,44,6); L(1,0,1,10); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 19 ; NETWORK_BODY B(B_CONTACT,,M302,8,2,10,4,); B(B_VARIN,,0,16,13,18,15,); B(B_VARIN,,1,16,14,18,16,); B(B_VARIN,,26,16,15,18,17,); B(B_VARIN,,1,16,16,18,18,); B(B_F,DTOP_M,,18,11,25,18,); B(B_VARIN,,0,16,3,18,5,); B(B_VARIN,,0,16,4,18,6,); B(B_VARIN,,26,16,5,18,7,); B(B_VARIN,,1,16,6,18,8,); B(B_F,DTOP_M,,18,1,25,8,); L(10,3,18,3); L(13,3,13,13); L(13,13,18,13); L(1,0,1,19); L(1,3,8,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 22 ; NETWORK_BODY B(B_CONTACT,,M302,8,2,10,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.,53,2,65,19,); B(B_VARIN,,0,21,3,23,5,); B(B_VARIN,,POS_ACTUAL_ESQ,21,4,23,6,); B(B_F,EQ_E-2,,24,1,29,6,); B(B_VARIN,,1500,21,10,23,12,); B(B_VARIN,,POS_ACTUAL_ESQ,21,11,23,13,); B(B_F,EQ_E-2,,24,8,29,13,); B(B_VARIN,,0,34,4,36,6,); B(B_VAROUT,,VELOCIDADE_DIR,43,4,45,6,); B(B_F,DMOV_M,,36,2,43,6,); B(B_VARIN,,0,34,9,36,11,); B(B_VAROUT,,DESLOCA_DIR,43,9,45,11,); B(B_F,DMOV_M,,36,7,43,11,); B(B_VARIN,,400,34,14,36,16,); B(B_VAROUT,,VELOCIDADE_ESQ,43,14,45,16,); B(B_F,DMOV_M,,36,12,43,16,); B(B_VARIN,,750,34,19,36,21,); B(B_VAROUT,,DESLOCA_ESQ,43,19,45,21,); B(B_F,DMOV_M,,36,17,43,21,); B(B_CONTACT,,M111,14,9,16,11,N); B(B_VARIN,,2250,22,16,24,18,); B(B_VARIN,,POS_ACTUAL_ESQ,22,17,24,19,); B(B_F,EQ_E-2,,24,14,29,19,); B(B_CONTACT,,M111,14,15,16,17,); L(10,3,24,3); L(29,4,36,4); L(29,11,31,11); L(31,4,31,11); L(33,4,33,9); L(33,9,36,9); L(33,9,33,14); L(33,14,36,14); L(33,14,33,19); L(33,19,36,19); L(23,4,24,4); L(23,5,24,5); L(23,11,24,11); L(23,12,24,12); L(16,10,24,10); L(11,3,11,10); L(11,10,14,10); L(16,16,24,16); L(11,16,14,16); L(11,10,11,16); L(31,11,31,17); L(29,17,31,17); L(1,0,1,22); L(1,3,8,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 23 ; NETWORK_BODY B(B_CONTACT,,M302,9,2,11,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.,47,2,59,19,); B(B_VARIN,,750,14,3,16,5,); B(B_VARIN,,POS_ACTUAL_ESQ,14,4,16,6,); B(B_F,EQ_E-2,,16,1,21,6,); B(B_VARIN,,400,25,4,27,6,); B(B_VAROUT,,VELOCIDADE_DIR,34,4,36,6,); B(B_F,DMOV_M,,27,2,34,6,); B(B_VARIN,,750,25,9,27,11,); B(B_VAROUT,,DESLOCA_DIR,34,9,36,11,); B(B_F,DMOV_M,,27,7,34,11,); B(B_VARIN,,400,25,14,27,16,); B(B_VAROUT,,VELOCIDADE_ESQ,34,14,36,16,); B(B_F,DMOV_M,,27,12,34,16,); B(B_VARIN,,750,25,20,27,22,); B(B_VAROUT,,DESLOCA_ESQ,34,20,36,22,); B(B_F,DMOV_M,,27,18,34,22,); L(11,3,16,3); L(21,4,27,4); L(23,4,23,9); L(23,9,27,9); L(23,9,23,14); L(23,14,27,14); L(23,14,23,20); L(23,20,27,20); L(1,0,1,23); L(1,3,9,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 30 ; NETWORK_BODY B(B_COIL,,M302,39,3,41,5,E); B(B_VARIN,,2250,25,3,27,5,); B(B_VARIN,,POS_ACTUAL_ESQ,25,4,27,6,); B(B_F,EQ_E-2,,27,1,32,6,); B(B_VARIN,,0,38,14,40,16,); B(B_VARIN,,0,38,15,40,17,); B(B_VARIN,,26,38,16,40,18,); B(B_VARIN,,1,38,17,40,19,); B(B_F,DTOP_M,,40,12,47,19,); B(B_VARIN,,0,38,23,40,25,); B(B_VARIN,,1,38,24,40,26,); B(B_VARIN,,26,38,25,40,27,); B(B_VARIN,,1,38,26,40,28,); B(B_F,DTOP_M,,40,21,47,28,); B(B_CONTACT,,M302,9,2,11,4,); B(B_CONTACT,,M112,15,2,17,4,N); B(B_VARIN,,3000,25,14,27,16,); B(B_VARIN,,POS_ACTUAL_ESQ,25,15,27,17,); B(B_F,EQ_E-2,,27,12,32,17,); B(B_CONTACT,,M112,15,13,17,15,); B(B_COIL,,M303,39,7,41,9,E); L(32,4,39,4); L(34,4,34,14); L(34,14,40,14); L(34,14,34,23); L(34,23,40,23); L(17,3,27,3); L(11,3,15,3); L(33,4,33,15); L(32,15,33,15); L(17,14,27,14); L(13,14,15,14); L(13,3,13,14); L(36,4,36,8); L(36,8,39,8); L(1,0,1,30); L(1,3,9,3); 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 := 12 ; 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,); B(B_F,PLS_M,,12,5,18,9,); B(B_COIL,,M202,22,7,24,9,E); L(1,2,4,2); L(6,2,10,2); L(1,0,1,12); L(8,2,8,7); L(8,7,12,7); L(18,8,22,8); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 21 ; NETWORK_BODY B(B_VARIN,,750,21,8,23,10,); B(B_VAROUT,,DESLOCA_DIR,30,8,32,10,); B(B_F,DMOV_M,,23,6,30,10,); B(B_VARIN,,400,21,3,23,5,); B(B_VAROUT,,VELOCIDADE_DIR,30,3,32,5,); B(B_F,DMOV_M,,23,1,30,5,); B(B_VARIN,,400,21,13,23,15,); B(B_VAROUT,,VELOCIDADE_ESQ,30,13,32,15,); B(B_F,DMOV_M,,23,11,30,15,); B(B_VARIN,,-750,21,18,23,20,); B(B_VAROUT,,DESLOCA_ESQ,30,18,32,20,); B(B_F,DMOV_M,,23,16,30,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.,44,2,56,19,); B(B_CONTACT,,M202,8,2,10,4,N); B(B_CONTACT,,M302,12,2,14,4,N); B(B_CONTACT,,M402,16,2,18,4,N); L(1,3,4,3); L(19,8,23,8); L(19,8,19,13); L(19,13,23,13); L(19,13,19,18); L(19,18,23,18); L(1,0,1,21); L(6,3,8,3); L(10,3,12,3); L(14,3,16,3); L(19,3,19,8); L(19,3,23,3); L(18,3,19,3); 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 OBSTACULO_ATRAS VAR_EXTERNAL T_COIL2: BOOL:=FALSE; T_SAIDA2: BOOL:=FALSE; T_SAIDA3: BOOL:=FALSE; T_COIL3: BOOL:=FALSE; POS_ACTUAL_ESQ: DINT:=0; OBS_TRAS: BOOL:=FALSE; 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 := 15 ; NETWORK_BODY B(B_CONTACT,,OBS_TRAS,5,2,7,4,); B(B_CONTACT,,M202,10,2,12,4,); B(B_COIL,,M109,29,9,31,11,S); B(B_COIL,,M202,29,12,31,14,E); B(B_COIL,,M108,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,,M108,5,2,7,4,); B(B_VARIN,,T_COIL2,22,3,24,5,); B(B_VARIN,,30,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_COIL,,M102,25,2,27,4,S); B(B_COIL,,M108,25,5,27,7,E); B(B_CONTACT,,T_SAIDA2,5,2,7,4,); L(1,0,1,8); L(13,3,13,6); L(13,6,25,6); L(13,3,25,3); L(1,3,5,3); L(7,3,13,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 11 ; NETWORK_BODY B(B_CONTACT,,M102,5,2,7,4,); B(B_CONTACT,,M109,11,2,13,4,); B(B_VARIN,,-1500,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,,M102,30,3,32,5,E); B(B_COIL,,M110,30,7,32,9,S); L(1,3,5,3); L(7,3,11,3); L(13,3,19,3); L(1,0,1,11); L(27,4,27,8); L(27,8,30,8); L(27,4,30,4); L(24,4,27,4); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 9 ; NETWORK_BODY B(B_CONTACT,,M110,5,2,7,4,); B(B_VARIN,,T_COIL3,11,3,13,5,); B(B_VARIN,,15,11,4,13,6,); B(B_F,TIMER_M,,13,1,20,6,); L(1,0,1,9); L(1,3,5,3); L(7,3,13,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 25 ; NETWORK_BODY B(B_CONTACT,,M109,9,2,11,4,); B(B_CONTACT,,M102,14,2,16,4,N); B(B_CONTACT,,M8013,22,2,24,4,); B(B_CONTACT,,M8013,22,11,24,13,N); B(B_COIL,,M302,32,2,34,4,S); B(B_COIL,,M402,32,11,34,13,S); B(B_CONTACT,,T_SAIDA3,4,2,6,4,); B(B_COIL,,M110,32,20,34,22,E); B(B_COIL,,M112,32,8,34,10,S); B(B_COIL,,M112,32,17,34,19,S); L(11,3,14,3); L(19,3,19,12); L(19,12,22,12); L(28,12,28,15); L(28,12,32,12); L(24,12,28,12); L(1,3,4,3); L(8,3,8,21); L(8,21,32,21); L(19,3,22,3); L(16,3,19,3); L(28,3,32,3); L(24,3,28,3); L(8,3,9,3); L(6,3,8,3); L(28,3,28,6); L(28,6,28,9); L(28,9,32,9); L(1,0,1,25); L(28,15,28,18); L(28,18,32,18); END_NETWORK_BODY END_NET_WORK END_BODY END_PROGRAM PROGRAM OBSTACULO_FRENTE VAR_EXTERNAL POS_ACTUAL_ESQ: DINT:=0; T_COIL: BOOL:=FALSE; T_SAIDA: BOOL:=FALSE; T_COIL1: BOOL:=FALSE; T_SAIDA1: BOOL:=FALSE; OBS_FRENTE: BOOL:=FALSE; 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 := 15 ; NETWORK_BODY B(B_CONTACT,,OBS_FRENTE,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,,30,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_COIL,,M202,25,2,27,4,S); B(B_COIL,,M106,25,5,27,7,E); B(B_CONTACT,,T_SAIDA,5,2,7,4,); L(1,0,1,8); L(13,3,13,6); L(13,6,25,6); L(13,3,25,3); L(1,3,5,3); L(7,3,13,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 11 ; NETWORK_BODY B(B_CONTACT,,M202,5,2,7,4,); B(B_CONTACT,,M104,11,2,13,4,); B(B_VARIN,,1500,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,,M107,30,7,32,9,S); L(24,4,30,4); L(1,3,5,3); L(7,3,11,3); L(13,3,19,3); L(1,0,1,11); L(27,4,27,8); L(27,8,30,8); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 9 ; NETWORK_BODY B(B_CONTACT,,M107,5,2,7,4,); B(B_VARIN,,T_COIL1,11,3,13,5,); B(B_VARIN,,15,11,4,13,6,); B(B_F,TIMER_M,,13,1,20,6,); L(1,0,1,9); L(1,3,5,3); L(7,3,13,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 23 ; 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,11,24,13,N); B(B_COIL,,M302,32,2,34,4,S); B(B_COIL,,M402,32,11,34,13,S); B(B_CONTACT,,T_SAIDA1,4,2,6,4,); B(B_COIL,,M107,32,20,34,22,E); B(B_COIL,,M112,32,8,34,10,S); B(B_COIL,,M112,32,17,34,19,S); L(11,3,14,3); L(16,3,22,3); L(24,3,32,3); L(28,3,28,6); L(19,3,19,12); L(19,12,22,12); L(28,12,28,15); L(28,12,32,12); L(24,12,28,12); L(6,3,9,3); L(1,3,4,3); L(8,3,8,21); L(8,21,32,21); L(28,6,28,9); L(28,9,32,9); L(1,0,1,23); L(28,15,28,18); L(28,18,32,18); 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 := 12 ; 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,); B(B_F,PLS_M,,13,5,19,9,); B(B_COIL,,M102,24,7,26,9,E); L(1,2,4,2); L(6,2,12,2); L(1,0,1,12); L(8,2,8,7); L(8,7,13,7); L(19,8,24,8); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 21 ; NETWORK_BODY B(B_VARIN,,-750,22,8,24,10,); B(B_VAROUT,,DESLOCA_DIR,31,8,33,10,); B(B_F,DMOV_M,,24,6,31,10,); B(B_VARIN,,400,22,3,24,5,); B(B_VAROUT,,VELOCIDADE_DIR,31,3,33,5,); B(B_F,DMOV_M,,24,1,31,5,); B(B_VARIN,,400,22,13,24,15,); B(B_VAROUT,,VELOCIDADE_ESQ,31,13,33,15,); B(B_F,DMOV_M,,24,11,31,15,); B(B_VARIN,,750,22,18,24,20,); B(B_VAROUT,,DESLOCA_ESQ,31,18,33,20,); B(B_F,DMOV_M,,24,16,31,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.,45,2,57,19,); B(B_CONTACT,,M102,8,2,10,4,N); B(B_CONTACT,,M302,12,2,14,4,N); B(B_CONTACT,,M402,16,2,18,4,N); L(1,3,4,3); L(21,8,24,8); L(21,8,21,13); L(21,13,24,13); L(21,13,21,18); L(21,18,24,18); L(18,3,24,3); L(14,3,16,3); L(10,3,12,3); L(6,3,8,3); L(1,0,1,21); L(21,3,21,8); END_NETWORK_BODY END_NET_WORK END_BODY END_PROGRAM CONFIGURATION scConfiguration RESOURCE scResource ON scResourceType VAR_GLOBAL OBS_TRAS AT %IX0: BOOL:=FALSE; FRENTE AT %IX1: BOOL:=FALSE; TRAS AT %IX2: BOOL:=FALSE; OBS_FRENTE AT %IX3: 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_COIL1 AT %MX5.2: BOOL:=FALSE; T_ACTUAL1 AT %MW3.2: INT:=0; T_SAIDA AT %MX3.1: BOOL:=FALSE; T_SAIDA1 AT %MX3.2: BOOL:=FALSE; T_COIL2 AT %MX5.3: BOOL:=FALSE; T_COIL3 AT %MX5.4: BOOL:=FALSE; T_ACTUAL2 AT %MW3.3: INT:=0; T_ACTUAL3 AT %MW3.4: INT:=0; T_SAIDA2 AT %MX3.3: BOOL:=FALSE; T_SAIDA3 AT %MX3.4: 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 OBSTACULO_ATRAS WITH MECHEX: scProgramType PROGRAM OBSTACULO_FRENTE WITH MECHEX: scProgramType END_RESOURCE END_CONFIGURATION