Author Topic: Customise Trilogi Please  (Read 8066 times)

karen

  • Newbie
  • Posts: 18
  • I love YaBB 1G - SP1!
    • View Profile
Customise Trilogi Please
« 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

« Last Edit: December 31, 1969, 04:00:12 PM by -1 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Customise Trilogi Please
« Reply #1 on: December 09, 2002, 04:01:08 PM »
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



      
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

karen

  • Newbie
  • Posts: 18
  • I love YaBB 1G - SP1!
    • View Profile
Re: Customise Trilogi Please
« Reply #2 on: December 11, 2002, 12:45:15 PM »
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
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Customise Trilogi Please
« Reply #3 on: December 11, 2002, 01:36:45 PM »
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
    
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS