Download User`s Manual Template
Transcript
Appendix 2 1. Read desired temperature setting (S) from a potentiometer connected to A/D #5. 2. Read current air temperature (T) from sensor attached to A/D #1 (T) 3. Turn ON cold air-conditioner (output #1 with labelname: OUT1) if T > S by more than 1.5 oC. 4. ON heater if (output #2) if S > T by more than 1.5 oC. 5. Turn OFF both heater and cold air-conditioner if T is within + 1.5 oC of S. Parameters: Full scale A/D is 4096 Range of Set Point: Range of Sensor: A/D #5 = 0 A/D #5 = 4096 +16.0 °C +30.0 °C ADC#1 = 0 ADC#1 = 4096 -10.0 °C +50.0 °C Fn_#20 Clk:1.0 [dCusf] Custom Function #20 S = ADC(5)*(300-160)/4096 +160 T = ADC(1)*(500+100)/4096 -100 IF S -T > 15 SETIO OUT1 ELSE CLRIO OUT1 ENDIF ‘Convert to ‘Convert to o o Cx10 Cx10 ‘Cold Air-conditioning ON ‘if T is hotter by 1.5 o C IF S-T < -15 SETBIT OUTPUT[1],1 ELSE CLRBIT OUTPUT[1],1 ENDIF ‘ Heater ON ‘if T is colder by 1.5 o C Comments: Since TRiLOGI Version 6.x does not support floating point computation, in order to handle decimal value (±1.5° C) in this application we use a unit integer to represent 0.1 quantity. All temperature readings are x10 times. Hence 16.0°C is A2-12