(*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; TEMP_ACEL: INT:=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 := 18 ; NETWORK_BODY B(B_CONTACT,,M102,5,3,7,5,); B(B_CONTACT,,M202,5,6,7,8,); B(B_CONTACT,,M302,5,9,7,11,); B(B_CONTACT,,M402,5,12,7,14,); B(B_COIL,,M8,25,3,27,5,); B(B_CONTACT,,M505,5,15,7,17,); B(B_CONTACT,,M502,10,15,12,17,); B(B_CONTACT,,M502,13,3,15,5,N); B(B_CONTACT,,M8011,18,3,20,5,); L(1,4,5,4); L(1,7,5,7); L(1,10,5,10); L(1,13,5,13); L(7,7,11,7); L(11,4,11,7); L(7,10,11,10); L(11,7,11,10); L(7,13,8,13); L(8,13,11,13); L(11,10,11,13); L(1,16,5,16); L(7,16,10,16); L(1,0,1,18); L(7,4,11,4); L(11,4,13,4); L(15,4,18,4); L(20,4,25,4); L(12,16,17,16); L(17,4,17,16); 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,7,2,9,4,N); B(B_CONTACT,,M202,12,2,14,4,N); B(B_CONTACT,,M302,17,2,19,4,N); B(B_CONTACT,,M402,22,2,24,4,N); B(B_VARIN,,0,39,3,41,5,); B(B_VAROUT,,DESLOCA_DIR,48,3,50,5,); B(B_F,DMOVP_M,,41,1,48,5,); B(B_VARIN,,0,39,19,41,21,); B(B_VAROUT,,VELOCIDADE_ESQ,48,19,50,21,); B(B_F,DMOVP_M,,41,17,48,21,); B(B_VARIN,,0,39,14,41,16,); B(B_VAROUT,,VELOCIDADE_DIR,48,14,50,16,); B(B_F,DMOVP_M,,41,12,48,16,); B(B_VARIN,,0,39,8,41,10,); B(B_VAROUT,,DESLOCA_ESQ,48,8,50,10,); B(B_F,DMOVP_M,,41,6,48,10,); B(B_VARIN,,0,39,24,41,26,); B(B_VARIN,,0,39,25,41,27,); B(B_VARIN,,26,39,26,41,28,); B(B_VARIN,,1,39,27,41,29,); B(B_F,DTOP_M,,41,22,48,29,); B(B_VARIN,,0,39,32,41,34,); B(B_VARIN,,1,39,33,41,35,); B(B_VARIN,,26,39,34,41,36,); B(B_VARIN,,1,39,35,41,37,); B(B_F,DTOP_M,,41,30,48,37,); B(B_CONTACT,,M20,27,2,29,4,); B(B_CONTACT,,M8011,31,2,33,4,); B(B_CONTACT,,M505,3,2,5,4,N); L(9,3,12,3); L(14,3,17,3); L(19,3,22,3); L(36,3,36,7); L(36,11,36,19); L(36,19,41,19); L(36,8,41,8); L(36,14,41,14); L(36,3,41,3); L(36,19,36,24); L(36,24,41,24); L(36,24,36,32); L(36,32,41,32); L(24,3,27,3); L(33,3,36,3); L(29,3,31,3); L(5,3,7,3); L(1,0,1,42); L(1,3,3,3); L(36,8,36,11); L(36,7,36,8); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 14 ; 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,); B(B_CONTACT,,M505,21,2,23,4,N); B(B_CONTACT,,M502,7,10,9,12,); B(B_CONTACT,,M505,13,10,15,12,N); 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(46,4,48,4); L(50,4,53,4); L(19,3,21,3); L(23,3,26,3); L(1,11,7,11); L(51,4,51,11); L(15,11,51,11); L(9,11,13,11); L(1,0,1,14); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 38 ; NETWORK_BODY B(B_VARIN,,0,26,4,28,6,); B(B_VAROUT,,DESLOCA_DIR,35,4,37,6,); B(B_F,DMOVP_M,,28,2,35,6,); B(B_VARIN,,0,26,20,28,22,); B(B_VAROUT,,VELOCIDADE_ESQ,35,20,37,22,); B(B_F,DMOVP_M,,28,18,35,22,); B(B_VARIN,,0,26,15,28,17,); B(B_VAROUT,,VELOCIDADE_DIR,35,15,37,17,); B(B_F,DMOVP_M,,28,13,35,17,); B(B_VARIN,,0,26,9,28,11,); B(B_VAROUT,,DESLOCA_ESQ,35,9,37,11,); B(B_F,DMOVP_M,,28,7,35,11,); B(B_VARIN,,0,26,25,28,27,); B(B_VARIN,,0,26,26,28,28,); B(B_VARIN,,26,26,27,28,29,); B(B_VARIN,,1,26,28,28,30,); B(B_F,DTOP_M,,28,23,35,30,); B(B_VARIN,,0,26,33,28,35,); B(B_VARIN,,1,26,34,28,36,); B(B_VARIN,,26,26,35,28,37,); B(B_VARIN,,1,26,36,28,38,); B(B_F,DTOP_M,,28,31,35,38,); B(B_CONTACT,,M20,14,3,16,5,); B(B_CONTACT,,M8011,18,3,20,5,); B(B_CONTACT,,M502,4,3,6,5,); B(B_CONTACT,,M505,10,3,12,5,N); L(23,4,23,8); L(23,20,28,20); L(23,9,28,9); L(23,15,28,15); L(23,4,28,4); L(23,20,23,25); L(23,25,28,25); L(23,25,23,33); L(23,33,28,33); L(20,4,23,4); L(16,4,18,4); L(23,9,23,12); L(23,8,23,9); L(23,15,23,20); L(23,12,23,15); L(1,0,1,38); L(6,4,10,4); L(12,4,14,4); L(1,4,4,4); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 21 ; NETWORK_BODY B(B_F,EQ_E-2,,12,4,17,9,0000N); B(B_VARIN,,0,10,6,12,8,); B(B_VARIN,,POS_ACTUAL_DIR,10,7,12,9,); B(B_F,EQ_E-2,,12,13,17,18,0000N); B(B_VARIN,,0,10,15,12,17,); B(B_VARIN,,POS_ACTUAL_ESQ,10,16,12,18,); B(B_COIL,,Y0,53,6,55,8,E); B(B_CONTACT,,M202,25,10,27,12,); B(B_CONTACT,,M302,25,14,27,16,); B(B_CONTACT,,M402,25,18,27,20,); B(B_CONTACT,,M102,25,6,27,8,); B(B_CONTACT,,M502,41,6,43,8,N); B(B_CONTACT,,M505,9,1,11,3,); B(B_CONTACT,,M502,19,1,21,3,); L(1,6,12,6); L(1,15,12,15); L(21,7,21,11); L(21,11,25,11); L(21,11,21,15); L(21,15,25,15); L(21,15,21,19); L(21,19,25,19); L(17,16,19,16); L(19,7,19,16); L(27,11,35,11); L(35,7,35,11); L(27,15,35,15); L(35,11,35,15); L(27,19,35,19); L(35,15,35,19); L(17,7,21,7); L(27,7,35,7); L(21,7,25,7); L(35,7,41,7); L(43,7,53,7); L(1,0,1,21); L(1,2,9,2); L(11,2,19,2); L(47,2,47,7); L(21,2,47,2); 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 NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 7 ; NETWORK_BODY B(B_VARIN,,2000,12,4,14,6,); B(B_VAROUT,,TEMP_ACEL,20,4,22,6,); B(B_F,MOV_M,,14,2,20,6,); B(B_CONTACT,,M505,3,3,5,5,N); L(1,0,1,7); L(5,4,14,4); L(1,4,3,4); 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 := 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,,DIREITA,4,1,6,3,); B(B_VAROUT,,M400,24,2,26,4,); B(B_F,PLS_M,,18,0,24,4,); B(B_CONTACT,,M502,10,1,12,3,N); L(1,0,1,6); L(1,2,4,2); L(6,2,10,2); L(12,2,18,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,39,3,41,5,S); B(B_COIL,,M102,39,6,41,8,E); B(B_COIL,,M202,39,9,41,11,E); B(B_CONTACT,,M400,4,3,6,5,); B(B_CONTACT,,M303,17,3,19,5,N); B(B_CONTACT,,M502,10,3,12,5,N); L(32,4,39,4); L(32,4,32,7); L(32,7,39,7); L(32,7,32,10); L(32,10,39,10); L(1,4,4,4); L(19,4,32,4); L(1,0,1,12); L(6,4,10,4); L(12,4,17,4); 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); B(B_CONTACT,,M502,7,3,9,5,N); L(1,4,3,4); L(22,5,34,5); L(39,6,44,6); L(1,0,1,9); L(5,4,7,4); L(9,4,17,4); 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,,-3000,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,,-1500,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,,800,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,,-4500,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); B(B_CONTACT,,M502,4,2,6,4,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(6,3,9,3); L(1,3,4,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,,800,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,,-1500,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,,800,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,,-1500,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,,-1500,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,); B(B_CONTACT,,M502,4,2,6,4,N); 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(6,3,10,3); L(1,3,4,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 31 ; NETWORK_BODY B(B_VARIN,,-4500,26,3,28,5,); B(B_VARIN,,POS_ACTUAL_DIR,26,4,28,6,); B(B_F,EQ_E-2,,28,1,33,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,74,11,85,30,); B(B_COIL,,M402,47,3,49,5,E); B(B_VARIN,,0,39,13,41,15,); B(B_VARIN,,1,39,14,41,16,); B(B_VARIN,,26,39,15,41,17,); B(B_VARIN,,1,39,16,41,18,); B(B_F,DTOP_M,,41,11,48,18,); B(B_VARIN,,0,39,23,41,25,); B(B_VARIN,,0,39,24,41,26,); B(B_VARIN,,26,39,25,41,27,); B(B_VARIN,,1,39,26,41,28,); B(B_F,DTOP_M,,41,21,48,28,); B(B_CONTACT,,M112,21,2,23,4,N); B(B_VARIN,,-6000,26,16,28,18,); B(B_VARIN,,POS_ACTUAL_DIR,26,17,28,19,); B(B_F,EQ_E-2,,28,14,33,19,); B(B_CONTACT,,M112,21,15,23,17,); B(B_COIL,,M403,47,6,49,8,E); B(B_CONTACT,,M402,11,2,13,4,); B(B_CONTACT,,M502,5,2,7,4,N); L(33,4,47,4); L(37,4,37,13); L(37,13,41,13); L(37,13,37,23); L(37,23,41,23); L(23,3,28,3); L(34,4,34,17); L(33,17,34,17); L(23,16,28,16); L(19,3,19,16); L(19,16,21,16); L(42,4,42,7); L(42,7,47,7); L(1,0,1,31); L(19,3,21,3); L(13,3,19,3); L(7,3,11,3); L(1,3,5,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 := 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,,ESQUERDA,4,1,6,3,); B(B_VAROUT,,M300,21,2,23,4,); B(B_F,PLS_M,,15,0,21,4,); B(B_CONTACT,,M502,9,1,11,3,N); L(1,0,1,6); L(1,2,4,2); L(6,2,9,2); L(11,2,15,2); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 12 ; NETWORK_BODY B(B_CONTACT,,M403,25,2,27,4,N); B(B_CONTACT,,M300,15,2,17,4,); B(B_COIL,,M102,47,5,49,7,E); B(B_COIL,,M303,47,2,49,4,S); B(B_COIL,,M202,47,8,49,10,E); B(B_CONTACT,,M502,5,2,7,4,N); L(38,3,38,6); L(27,3,38,3); L(17,3,25,3); L(38,6,47,6); L(38,3,47,3); L(38,6,38,9); L(38,9,47,9); L(1,0,1,12); L(7,3,15,3); L(1,3,5,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 10 ; NETWORK_BODY B(B_VARIN,,POS_ACTUAL_DIR,20,4,22,6,); B(B_VARIN,,0,20,5,22,7,); B(B_F,EQ_E-2,,22,2,27,7,); B(B_VARIN,,POS_ACTUAL_ESQ,37,5,39,7,); B(B_VARIN,,0,37,6,39,8,); B(B_F,EQ_E-2,,39,3,44,8,); B(B_COIL,,M302,49,5,51,7,S); B(B_CONTACT,,M303,12,3,14,5,); B(B_CONTACT,,M502,5,3,7,5,N); L(27,5,39,5); L(44,6,49,6); L(14,4,22,4); L(1,0,1,10); L(7,4,12,4); L(1,4,5,4); 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,); B(B_CONTACT,,M502,3,2,5,4,N); L(10,3,18,3); L(13,3,13,13); L(13,13,18,13); L(1,0,1,19); L(5,3,8,3); L(1,3,3,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,,3000,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,,800,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,,1500,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,,4500,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,); B(B_CONTACT,,M502,3,2,5,4,N); 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,3,3); L(5,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,,1500,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,,800,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,,1500,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,,800,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,,1500,25,20,27,22,); B(B_VAROUT,,DESLOCA_ESQ,34,20,36,22,); B(B_F,DMOV_M,,27,18,34,22,); B(B_CONTACT,,M502,4,2,6,4,N); 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(6,3,9,3); L(1,3,4,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,,4500,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,,6000,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); B(B_CONTACT,,M502,4,2,6,4,N); 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(6,3,9,3); L(1,3,4,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 := 17 ; NETWORK_BODY B(B_COMMENT,,activaçao do pulso para activar a memoria.,29,8,40,11,); B(B_CONTACT,,FRENTE,4,8,6,10,); B(B_F,PLS_M,,12,12,18,16,); B(B_COIL,,M202,22,14,24,16,E); B(B_VAROUT,,M102,20,9,22,11,); B(B_F,ALTP_M,,13,7,20,11,); B(B_CONTACT,,M102,4,3,6,5,); B(B_CONTACT,,M505,9,3,11,5,); L(1,9,4,9); L(8,9,8,14); L(8,14,12,14); L(18,15,22,15); L(1,0,1,17); L(6,9,8,9); L(8,9,13,9); L(1,4,4,4); L(6,4,9,4); L(12,4,12,9); L(11,4,12,4); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 21 ; NETWORK_BODY B(B_VARIN,,1500,27,8,29,10,); B(B_VAROUT,,DESLOCA_DIR,36,8,38,10,); B(B_F,DMOV_M,,29,6,36,10,); B(B_VARIN,,800,27,3,29,5,); B(B_VAROUT,,VELOCIDADE_DIR,36,3,38,5,); B(B_F,DMOV_M,,29,1,36,5,); B(B_VARIN,,800,27,13,29,15,); B(B_VAROUT,,VELOCIDADE_ESQ,36,13,38,15,); B(B_F,DMOV_M,,29,11,36,15,); B(B_VARIN,,-1500,27,18,29,20,); B(B_VAROUT,,DESLOCA_ESQ,36,18,38,20,); B(B_F,DMOV_M,,29,16,36,20,); B(B_CONTACT,,M102,10,2,12,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.,50,2,62,19,); B(B_CONTACT,,M202,14,2,16,4,N); B(B_CONTACT,,M302,18,2,20,4,N); B(B_CONTACT,,M402,22,2,24,4,N); B(B_CONTACT,,M505,4,2,6,4,N); L(25,8,29,8); L(25,8,25,13); L(25,13,29,13); L(25,13,25,18); L(25,18,29,18); L(12,3,14,3); L(16,3,18,3); L(20,3,22,3); L(25,3,25,8); L(25,3,29,3); L(24,3,25,3); L(1,0,1,21); L(6,3,10,3); L(1,3,4,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; TEMP_ACEL: INT:=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 := 8 ; 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,8); 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,,TEMP_ACEL,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; TEMP_ACEL: INT:=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,,TEMP_ACEL,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,,-3000,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,,3000,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 SINCRONIZA VAR_EXTERNAL TEMP_ACEL: INT:=0; 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 := 14 ; NETWORK_BODY B(B_CONTACT,,M502,4,2,6,4,); B(B_COIL,,M403,18,2,20,4,E); B(B_COIL,,M303,18,8,20,10,E); B(B_COIL,,M302,18,11,20,13,E); B(B_COIL,,M402,18,5,20,7,E); L(1,3,4,3); L(17,3,18,3); L(14,3,14,6); L(14,6,14,9); L(14,9,18,9); L(14,9,14,12); L(14,12,18,12); L(14,6,18,6); L(1,0,1,14); L(14,3,17,3); L(6,3,14,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 6 ; NETWORK_BODY B(B_CONTACT,,X6,4,1,6,3,N); B(B_CONTACT,,M505,10,1,12,3,); B(B_COIL,,M500,18,1,20,3,S); B(B_CONTACT,,M501,14,1,16,3,N); L(1,2,4,2); L(6,2,10,2); L(1,0,1,6); L(16,2,18,2); L(12,2,14,2); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 6 ; NETWORK_BODY B(B_CONTACT,,X7,4,2,6,4,N); B(B_CONTACT,,M500,9,2,11,4,N); B(B_CONTACT,,M505,13,2,15,4,); B(B_COIL,,M501,18,2,20,4,S); L(1,3,4,3); L(6,3,9,3); L(1,0,1,6); L(11,3,13,3); L(15,3,18,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 11 ; NETWORK_BODY B(B_CONTACT,,M505,9,2,11,4,); B(B_CONTACT,,X7,4,2,6,4,); B(B_VARIN,,0,17,3,19,5,); B(B_VARIN,,1,17,4,19,6,); B(B_VARIN,,26,17,5,19,7,); B(B_VARIN,,1,17,6,19,8,); B(B_F,DTOP_M,,19,1,26,8,); B(B_COIL,,M501,20,9,22,11,E); L(6,3,9,3); L(1,3,4,3); L(11,3,19,3); L(14,10,20,10); L(14,3,14,10); L(1,0,1,11); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 13 ; NETWORK_BODY B(B_CONTACT,,X6,4,2,6,4,); B(B_CONTACT,,M505,9,2,11,4,); B(B_VARIN,,0,17,3,19,5,); B(B_VARIN,,0,17,4,19,6,); B(B_VARIN,,26,17,5,19,7,); B(B_VARIN,,1,17,6,19,8,); B(B_F,DTOP_M,,19,1,26,8,); B(B_COIL,,M500,20,10,22,12,E); L(1,3,4,3); L(6,3,9,3); L(11,3,19,3); L(14,3,14,11); L(14,11,20,11); L(1,0,1,13); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 8 ; NETWORK_BODY B(B_CONTACT,,X6,4,2,6,4,); B(B_CONTACT,,X7,9,2,11,4,); B(B_CONTACT,,M505,14,2,16,4,); B(B_COIL,,M505,22,2,24,4,E); L(1,3,4,3); L(6,3,9,3); L(11,3,14,3); L(1,0,1,8); L(16,3,22,3); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 47 ; NETWORK_BODY B(B_VARIN,,50,20,12,22,14,); B(B_VAROUT,,DESLOCA_DIR,29,12,31,14,); B(B_F,DMOV_M,,22,10,29,14,); B(B_VARIN,,400,20,7,22,9,); B(B_VAROUT,,VELOCIDADE_DIR,29,7,31,9,); B(B_F,DMOV_M,,22,5,29,9,); B(B_VARIN,,400,20,27,22,29,); B(B_VAROUT,,VELOCIDADE_ESQ,29,27,31,29,); B(B_F,DMOV_M,,22,25,29,29,); 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.,43,6,55,23,); B(B_VARIN,,-50,20,33,22,35,); B(B_VAROUT,,DESLOCA_ESQ,29,33,31,35,); B(B_F,DMOV_M,,22,31,29,35,); B(B_CONTACT,,M501,13,6,15,8,); B(B_VARIN,,100,19,3,21,5,); B(B_VAROUT,,TEMP_ACEL,27,3,29,5,); B(B_F,MOV_M,,21,1,27,5,); B(B_CONTACT,,M505,4,2,6,4,); B(B_CONTACT,,M500,13,26,15,28,); B(B_VARIN,,0,20,20,22,22,); B(B_VAROUT,,VELOCIDADE_ESQ,29,20,31,22,); B(B_F,DMOV_M,,22,18,29,22,); B(B_VARIN,,0,20,16,22,18,); B(B_VAROUT,,DESLOCA_ESQ,29,16,31,18,); B(B_F,DMOV_M,,22,14,29,18,); B(B_VARIN,,0,20,38,22,40,); B(B_VAROUT,,VELOCIDADE_DIR,29,38,31,40,); B(B_F,DMOV_M,,22,36,29,40,); B(B_VARIN,,0,20,43,22,45,); B(B_VAROUT,,DESLOCA_DIR,29,43,31,45,); B(B_F,DMOV_M,,22,41,29,45,); L(18,12,22,12); L(18,7,18,12); L(18,7,22,7); L(1,3,4,3); L(6,3,21,3); L(15,7,18,7); L(9,3,9,7); L(9,7,13,7); L(17,27,17,33); L(17,33,22,33); L(17,27,22,27); L(15,27,17,27); L(9,7,9,27); L(9,27,13,27); L(18,12,18,16); L(18,16,22,16); L(18,16,18,20); L(18,20,22,20); L(17,33,17,38); L(17,38,22,38); L(1,0,1,47); L(17,38,17,43); L(17,43,22,43); 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 := 17 ; NETWORK_BODY B(B_COMMENT,,activaçao do pulso para activar a memoria.,29,8,40,11,); B(B_CONTACT,,TRAS,4,8,6,10,); B(B_VAROUT,,M202,19,9,21,11,); B(B_F,ALTP_M,,12,7,19,11,); B(B_F,PLS_M,,13,12,19,16,); B(B_COIL,,M102,24,14,26,16,E); B(B_CONTACT,,M202,4,3,6,5,); B(B_CONTACT,,M505,8,3,10,5,); L(1,9,4,9); L(6,9,12,9); L(8,9,8,14); L(8,14,13,14); L(19,15,24,15); L(1,0,1,17); L(1,4,4,4); L(6,4,8,4); L(11,4,11,9); L(10,4,11,4); END_NETWORK_BODY END_NET_WORK NET_WORK NETWORK_TYPE := NWTYPELD ; NETWORK_LABEL := ; NETWORK_TITLE := ; NETWORK_HEIGHT := 21 ; NETWORK_BODY B(B_VARIN,,-1500,27,8,29,10,); B(B_VAROUT,,DESLOCA_DIR,36,8,38,10,); B(B_F,DMOV_M,,29,6,36,10,); B(B_VARIN,,800,27,3,29,5,); B(B_VAROUT,,VELOCIDADE_DIR,36,3,38,5,); B(B_F,DMOV_M,,29,1,36,5,); B(B_VARIN,,800,27,13,29,15,); B(B_VAROUT,,VELOCIDADE_ESQ,36,13,38,15,); B(B_F,DMOV_M,,29,11,36,15,); B(B_VARIN,,1500,27,18,29,20,); B(B_VAROUT,,DESLOCA_ESQ,36,18,38,20,); B(B_F,DMOV_M,,29,16,36,20,); B(B_CONTACT,,M202,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.,50,2,62,19,); B(B_CONTACT,,M102,13,2,15,4,N); B(B_CONTACT,,M302,17,2,19,4,N); B(B_CONTACT,,M402,21,2,23,4,N); B(B_CONTACT,,M505,4,2,6,4,N); L(26,8,29,8); L(26,8,26,13); L(26,13,29,13); L(26,13,26,18); L(26,18,29,18); L(23,3,29,3); L(19,3,21,3); L(15,3,17,3); L(11,3,13,3); L(26,3,26,8); L(1,0,1,21); L(6,3,9,3); L(1,3,4,3); 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; TEMP_ACEL AT %MW0.100: INT:=0; 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 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 PROGRAM SINCRONIZA WITH MECHEX: scProgramType END_RESOURCE END_CONFIGURATION