Anda di halaman 1dari 22

Procedimiento para Restauración de JagXtreme Romana Crudo a Granel

1. Preparar comunicación con JagXtreme:


El JagXtreme se comunica con una conexión Punto-Punto Ethernet. La dirección IP de fábrica viene
configurada de la siguiente forma:
• Dirección: 111.111.111.111
• Máscara SubRed: 255.255.255.0

Por ello, será necesario cambiar la dirección IP de la computadora para que se encuentre en la misma
subred. Se ha utilizado la 111.111.111.100
Para la conexión se deberá utilizar un cable Ethernet recto, ya que la tarjeta del JagXtreme ya tiene
configuración punto-punto.

2. Conectarse al JagXtreme:
Para conectarse al JagXtreme es necesario abrir el Internet Explorer. No utilizar otros exploradores ya que
el web server del JagXtreme tiene controles que no son compatibles con el Internet Explorer.
Adicionalmente a esto la versión del explorador debe ser superior a 5.0
En Internet Explorer ir a Tools (Herramientas), luego Internet Options (Opciones de Internet).
En la ficha Advanced (Avanzado), en la Categoría Browsing (Exploración) verificar que esté activada la
opción “Enable FTP folder view (outside of Internet Explorer)” o habilitar vista de carpeta para FTP.
Conectarse utilizando la siguiente dirección: http://111.111.111.111/
Verificar que se cargue correctamente el web server del explorador.
En el panel de exploración en la parte izquierda, poner el controlador en modo PROGRAMA.

3. Configurar Entradas / Salidas del Controlador:


En la parte izquierda aparecerá un Panel de Exploración. Se podrá cambiar el lenguaje a español en la
Opción Language.
Elegir posteriormente la Opción Aplicación (Application). Esto abrirá un panel en el que se puede
configurar Entradas/Salidas Discretas y JagBasic.
Elegir Entradas/Salidas Discretas. Esto abrirá un Panel que contiene el uso que actualmente se tiene
configurado en el JagXtreme para las tarjetas de Entrada / Salidas discretas. Normalmente de fábrica
vienen unas funciones pre-configuradas, lo cual interfiere con la operación del programa. Por lo tanto
deberá realizarse lo siguiente: En TODAS las tarjetas de entrada / salida, primero SELECCIONAR EL
NÚMERO DE CANAL, y luego en la función buscar la Opción NINGUNA o NONE. Siempre que se haga un
cambio presionar APLICAR y GUARDAR CAMBIOS. Esto deberá hacerse para TODAS las entradas y salidas.
En la sección final se encontrará una opción de SetPoints, esto debe dejarse tal y como está. NO
TOCARLO.

4. Configurar JagBasic:
En la misma Opción Aplicación (Application), seleccionar ahora JagBasic. Esto abrirá el panel de
configuración para programación. En la sección superior aparecerán varias opciones que deberán ser
configuradas de la siguiente manera:
• Entrada: Ambos o Both (existen opciones para teclado frontal, teclado externo, ambos o
ninguno).
• Display: Seleccionar JagBasic. Esto servirá para recibir en el display los mensajes del programa.
• Enable AutoStart: Se seleccionará YES. Esto cargará el primer programa en la memoria RAM del
controlador cuando se apague y se encienda el mismo.
• Enable Manual Start: Se seleccionará YES. Esto activará la opción de cargar programa desde el
teclado frontal. En operación normal esto se logra presionando primero F, luego hasta
encontrar la opción RUN PROGRAM #? Para cargar el programa se deberá presionar 1.

5. Preparar Programa:
Es necesario preparar el programa antes de cargarlo al controlador. El programa deberá estar contenido
en un archivo llamado FILE1.BAS. Este nombre NO DEBERÁ CAMBIARSE. El archivo está adjunto a esta
especificación, así como también el texto que contiene, en caso de no tenerse el archivo.
Para volver a construir el archivo a partir del texto, se deberá copiar el texto a un archivo nuevo (que
puede ser de texto en Notepad y renombrarlo como FILE1.BAS en caso se requiera).
Los archivos .BAS se pueden abrir sin problemas con Notepad.
Para la primera carga al controlador deberá:
• Abrirse el archivo FILE1.BAS
• En la parte izquierda podrán verse números (que son números de registros internos de memoria
de programa del controlador). Ir al número 279.
• Se encontrará el siguiente texto:
279 rem cort$="500 ":material$="01":pre$="50 ":hell$="50 ":Rem Solo cuando es JagXtreme nuevo
• Esto deberá reemplazarse con el siguiente texto:
279 cort$="500 ":material$="01":pre$="50 ":hell$="50 ":Rem Solo cuando es JagXtreme nuevo
• Guardar el programa como FILE1.BAS

6. Transmitir Programa:
La transmisión del programa es tan sencillo como copiar y pegar un archivo en una carpeta. Se utiliza File
Transfer Protocol para esto (FTP). Para habilitar el FTP, siempre en la Opción Aplicación (Application) y
JagBasic, en la parte inferior aparecerá un panel de autenticación. Este panel de autenticación deberá ser
llenado con la siguiente información:
User: SUPERVISOR
FTP: 111.111.111.111

Al ingresar esto, se abrirá una solicitud de autenticación de Windows, para lo cual habrá que llenar:
Password: supervisor

Poner especial atención a que el usuario es TODO MAYÚSCULAS y el password TODO MINÚSCULAS.
Si el explorador fue configurado bien en el paso 2, se abrirá una nueva ventana de explorador de
Windows con la siguiente ruta: ftp://111.111.111.111
En esta ruta habrá varios archivos. Normalmente deberá encontrarse uno llamado FILE1.BAS
Si la báscula no funciona bien o no se observa este archivo en esta ventana, deberá copiarse el archivo
preparado en el punto 5. Para transmitir solamente es necesario copiar y pegar.

7. Correr Programa:
Para correr el programa, luego de haber copiado al FTP el archivo FILE1.BAS se podrá hacer de dos
formas:
A. Poner en modo RUN el controlador desde el Explorador de Internet (panel izquierdo del explorador).
B. Cuando aparezca BASIC: en el display, con el teclado externo colocar lo siguiente:
a. LOAD “FILE1.BAS”
b. Presionar ENTER
c. RUN “FILE1.BAS”
d. Presionar ENTER

Si todo fue realizado correctamente, en la pantalla aparecerá “BULKSCALE 03/02”, y “ForSa VER 1.6”.

Podrá configurarse los parámetros de corte, preactuado, material e impresora. Sin embargo el
controlador todavía NO está listo para operación. Para que lo esté deberá deshacerse el cambio en el
archivo FILE1.BAS que se realizó en el paso No. 5.

8. Comisionar Báscula:
Para deshacer el cambio en el archivo FILE1.BAS del paso No. 5, será necesario poner en modo
PROGRAMA nuevamente al controlador (desde el explorador) y realizar lo siguiente:
• Abrirse el archivo FILE1.BAS
• En la parte izquierda podrán verse números (que son números de registros internos de memoria
de programa del controlador). Ir al número 279.
• Se encontrará el siguiente texto:
279 cort$="500 ":material$="01":pre$="50 ":hell$="50 ":Rem Solo cuando es JagXtreme nuevo
• Esto deberá reemplazarse con el siguiente texto:
279 rem cort$="500 ":material$="01":pre$="50 ":hell$="50 ":Rem Solo cuando es JagXtreme nuevo
Guardar el programa como FILE1.BAS
Abrir nuevamente la ventana del FTP en la Opción Aplicación (Application), JagBasic, User: SUPERVISOR
ftp: 111.111.111.111 ; password: supervisor. Copiar el archivo FILE1.BAS reemplazando el existente en el
controlador. Correr nuevamente el programa como se indica en el paso No. 7.

Para verificar que todo funcione correctamente, se debe parametrizar el CORTE, PRE, MATERIAL,
IMPRESORA. También se deberá apagar y encender la báscula. El programa deberá cargarse solo. Si no lo
hace, hay que verificar que esté activada la función AutoStart del paso No. 4.

9. Configuraciones Especiales:
Los parámetros de CORTE y PRE, que son los SetPoints de Peso y PreActuado, tienen un rango permitido
por programa. Para modificarlo se deberán observar las siguientes líneas de programa:

CORTE:
25040 if corte%<=0 or corte%>1000 then goto 25000:rem cambiar limite corte
(se muestra en esta línea un corte configurado entre 0 y 1000 kg).

PRE:
25090 if prea%=0 or prea%>100 then goto 25050
(se muestra en esta línea un pre actuado configurado para valores entre 0 y 100 kg).

Estos valores pueden cambiarse según las necesidades de la báscula. El programa de las romanas de Crudo a Granel y Miel Final son
exactamente los mismos. La diferencia son los cortes y pre-actuados permitidos.
Contenido del Archivo FILE1.BAS

50 print "BULKSCALE 03/02":sleep 3000

60 print " ForSa VER 1.6 ":sleep 1000

99 rem Definicion de varibles

100 defshr pbruto%,wt110:defshr pneto%,wt111:defshr tara%,t_690

130 defshr limpia%,t_691:defshr motion%,s_200

140 defshr sal1,p_500:rem valvula de alimentacion

145 defshr sal2,p_501:rem valvula de descarga

150 defshr sal3,p_502:rem alarma

160 defshr sal4,p_503:rem paro general

165 defshr sal5,p_508:rem auxiliar

170 defshr ent1,p_100:rem manual automatico

180 defshr ent2,p_101:rem lim val de descarga

200 defshr ent3,p_102:rem lim val de alimrem

205 defshr ent4,p_103:rem parada de emergencia

210 defshr ent5,p_108:rem nivel alto tolva final

215 defshr ent6,p_109:rem arranque remoto

216 defshr ent7,p_10a:rem flow throw

217 defshr ent8,p_10b:rem nivel alto tolva de pesaje

218 defshr ent9,p_10c:rem nivel alto tolva alimentadora

219 defshr event ent10,p_10d:rem hold banda de descarga

220 defshr keyboard,bas10:defshr escape,bas86

250 defshr cero!,t_693:defshr select,bas87:defshr stopEnable,bas89

260 defshr datos$,pmt101:defshr datlin!,bas18

270 defshr cort$,pmt15:defshr material$,pmt16:defshr pre$,pmt17

275 defshr tieali,lit02:defshr tiedes,lit03:defshr pesadas,lit04

276 defshr pesoacu,lit05:defshr desfla$,lit06:defshr peso,lit07

277 defshr corte1$,lit08:defshr corte2$,lit09:defshr corte3$,lit10

278 defshr hell$,lit11:defshr password$,lit12:defshr pass$,lit13:defshr impresor$,lit14

279 rem cort$="500 ":material$="01":pre$="50 ":hell$="50 ":Rem Solo cuando es JagXtreme nuevo

280 select=1:escape=0:stopEnable=0

290 keyboard=2:password$="865336":repo#=6:pass$="07734":heel%=val(hell$)
300 defshr fechaini$,lit01

310 corte%=val(cort$):prea%=val(pre$):mate%=val(material$):batches#=val(pesadas)

315 pesoreg#=val(pesoacu):peso%=val(peso):cor1$=corte1$:cor2$=corte2$:cor3$=corte3$

320 datosplc$=" ":datos$="00000000001100":datlin!=0

325 on event ent10 gosub 18000

330 if ent4=0 and ent7=1 then gosub 700

335 if pneto%>0 and desfla$="1" then goto 4000

340 if pneto%>0 and inicio=0 then objetivo#=corte%-prea%:goto 1700

540 cuentali%=1:rem Menu Principal

541 print "* Pesar *":sleep 1000:tecla$=inkey$

542 if tecla$=chr$(8) then goto 900

545 if tecla$="c" or tecla$="C" then gosub 17000

546 if tecla$="p" or tecla$="P" then goto 900

550 if tecla$="r" or tecla$="R" then gosub 10000

551 if ent1=1 and ent7=0 then goto 7900

552 if tecla$="0" then cero!=1

555 if tecla$="9" then gosub 13000

556 if ent4=0 and ent7=1 then gosub 700

557 if ent7=0 and ent1=0 and ent4=1 then gosub 14000

558 if ent1=0 and ent7=0 and ent4=0 then gosub 600

580 print "* Reportes *":sleep 1000:tecla$=inkey$

582 if tecla$=chr$(8) then gosub 10000

585 if tecla$="c" or tecla$="C" then gosub 17000

586 if tecla$="p" or tecla$="P" then goto 900

588 if tecla$="r" or tecla$="R" then gosub 10000

590 if ent6=1 and ent7=0 then goto 7900

592 if tecla$="0" then cero!=1

595 if tecla$="9" then gosub 13000

596 if ent4=0 and ent7=1 then gosub 700

597 if ent7=0 and ent1=0 and ent4=1 then gosub 14000

598 if ent1=0 and ent7=0 and ent4=0 then gosub 600

599 goto 540


600 while ent1=0 and ent7=0

610 sp6auma=ent1:sp7fltr=ent7:gosub 21000

620 print " Panel Apagado "

630 wend

640 return

700 while ent4=0 and ent7=1

710 print " Paro Activado "

720 wend

730 return

900 rem Ingreso de Datos

901 if ent1=1 then goto 7900:rem 1=Operacion Manual

902 sp7fltr=ent7

905 if pneto%>0 then inicio=1:objetivo#=corte%-prea%:goto 2015

910 gosub 21000

1010 Print "Corte ";corte%:sleep 2000:gosub 25000

1016 print "Preact.: ";prea%:sleep 2000:gosub 25050

1020 print "Mat.: ";mate%:sleep 2000:gosub 25100

1040 objetivo#=corte%-prea%

1065 cort$=str$(corte%):pre$=str$(prea%):material$=str$(mate%)

1066 flag1$="1":gosub 21000

1096 rem si es una valvula de tipo on/off y doble selonoide: sal1="on" sleep sal1="off"

1100 sal1=0:sal2=0:sal3=0:sal4=0:gosub 21000

1106 gosub 7000:gosub 7950

1110 sal3=0:gosub 21000:print " ** LISTO ** ":sleep 1000

1120 if ent2=1 and ent3=1 then goto 1190:rem Si no hay alarma o stop

1130 if ent3=1 then goto 1148

1140 print "Pta Alim Abierta":sal3=1:gosub 21000

1146 goto 1120

1148 gosub 21000:rem ls comp. alim. cerrada (pos 10)

1160 if ent2=1 then goto 1178


1170 print "Pta Desc Abierta":sal3=1

1172 gosub 21000:rem ls comp. desc. abierta (pos 11)

1176 goto 1160

1178 gosub 21000:rem ls comp. desc. cerrada (pos 11)

1190 sal3=0:gosub 21000:print " ** LISTO ** ":sleep 1000

1200 sal4=0:gosub 21000:rem desactivar se%al de paro general

1500 rem etapa para pesar

1510 print "Listo Arranque"

1520 tara%=1:rem Auto captura de heel

1525 if pneto%>2 then goto 1520

1530 res$=inkey$

1535 if res$="p" or res$="P" then print "A Menu Principal":sleep 1000:goto 540

1536 while ent4=0

1537 print " Paro Activado ":gosub 21000

1538 wend

1540 if res$=chr$(8) then goto 1700

1550 if res$="5" then gosub 8000:rem salir a setup/jaguar

1560 if ent6=1 then goto 1700:arranque por boton

1570 if ent1=1 then goto 7900:rem operacion manual

1580 if res$="0" then cero!=1:rem poner en cero a la bascula

1590 gosub 20000:rem arranque por plc

1610 if ara#=1 then goto 1700

1620 goto 1510

1700 rem CICLO DE ALIMENTACION

1701 if pneto%<>0 then tara%=1

1705 sal1=1:sleep 7000:gosub 21000:psalir$="N"

1710 if ent3=0 then goto 1750

1714 if ent4=0 then goto 1810

1715 gosub 20000

1716 alto$=inkey$

1717 if alto$="p" or alto$="P" then goto 1810:rem Paro por teclado


1718 if par#=1 then goto 1810:rem Paro por plc

1720 sal3=1:gosub 21000:print "Pta Alim Cerrada":goto 1710

1750 if ent8=0 then sal3=0:sal4=0:gosub 21000

1760 print "Alim:";pneto%

1761 if ent4=0 then 1810

1762 if ent3=0 then goto 1765

1763 sal3=1:gosub 21000

1764 print "Pta Alim Cerrada":goto 1761

1765 if ent2=1 then goto 1769

1766 print "Pta Desc Abierta":sal3=1:sal1=0:gosub 21000

1768 goto 1765

1769 sal1=1:sal3=0:gosub 21000:rem ls comp. desc. cerrada (pos 11)

1780 if ent8=0 then goto 1786:rem control de nivel de tolva peso

1782 sal3=1:sal1=0:print "TOLVA PESO LLENA":gosub 21000:sleep 2000

1785 sp8natp=ent8:goto 4000

1786 sp8natp=ent8:alto$=inkey$

1787 if alto$="p" or alto$="P" then goto 1810:rem Paro por teclado

1788 if alto$="a" or alto$="A" then gosub 5500

1789 if ent4=0 then goto 1810:rem Paro por botonera

1790 gosub 20000:rem Paro por plc

1800 if par#=0 then goto 2000:rem Paro por plc

1810 sal1=0:sal3=1

1811 sal4=1:gosub 21000

1812 lprint time$;tab(11);date$;tab(20);"PARO DE EMERGENCIA"

1813 cuentali%=cuentali%+1

1814 if cuentali%>=56 then gosub 7950

1815 print "PARO EMERG":sleep 1000:tecla$=inkey$

1820 gosub 20000

1845 if tecla$=chr$(8) and pneto%>=objetivo# then sal4=0:sal1=0:sal3=0:gosub 21000:goto 4000

1850 if ara#=1 then goto 1900:rem Arranque por plc

1860 if ent6=1 then goto 1900:rem Arranque por botonera

1870 if tecla$="6" then psalir$="S":goto 4000

1873 if tecla$=chr$(8) then goto 1900:rem Arranque por teclado


1875 print "6=Sal/Ent=Cont":sleep 1000

1880 goto 1815

1900 sal4=0:sal3=0:sal1=1:sleep 1000

1910 goto 1700

2000 if pneto%<objetivo# then goto 1760

2010 sal1=0:gosub 21000:print " Estabilizando ":sleep 3000:gosub 5000:rem para esperar el cierre de la valvula

2015 if ent4=0 then gosub 15000:rem Paro de emergencia botonera

2016 gosub 20000

2017 alto$=inkey$

2018 if alto$="p" or alto$="P" then gosub 15000:rem Paro por teclado

2019 if alto$="d" or alto$="D" then gosub 6500

2020 if par#=1 then gosub 15000:rem Paro de emergencia plc

2022 if ent3=1 then gosub 21000:goto 4000

2030 sal3=1:gosub 21000

2040 print "Pta Alim Abierta"

2045 rem Inicia ciclo de espera de cierre mecanico (Lento)

2050 for cuenta%=1 to 10

2060 if ent3=1 then cuenta%=10

2070 sleep 10

2080 next cuenta%

2090 if ent3=1 then goto 4000

2100 sal4=1:sal3=1:gosub 21000

2200 goto 2015

4000 rem gosub 21000:rem CICLO DE DESCARGA

4001 peso%=pneto%:sal4=0:sal3=0:desfla$="1":peso=str$(peso%)

4005 sal2=1:sleep 5000:rem gosub 21000

4010 if ent2=0 then goto 4050

4020 sal3=1:gosub 21000:print "Pta Desc Cerrada":goto 4010

4050 sal3=0:gosub 21000

4051 print "Desc:";pneto%

4052 if ent4=0 then goto 4110


4055 if ent3=1 then goto 4058

4056 sal3=1:sal2=0:gosub 21000

4057 print "Pta Alim Abierta":goto 4055

4058 sal2=1:if ent2=0 then goto 4061

4059 print "Pta Desc Cerrada":sal3=1:sal2=1:gosub 21000

4060 goto 4058

4061 sal3=0:gosub 21000

4082 if ent9=0 then sal4=0:sp1nata=ent9

4083 if ent9=1 then full=1

4084 while full=1

4085 print "TOLVA ALIM. LLENA":sleep 2000:sal3=1:sal4=1

4086 if pneto%<=prea% then full=0:sp1nata=ent9

4087 wend

4088 if ent5=0 then goto 4093

4089 while ent5=1

4090 sal3=1:sal2=0:gosub 21000:print "TOLVA PASO LLENA":sp5natf=ent5

4091 wend

4092 sal3=0:sal2=1:gosub 21000:goto 4010

4093 sal3=0:sal2=1:sp5natf=ent5

4094 if ent4=0 then goto 4110

4095 alto$=inkey$

4096 if alto$="p" or alto$="P" then goto 4110:rem Paro por teclado

4097 if alto$="d" or alto$="D" then gosub 6500

4099 gosub 20000

4100 if par#=0 then goto 4300

4110 sal2=0:sal3=1:sal4=1:gosub 21000

4111 lprint time$;tab(11);date$;tab(20);"PARO DE EMERGENCIA"

4112 cuentali%=cuentali%+1

4113 if cuentali%>=56 then gosub 7950

4115 print "PARO EMERG":sleep 1000:tecla$=inkey$

4120 gosub 20000

4150 if ara#=1 then sal3=0:sal4=0:goto 4000

4160 if ent6=1 then sal3=0:sal4=0:goto 4000


4170 if tecla$="6" then goto 540

4171 rem if tecla$="6" then lprint chr$(12):goto 540

4173 if tecla$=chr$(8) then sal3=0:sal4=0:goto 4000

4175 print "6=Sal/Ent=Cont":sleep 1000

4240 goto 4115

4300 if pneto%>heel% then goto 4051:rem heel

4310 sal2=0:print " Ac.";pesoreg#+peso%:gosub 6000:gosub 21000:rem para esperar el cierre de la valvula

4311 if peso%>objetivo# then tempo%=peso%-objetivo#:tempo%=(tempo%/2)

4312 if tempo%>300 then tempo%=30

4313 objetivo#=corte%-tempo%:prea%=tempo%:pre$=str$(prea%):gosub 21000

4320 if ent2=1 then goto 4500

4330 sal3=1:gosub 21000

4340 print "Pta Desc Abierta"

4350 for cuenta%=1 to 10

4360 if ent2=1 then cuenta%=10

4370 sleep 10

4380 next cuenta%

4390 if ent2=1 then goto 4500

4395 if ent4=0 then goto 4400

4396 gosub 20000

4399 if par#=0 then goto 4320

4400 sal4=1:sal3=1:gosub 16000: REM AQUI PONEMOS EL PARO DE DESCARGA

4410 if ent2=0 then 4330

4420 sal4=0:gosub 21000

4500 batches#=batches#+1:pesadas=str$(batches#)

4505 gosub 8000

4510 if psalir$="S" then goto 540

4511 Rem if psalir$="S" then lprint chr$(12):goto 540

4600 if inicio=1 then inicio=0:goto 540

4605 if inicio=0 then desfla$="0":goto 1700

5000 Rem Rutina para espere de cierre de compuerta alimentacion


5010 tempo=val(tieali):rem conteo en tieali

5020 for cierra=1 to tempo

5030 sleep 1

5040 next cierra

5041 if motion%=1 then goto 5041

5050 return

5500 Rem Rutina para cambio de tiempo cierre alimentacion

5501 input "^Clave Cambiar ^";pw$

5502 if password$<>pw$ then return

5510 sal1=0:tempo=val(tieali)

5520 print "Tiempo Alim: ";tempo:sleep 1000

5530 tecla$=inkey$

5540 print "Camb";tempo;" S/N "

5550 if tecla$="N" or tecla$="n" then goto 5610

5560 if tecla$="S" or tecla$="s" then goto 5580

5570 if tecla$<>"N" or tecla$<>"n" or tecla$<>"S" or tecla$<>"s" then goto 5530

5580 input "^Tiempo Alim:^";tempo

5590 if tempo<10 or tempo>9000 then retun

5600 tieali=str$(tempo)

5610 sal1=1

5620 return

6000 Rem Rutina para espere de cierre de compuerta descarga

6010 tempo=val(tiedes):rem conteo en tiedes

6020 for cierra=1 to tempo

6030 sleep 1

6040 next cierra

6050 return

6500 Rem Rutina para cambio de tiempo cierre descarga

6501 input "^Clave Cambiar ^";pw$

6502 if password$<>pw$ then return


6510 sal2=0:tempo=val(tiedes)

6520 print "Tiempo Des.: ";tempo:sleep 1000

6530 tecla$=inkey$

6540 print "Camb";tempo;" S/N "

6550 if tecla$="N" or tecla$="n" then goto 6610

6560 if tecla$="S" or tecla$="s" then goto 6580

6570 if tecla$<>"N" or tecla$<>"n" or tecla$<>"S" or tecla$<>"s" then goto 6530

6580 input "^Tiempo Des.:^";tempo

6590 if tempo<10 or tempo>9000 then retun

6600 tiedes=str$(tempo)

6610 sal2=1

6620 return

7000 print "Tipo de Impresora:":sleep 1000

7010 print "1=40 Col/2=80 Col":kprin$=inkey$

7020 if kprin$=chr$(49) then impresor$="1":return

7030 if kprin$=chr$(50) then impresor$="2":return

7040 goto 7010

7900 sal1=0:sal2=0:sal3=0:sal4=0:sp6auma=ent1:gosub 21000

7903 lprint time$;tab(11);date$;tab(20);"OPERACION MANUAL"

7904 cuentali%=cuentali%+1

7905 if cuentali%>=56 then gosub 7950

7906 print "Operacion Man."

7907 sp6auma=ent1

7910 if ent1=1 then goto 7906

7920 lprint chr$(12):sp6auma=ent1:gosub 21000:goto 540

7950 if impresor$="1" then goto 7970

7951 lprint chr$(14);"INGENIO PANTALEON "

7952 lprint "BASCULA AZUCAR DE EMPAQUE METTLER TOLEDO"

7953 lprint "BULKSCALE SERIE No. 5074092-5EA":lprint chr$(13)

7954 lprint tab(31);"REPORTE DE PESADAS":lprint chr$(10)


7955 lprint "Corte ";corte%;" Kg"

7956 lprint "Preactuado ";prea%;" kg"

7957 lprint "Material ";material$:lprint chr$(10)

7958 lprint "Hora ";tab(16);"Fecha ";tab(33);"Pesada #";tab(50);"Peso Neto";tab(65);"Peso Acum."

7965 cuentali%=12:goto 7980

7970 lprint "INGENIO PANTALEON "

7971 lprint "BASCULA PARA MIEL FINAL METTLER TOLEDO"

7972 lprint "BULKSCALE SERIE No. 5039162-5XZ":lprint chr$(13)

7974 lprint tab(23);"KG";tab(31);"KG"

7975 lprint tab(4);"HORA";tab(12);"PESADA#";tab(22);"PESO";tab(31);"PESO"

7976 lprint tab(22);"NETO";tab(29);"ACUMULADO":lprint chr$(13)

7978 cuentali%=10

7980 return

8000 if pneto%>=0 then goto 8030

8030 peso2%=peso%

8040 propeg%=peso2%-(peso%-pneto%):pesoreg#=pesoreg#+(peso%-propeg%)

8060 valacum$=str$(pesoreg#):pesoacu=str$(pesoreg#):limpia%=1

8070 gosub 9000

8075 if impresor$="1" then goto 8200

8080 rem lprint time$;tab(16);peso%;" ";pneto%;tab(32);batches#;tab(49);(peso%-propeg%);" Kg";tab(64);pesoreg#;" Kg"

8081 lprint time$;tab(16);date$;tab(32);batches#;tab(49);(peso%-propeg%);" Kg";tab(64);pesoreg#;" Kg"

8090 cuentali%=cuentali%+1

8091 if time1$=corte1$ or time1$=corte2$ then gosub 8300

8092 if time1$=corte3$ then gosub 8300

8100 if cuentali%=<56 then return

8110 lprint chr$(12):gosub 7950

8120 return

8200 time1$=left$(time$,5)

8210 date1$=left$(date$,5)

8220 lprint tab(4);time1$;tab(11);batches#;tab(21);(peso%-propeg%);tab(28);pesoreg#

8230 cuentali%=cuentali%+1
8231 if time1$=corte1$ or time1$=corte2$ then gosub 8300

8233 if time1$=corte3$ then gosub 8300

8240 if cuentali%<=56 then return

8250 lprint chr$(12):gosub 7950

8260 return

8300 if cuentali%>=56 then gosub 7950

8310 lprint tab(2);"HORA Y FECHA CIERRE";tab(22);time1$;tab(28);date$:lprint chr$(10)

8320 lprint tab(2);"NOMBRE:";tab(25);"FIRMA:"

8330 lprint chr$(12):gosub 7950

8340 return

9000 sleep 500:print "Espere un Mom."

9005 material$=padr$(material$,2," ")

9010 open "P" for random as #2 len=16

9015 field #2,2 as mate$,12 as tota$,2 as dl$

9020 norecp%=1:ulrecp%=0:sav%=0

9030 while eof(2)=0

9035 get #2,norecp%

9040 if (mate$,2)<>(material$,2) then goto 9090

9045 ulrecp%=999:rem lprint "se guardo por segunda vez"

9050 acumat#=val(tota$)

9054 acu#=acumat#+(peso%-propeg%)

9055 acu$=str$(acu#)

9060 lset tota$=acu$:lset mate$=material$:lset dl$=chr$(13)+chr$(10)

9070 put #2,norecp%

9080 sav%=1

9090 norecp%=norecp%+1

9100 wend

9110 close #2

9115 if sav%=1 then return

9120 open "P" for random as #2 len=16

9125 field #2,2 as mate$,12 as tota$,2 as dl$


9130 norecp%=1:ulrecp%=0

9140 while eof(2)=0

9145 get #2,norecp%

9150 if (mate$,2)<>"00" then goto 9190

9155 if ulrecp%=999 then goto 9190:rem ya se almaceno

9165 peso$=str$(peso%-propeg%)

9170 lset mate$=material$:lset tota$=peso$:lset dl$=chr$(13)+chr$(10)

9175 put #2,norecp%

9180 ulrecp%=999:rem lprint "se guardo por primera vez"

9190 norecp%=norecp%+1

9200 wend

9210 close #2

9220 return

10000 rem Rutina de impresion de reporte final

10010 res$=inkey$

10020 print " Imp Rep S/N "

10030 if res$="S" or res$="s" then goto 11000

10040 if res$="N" or res$="n" then goto 11600

10050 goto 10000

11000 rem LLenado de variables para reporte final

11010 sleep 500:print "Espere un Mom.":total#=0

11120 lprint "REPORTE DE ACUMULADO":lprint chr$(10)

11130 lprint "Hora ";time$;tab(16);"Fecha ";date$

11140 lprint "Numero de Pesadas";batches#:lprint chr$(10)

11150 lprint "Material";tab(15);"Peso Acumulado"

11160 open "P" for random as #2 len=16

11170 field #2,2 as mate$,12 as tota$,2 as dl$

11180 norecp%=1:ulrecp%=0:sav%=0

11190 while eof(2)=0

11200 get #2,norecp%

11220 if (mate$,2)="00" then goto 11260


11230 tot#=val(tota$)

11240 lprint mate$,tota$

11250 total#=total#+tot#

11260 norecp%=norecp%+1

11270 wend

11280 close #2

11290 lprint chr$(10):lprint "ACUMULADO TOTAL:";total#

11500 rem Pregunta si desea repetir impresion

11501 print "Acum. ";total#:sleep 4000

11505 res$=inkey$:print " Repetir S/N "

11510 if res$="S" or res$="s" then goto 11000

11520 if res$="N" or res$="n" then goto 11600

11530 goto 11505

11600 res$=inkey$:print " Borra Ac S/N "

11610 if res$="S" or res$="s" then goto 11640

11620 if res$="N" or res$="n" then goto 11700

11630 goto 11600

11640 gosub 12000

11650 sleep 500

11700 rem lprint chr$(12)

11800 return

12000 rem Borrado de tabla

12001 print "Borrar Datos":sleep 1000:tecla$=inkey$

12002 print " Seguro S/N ":sleep 1000

12003 if tecla$="S" or tecla$="s" then goto 12006

12004 if tecla$="N" or tecla$="n" then goto 12120

12005 goto 12001

12006 input "^Clave ^";pw$

12007 if pass$<>pw$ then return

12008 print "Borrando Acum.":sleep 1000


12010 open "P" for random as #2 len=16

12015 field #2,2 as mate$,12 as tota$,2 as dl$

12020 for i%=1 to 5

12060 lset tota$="000000000000":lset mate$="00":lset dl$=chr$(13)+chr$(10)

12070 put #2,i%

12100 next i%

12110 close #2

12115 batches#=0:pesadas=str$(batches#):pesoreg#=0:pesoacu=str$(pesoreg#)

12120 return

13000 input "^Clave salir ^";pw$

13010 if password$<>pw$ then return

13020 keyboard=2

13030 end

14000 datosplc$=datos$:lprint time$;tab(11);date$;tab(20);"FLUJO CONTINUO"

14001 cuentali%=cuentali%+1:sp7fltr=ent7:gosub 21000

14002 if cuentali%>=56 then gosub 7950

14020 while ent7=0

14040 print " Flujo Continuo "

14050 wend

14060 sal1=0:sal2=0:sp7fltr=ent7:gosub 21000

14070 return

15000 rem Paro de emergencia por pta. alimentacion abierta

15010 sal1=0:sal2=0:sal3=1

15020 sal4=1:gosub 21000

15030 lprint time$;tab(11);date$;tab(20);"PARO DE EMERGENCIA"

15040 cuentali%=cuentali%+1

15050 if cuentali%>=56 then gosub 7950

15060 print "Pta Alim Abierta":sleep 500

15065 if ent3=1 then return

15070 gosub 20000


15100 if ara#=1 then return

15110 if ent6=1 then return

15115 if tecla$=chr$(8) then return

15120 goto 15060

16000 rem Paro de emergencia por pta. descarga abierta

16010 sal1=0:sal2=0:sal3=1

16020 sal4=1:gosub 21000

16030 lprint time$;tab(11);date$;tab(20);"PARO DE EMERGENCIA"

16040 cuentali%=cuentali%+1

16050 if cuentali%>=56 then gosub 7950

16060 print "Pta Desc Abierta":sleep 500

16065 if ent2=1 then return

16070 gosub 20000

16100 if ara#=1 then return

16110 if ent6=1 then return

16115 if tecla$=chr$(8) then return

16120 goto 16060

17000 Rem Rutina para ingreso de corte por turno

17010 print cor1$:sleep 1000:input "^Turno 1^";cor1$

17020 corte1$=left$(cor1$,5)

17030 print cor2$:sleep 1000:input "^Turno 2^";cor2$

17040 corte2$=left$(cor2$,5)

17050 print cor3$:sleep 1000:input "^Turno 3^";cor3$

17060 corte3$=left$(cor3$,5)

17070 return

18000 impre%=1

18010 if sal1=1 then sal1=0 and alim%=1:gosub 21000

18020 if sal2=1 then sal2=0 and desc%=1:gosub 21000

18030 while ent10=0

18040 if impre%=1 then lprint time$;tab(11);date$;tab(20);"Hold Activo"


18050 print "Hold Activo"

18060 impre%=0

18065 sal3=1

18070 wend

18075 sleep 6000:sal3=0

18080 if alim%=1 then sal1=1 and alim%=0:gosub 21000

18090 if desc%=1 then sal2=1 and desc%=0:gosub 21000

18100 return

20000 rem desarmado de datos#

20010 datosplc$=datos$

20020 material$=mid$(datosplc$,1,2)

20030 cort$=mid$(datosplc$,3,4)

20040 pre$=mid$(datosplc$,7,3)

20050 ara#=val(mid$(datosplc$,13,1))

20060 par#=val(mid$(datosplc$,14,1))

20070 stop#=val(mid$(datosplc$,15,1))

20100 return

21000 rem armado de datos$

21001 mater$=material$:if val(material$)>9 then 21009

21005 mater$=mset$(mater$,"0",1)

21009 if len(material$)>2 then mater$=ltrim$(material$)

21010 datosplc$=mset$(datosplc$,mater$,1)

21011 cor$=cort$:if val(cort$)>999 then goto 21019

21015 cor$=mset$(cor$,"0",1)

21019 if len(cort$)>4 then cor$=ltrim$(cort$)

21020 datosplc$=mset$(datosplc$,cor$,3)

21021 pr$=pre$:if val(pre$)>99 then goto 21029

21025 pr$=mset$(pr$,"0",1)

21029 if len(pre$)>3 then pr$=ltrim$(pre$)

21030 datosplc$=mset$(datosplc$,pr$,7)

21040 salida$=str$(sal3):sp2alar=sal3

21050 salida$=ltrim$(salida$):datosplc$=mset$(datosplc$,salida$,10)
21060 entrad$=str$(ent3):sp3lsal=ent3

21070 entrad$=ltrim$(entrad$):datosplc$=mset$(datosplc$,entrad$,11)

21080 entrad$=str$(ent2):sp4lsde=ent2

21090 entrad$=ltrim$(entrad$):datosplc$=mset$(datosplc$,entrad$,12)

21100 arranq$=str$(ent6)

21110 arranq$=ltrim$(arranq$):datosplc$=mset$(datosplc$,arranq$,13)

21120 parada$=str$(sal4)

21130 parada$=ltrim$(parada$):datosplc$=mset$(datosplc$,parada$,14)

21140 datos$=datosplc$

21200 datlin!=(sp2alar*128 xor sp3lsal*64)

21210 datlin!=(datlin! xor sp4lsde*32 xor sp5natf*16)

21220 datlin!=(datlin! xor sp6auma*8 xor sp7fltr*4)

21230 datlin!=(datlin! xor sp8natp*2 xor sp1nata)

21290 return

25000 tecla$=inkey$

25010 print "Camb";corte%;" S/N? "

25020 if tecla$="N" or tecla$="n" then goto 25040

25025 if tecla$="S" or tecla$="s" then goto 25035

25030 if tecla$<>"N" or tecla$<>"n" or tecla$<>"S" or tecla$<>"s" then goto 25000

25035 input "^Corte: ^";corte%

25040 if corte%<=0 or corte%>1000 then goto 25000:rem cambiar limite corte

25045 return

25050 tecla$=inkey$

25060 print "Camb";prea%;" S/N? "

25070 if tecla$="N" or tecla$="n" then goto 25090

25075 if tecla$="S" or tecla$="s" then goto 25085

25080 if tecla$<>"N" or tecla$<>"n" or tecla$<>"S" or tecla$<>"s" then goto 25050

25085 input "^Preact.: ^";prea%

25090 if prea%=0 or prea%>100 then goto 25050

25095 return

25100 tecla$=inkey$

25110 print "Camb";mate%;" S/N "

25120 if tecla$="N" or tecla$="n" then goto 25140


25125 if tecla$="S" or tecla$="s" then goto 25135

25130 if tecla$<>"N" or tecla$<>"n" or tecla$<>"S" or tecla$<>"s" then goto 25100

25135 input "^Mat.: ^";mate%

25140 if mate%=0 or mate%>99 then goto 25100

25150 return

Anda mungkin juga menyukai