Electronica
'Ramclear
Contrast 550
Set Debug Off
Dim TX As Integer, TY As Integer
Dim KeypadNum As Long
Dim PosicionD As Byte
Dim PANTALLA_MANDOS As Byte
Dim CT As Integer
' VARIABLES DE TIEMPOS DENTRO DE Ladder
Const RET_INYECCION As Byte = 0
Const INYECCION As Byte = 1
Const ENFRIAMIENTO As Byte = 2
Const PAUSA As Byte = 3
Const SPRAY As Byte = 4
Usepin24,Out,Cerrar_mordaza
Usepin 25,Out,Bajar_dosificador
Usepin 26,Out,V_Spray
Usepin 27,Out,Bomba
Usepin 28,Out,Alarma
Usepin 29,Out,Abrir_mordaza
Usepin 30,Out,Subir_dosificador
Usepin 31,Out
Usepin 56,In,Mol_abierto
Usepin 57,In,Mol_cerrado
Usepin 58,In,Conteo_dosif
Usepin 59,In,Start
Usepin 60,In,Stop
Usepin 61,In,Sw_emergencia
Usepin 62,In,Baja_temp
Usepin63,In,Guardas
Alias M0 = AUTOMATICO
Alias M1 = P_BOMBA
Alias M2 = P_ABRIR_MOLDE
Alias M3 = P_INYECCION
Alias M4 = P_SPRAY
Alias M7 = P_CICLO
Set Outonly On
Set Ladder On
Set Pad 0,4,5
MANDOS
PANTALLA_MANDOS=1
Do
Delay 500
If PANTALLA_MANDOS=1 Then
If _M(0) = 1 Then ' pulsador AUTOMATICO
Font 0,0
Glocate 217,129
Dprint "AUTOMATICO"
Elseif _M(0) = 0 ThenFont 0,0
Glocate 217,129
Dprint " MANUAL "
Style 0,0,0
Endif
If _M(1) = 1 Then ' pulsador BOMBA HIDRAULICA
Font 0,0
Glocate 43,59
Dprint "ON "
Elseif _M(1) = 0 Then
Font 0,0
Glocate 43,59
Dprint "OFF"
Style 0,0,0
Endif
If _M(3) = 1 Then ' pulsador INYECCION
Font 0,0
Glocate 43,129
Dprint "ON "
Elseif _M(3) = 0 ThenFont 0,0
Glocate 43,129
Dprint "OFF"
Style 0,0,0
Endif
If _M(4) = 1 Then ' pulsador SPRAY
Font 0,0
Glocate 43,164
Dprint "ON "
Elseif _M(4) = 0 Then
Font 0,0
Glocate 43,164
Dprint "OFF"
Endif
If _M(7) = 1 Then ' pulsador ciclo
Font 0,0
Glocate 43,199
Dprint "ON "
Elseif _M(7) = 0 Then
Font 0,0
Glocate 43,199
Dprint"OFF"
Endif
If _P(61) = 1 Then 'mensaje de alarma sw emergencia
Font 0,0
Glocate 210,180
Dprint " "
Elseif _P(61)= 0 Then
Font 0,0
Glocate 210,180
Dprint "SW EMERGENCIA"
Endif
If _P(62) = 1 Then 'mensaje de alarma sw temperatura baja
Font 0,0
Glocate 220,212
Dprint "BAJA TEMP."
Elseif _P(62) = 0 Then
Font 0,0
Glocate220,212
Dprint " "
Endif
If _P(63) = 1 Then 'mensaje de alarma guardas
Font 0,0
Glocate 230,195
Dprint " "
Elseif _P(63) = 0 Then
Font 0,0
Glocate 230,195
Dprint "GUARDAS"
Endif
Endif
If PANTALLA_MANDOS = 0 Then
Font 0,0
Glocate 230,114
Dprint Dec8 _D(10) 'CONTADOR DE PRODUCCION
Glocate 230,194
Dprint Dec8_D(11) 'TOTALIZADOR
Endif
Loop
Sub MANDOS()
Cls
Delay 500
Font 0,0
Style 0,0,0
Menuset 0,2,210,125,300,150
Menutitle 0,10,4,""
Glocate 85,50
Gprint " BOMBA"
Glocate 85,66
Gprint "HIDRAULICA"
Glocate 85,170
Gprint "SPRAY"
Glocate 85,135
Gprint "INYECCION"
Glocate 85,100
Gprint "ABRIR MOLDE"
Menuset 1,2,30,55,75,80
Menutitle 1,12,4,""
Menuset2,2,30,90,75,115
Menutitle 2,12,4,"PUSH"
Menuset 3,2,30,125,75,150
Menutitle 3,12,4,""
Menuset 4,2,30,160,75,185
Menutitle 4,12,4,""
Menuset 6,2,30,195,75,220
Menutitle 6,12,4,""
Glocate 85,200
Gprint "CICLO"
Glocate 215,110
Gprint "AUTO/MANUAL"
Style 2,0,0
Glocate 95,15
Gprint "MANDOS DE CONTROL"
Linestyle 0
Dotsize 0,0
Color 1
Box 85,10,220,30
Menuset 5,2,225,55,285,80Menutitle 5,9,4,"TIMERS"
Style 2,0,0
Glocate 230,165
Gprint "ALARMAS"
Font 4,0
Style 0,0,0
On Pad Gosub SWMANDOS
End Sub
SWMANDOS:
TX = Getpad(2) ' con estos dos comandos pocionan donde se pulsa en la pantalla
TY = Getpad(2)
If Menucheck(0, TX, TY) = 1 Then
FlashMenu 0
Pulsout 20,150
If _M(0) = 1 Then ' PULSADOR AUTOMATICO
_M(0) = 0
Else...
Regístrate para leer el documento completo.