Internet PLC Forum
General => Technical support => Topic started by: karen on December 09, 2002, 12:03:56 PM
-
U= ADC(1)/10 ?'this is the input from the lm35 temprature chip
IF U < 60 'turn heater on
SETIO Heater
SETLCD 0,1,CHR$(1) ?' clear screen
SETLCD 1,1,"_______AURIUM_______ "
SetLCD 2,1, ""
SetLCD 3,1, " Warming Au Solution"
SETLCD 4,1,"___________________"+CHR$(126)
ENDIF
IF U > 63
CLRIO Heater
T = T+1 ?' Variable T is used as a timer.
A = T/3600 ? ? ? ? ?' Hour
B = (T MOD 3600)/60 ' Minute
C = T MOD 60 ? ? ? ?' seconds.
T$ = STR$(A)+":"+STR$(B)+":"+STR$(C)+" ? ? "
SETLCD 0,1,CHR$(1) ?' clear screen
SETLCD 1,1,"___ELECTROFORMING___"
SetLCD 2,1," ? ?Plating Time ? ?"
SETLCD 3,1," ? ? ?"+T$
SETLCD 4,1,"____________________"
ENDIF
Y=665+J 'set the speed of the motor
g = x - (j+80) 'adjust the current
SETDAC 1,y 'motor control
SETDAC 2,g 'set the current
IF m = 1 and T >= 25200 ? ' 7 hours = 25200 seconds.
CLRIO Motor
CLRIO Heater
CLRIO CurrentRly
CLRIO Temp_Cont
SETLCD 2,1," Process Completed!"
SETLCD 3,1," ?Remove Copings "
SetDac 2,3800
ENDIF
IF m = 2 and T >= 32400 ? ' 9 hours = 32400 seconds.
CLRIO Motor
CLRIO Heater
CLRIO CurrentRly
CLRIO Temp_Cont
SETLCD 2,1," Process Completed!"
SETLCD 3,1," ?Remove Copings "
SetDac 2,3800
ENDIF
i wonder if you can help me with this problem that i have i have removed the relay thermostat that i had and replaced it with the lm35 into the adc(1) this should make reading the tempreture more accurate. Now for the problem. ?i want to show the first screen warming until the temp is reached. then i want to show the screen palting and the timer to start but i also need the temp to be consistant so cutting in at 58 and cut out at 62 how can i customise this to give me this please
thanks Karen
-
I assume this custom function is executed once a second. Your routine clear the screen every time it executes even if the value of U does not change and that may give it a "blinking" effect. A better way to do is to use a variable (say any DM) to keep the current screen status and if there is no change in the screen display then don't clear screen. The screen action is only done at the end of the routine. The turning on and off the heater need not be tied to the screen display. You can test for U >= 58, U >60, U > 63 etc for the heater control.
E.g. Use DM[100] to keep last display, and
DM[101] to indicate the new display.
IF U < 60
DM[101] = 1 ' to display screen one.
..
..
..
ENDIF
IF DM[101] <> DM[100]
SETLCD 0,1,CHR$(1) ' Clearscreen
ENDIF
IF DM[101] = 1
... ' to display "Warming Au Solution"
ELSE IF DM[101] = 2 ' to display "Electroforming message".
.....
ENDIF
ENDIF
-
sorry for causing u more trouble i am still not sure how this works i just want to show the warming screen once while the temp is low after that i dont want to display it any more just the plating screen but i still want the heater to cut in and out while palting takes place .
thanks
-
Why can't you use two seperate custom function, one for the display and another for controlling the heater? That way it may be less confusing in your logical thinking. You can read an ADC as often as you like and at two different custom functions.
Fn_#1 ' heater control function
---------
' SETIO heater or CLRIO Heater based on the
' value of ADC(1)/10
Fn_#2 ' display function
--------
IF ADC(1)/10 < 60
IF DM[100] = 1 ' already displaying the "warming"
message.
RETURN
ELSE
DM[100] = 1 ' remember that warming is being displayed.
SETLCD 0,1,CHR$(1) ' clear screen
SETLCD 1,1,"_______AURIUM_______ "
SetLCD 2,1, ""
SetLCD 3,1, " Warming Au Solution"
SETLCD 4,1,"___________________"+CHR$(126)
RETURN
ENDIF
ENDIF
IF ADC(1)/10 > 63
IF DM[100] <> 2 ' already displayed the headlines.
DM[100] = 2 ' remember the state.
SETLCD 0,1,CHR$(1) ' clear screen
SETLCD 1,1,"___ELECTROFORMING___"
SetLCD 2,1," Plating Time "
SETLCD 3,1," "+T$
SETLCD 4,1,"____________________"
ENDIF
T = T+1 ' Variable T is used as a timer.
A = T/3600 ' Hour
B = (T MOD 3600)/60 ' Minute
C = T MOD 60 ' seconds.
T$ = STR$(A)+":"+STR$(B)+":"+STR$(C)+" "
SETLCD 3,1," "+T$
ENDIF