background image

Sample 7: Contrast Adjustment

This program demonstrates how to adjust the screen contrast at runtime.  The screen contrast is stored 

in the EEPROM at addres &HFFF.

#include "CT18XX"

Dim CT18_cont_value As Byte

CT18_cont_value = Eeread(&hfff,1)

If CT18_cont_value = &hff Then

CT18_cont_value = 150

Endif

Ct18contrast CT18_cont_value

Box 10,20,310,100

Box 10,140,310,230

Font 5,1

Glocate 120,50

Gprint "Co"

Glocate 120,175

Gprint "Contrast -"

Ct18beep 30

Font 2,0

On Pad Gosub TouchOccur

' ********************* Main Loop ************************

'

Do

Locate 0,0

Print "20",Hp(Rtcread(6),2,1),"-",Hp(Rtcread(5),2,1),"-",Hp(Rtcread(4),2,1), "  

", Hp(Rtcread(2),2,0),":",Hp(Rtcread(1),2,1),":",Hp(Rtcread(0),2,1)

Locate 24,0

Print "Contrast : ",Dp(CT18_cont_value,3,0)

Wait 1000

Loop

TouchOccur:

_TouchPosx = Sys(10)

_TouchPosy = Sys(11)

If _TouchPosy > 120 Then

CT18_cont_value = CT18_cont_value - 1

Ct18contrast CT18_cont_value

Eewrite &hfff,CT18_cont_value,1

Else

CT18_cont_value = CT18_cont 1

Ct18contrast CT18_cont_value

Eewrite &hfff,CT18_cont_value,1

Endif

Ct18beep 30

Return

End

Comfile Technology, Inc

CT1820 User's Manual

77 Of 93

Содержание CUTOUCH CT1820

Страница 1: ...An LCD Touch Screen with an Integrated BASIC Ladder Logic Controller CUTOUCH CT1820 Last Updated 2015 06 08 www ComfileTech com Comfile Technology Inc CT1820 User s Manual 1 Of 93 ...

Страница 2: ...B 200KB 3 The data memory has been reduced 28KB 7KB 4 FRAM non volatile memory has been added 32KB 5 The number of communication ports have been increased 1 to 3 6 I O can be extended with Comfile Technology s MODPORT Field I O 7 The enclosure is rated waterproof IP65 CT1721C CT1820 Program Memory 80KB 200KB Data Memory 28KB 7KB FRAM Non volatile Memory None 32KB Communication Ports 1 3 Total I O ...

Страница 3: ...2 485 Communication 34 LCD Contrast Adjustment 35 Chapter 4 Touch Input 36 Menu System Library 37 Menu Commands 37 Processing Touch Input 42 Touch Calibration 44 Setting the RTC s Date and Time 46 Chapter 5 ModPort I O Expansion 47 Using the CT2820 with the Modport 48 Modport Function Library 49 Modport Test Program 54 Chapter 6 Sample Programs 56 Sample 1 57 Sample 2 58 Sample 3 59 Sample 4 Numer...

Страница 4: ...Chapter 1 Overview Comfile Technology Inc CT1820 User s Manual 4 Of 93 ...

Страница 5: ... NPN TR Analog Inputs 8 8 High Speed Counter 2 None PWM 6 3 External Interrupts 4 None Total 82 50 Front Panel IP65 Rating No Yes Download Cable DSUB 9 PIN 3 PIN Battery Backup Yes No Use FRAM Instead RTC and RTC Battery Built in Built in The CT1820 does not contain a backup battery for the data memory To retain data between power cycles please use the FRAM non volatile memory instead Comfile Tech...

Страница 6: ...ts from a user The Cutouch provides a new approach to employing a touchscreen and PLC in the automation field The cost of a separate touchscreen LCD and PLC can be significant but the Cutouch provides and integrated solution at a relatively low cost Futhermore the Cutouc is programmed is BASIC a language that is quite easy to learn and use Comfile Technology Inc CT1820 User s Manual 6 Of 93 ...

Страница 7: ...The CT1820 s Appearance Comfile Technology Inc CT1820 User s Manual 7 Of 93 ...

Страница 8: ...Comfile Technology Inc CT1820 User s Manual 8 Of 93 ...

Страница 9: ...Comfile Technology Inc CT1820 User s Manual 9 Of 93 ...

Страница 10: ... Environment used to program the CT1820 in both BASIC and Ladder Logic It is a free download available from www ComfileTech com To program the CT1820 be sure to include CT18XX at the top of the source file Comfile Technology Inc CT1820 User s Manual 10 Of 93 ...

Страница 11: ...d cable must be used to connect the CT1820 to the host PC CT1820 Download Cable CT1721C Download Cable The download cable is not included as only one is needed to download to many devices Please be sure to add a download cable to your first purchase The host PC end of of the download cable is a DB 9 female connector and the CT1820 end is a 3 pin Molex SPOXTM 5268 female connector If the host PC do...

Страница 12: ...Comfile Technology Inc CT1820 User s Manual 12 Of 93 ...

Страница 13: ...to the CT1820 via the download cable open Cubloc Studio and choose Setup PC int erface setup from the menu Select the host PC s serial port Com Port that is connected to the CT1820 Comfile Technology Inc CT1820 User s Manual 13 Of 93 ...

Страница 14: ... download the currently open program to the CT1820 Once a program is compiled and downloaded to the CT1820 it cannot be retrieved and decompiled back into source code form Comfile Technology Inc CT1820 User s Manual 14 Of 93 Clicking this icon will save the source code compile and initiate downloading ...

Страница 15: ...be lost The firmware is essentially the CT1820 s operating system At the time of manufacturing the latest available firmware is downloaded to the CT1820 If new firmware is released a new version of Cubloc Studio will also be released When downloading with the latest version of Cubloc Studio a prompt may appear to update the CT1820 s firmware Comfile Technology Inc CT1820 User s Manual 15 Of 93 ...

Страница 16: ... Pack The CT1820 Start Pack is recommended for initial CT1820 purchases It contains all the necessary accessories to take full advantage of the CT1820 s features Comfile Technology Inc CT1820 User s Manual 16 Of 93 ...

Страница 17: ...Comfile Technology Inc CT1820 User s Manual 17 Of 93 ...

Страница 18: ... 40 pin terminal block NOTE The CT1820 Start Pack does not include a USB to serial adapter cable If your host PC does not have a built in RS 232 serial port you may need to buy a USB to serial adapter cable separately Comfile Technology Inc CT1820 User s Manual 18 Of 93 ...

Страница 19: ...Chapter 2 I O Comfile Technology Inc CT1820 User s Manual 19 Of 93 ...

Страница 20: ...careful attention to the polarity Power consumption of the CT1820 with no I O load is approximately 3 watts Please do not attempt to disassemble the the CT1820 as it can result in unintentional damage to the the LCD and other components Products that have been tampered with will not receive warranty or service benefits Comfile Technology Inc CT1820 User s Manual 20 Of 93 ...

Страница 21: ... diode If the load is a relay this must be connected to the positive terminal The input circuit is illustrated below The output circuit is illustrated below If the load is inductive such as a relay please be sure to connect the positive terminal to the V pin This can help to eliminate sparking when switching Warning Please refrain from wiring while power is connected to avoid shorts and subsequent...

Страница 22: ...nputs and 16 outputs as depicted in the following image Cables and terminal block are sold separately The Start Pack includes a 1 meter cable but 0 5 meter 2 meter and 5 meter cables are also available Comfile Technology Inc CT1820 User s Manual 22 Of 93 ...

Страница 23: ...creates a path to ground V Built in protection diode If the load is a relay this must be connected to the positive terminal Pin assignments are as follows The input and output configuration is described in the preceding pages Please do no use unassigned pins e g Low 56 This pin is not assigned Warning Please refrain from wiring while power is connected to avoid shorts and subsequent damage to the ...

Страница 24: ...ng program outputs pulses on channels 9 10 and 11 The PWMOff command can be used to stop a PWM channel Low 43 Low 44 Low 45 Pwm 9 950 1024 Pwm 10 750 1024 Pwm 11 450 1024 The PWM output is an open collector transistor output It can be used in the configuration below to control the brightness of an LED Comfile Technology Inc CT1820 User s Manual 24 Of 93 ...

Страница 25: ... connection Channel Terminals Description RS 232 Channel 1 RX TX Channel 1 RS 232 Channel 2 RX TX Channel 2 RS 485 Channel 3 4 4 SG Channel 3 Modport or other RS 485 connection 5V 5V 5V 0 25A Output generated internally by the CT1820 Comfile Technology Inc CT1820 User s Manual 25 Of 93 ...

Страница 26: ...on 0 3 0 20mA For reading current signals 4 7 0 10VDC For reading voltage signals Warning Please do not exceed the specified current and voltage ranges or the device may become damanged Use the download port to connect the 3 pin download cable as shown below Comfile Technology Inc CT1820 User s Manual 26 Of 93 ...

Страница 27: ... Current At least 2mA Input Impedance 2 2KΩ 24VDC All output pins are NPN transistor outputs Output Relay Specifications Output Voltage Range 5 30VDC Recommended Operating Voltage 6 27VDC Maximum Switching Frequency 100Hz Maximum Current 250mA Pin Minimum Current 10mA Pin High speed counter and external interrupt features are not supported Comfile Technology Inc CT1820 User s Manual 27 Of 93 ...

Страница 28: ... displacement of objects without any physical contact with the object They are used quite often in the field of automation The following instructions show how to connect the 2 wire and 3 wire type DC 2 Wire Model Sensor output connected in reverse Comfile Technology Inc CT1820 User s Manual 28 Of 93 ...

Страница 29: ...Comfile Technology Inc CT1820 User s Manual 29 Of 93 ...

Страница 30: ...DC 3 Wire Model PNP type Sensor output connected in reverse DC 3 Wire Model NPN type Sensor output connected in reverse Comfile Technology Inc CT1820 User s Manual 30 Of 93 ...

Страница 31: ...ers D Data Region D0 99 16 bits 1 word For Data storage P M and F are accessed in bit units while T C and D are accessed in word units However P M and F can also be accessed in word units using WP WM and WF respectively Relay Register Designation Range Units Feature WP WP0 7 16 bits 1 word For accessing P in word units WM WM0 WM63 16 bits 1 word For accessing M in word units Lower numbered designa...

Страница 32: ...Chapter 3 Command Reference Comfile Technology Inc CT1820 User s Manual 32 Of 93 ...

Страница 33: ...channel Not the I O pin number from which to read Reads the value from analog input channel channel and stores the result to variable The CT1820 8 10 bit analog input channels Channels 0 3 are 0 20mA current analog inputs Channels 4 7 are 0 10VDC voltage analog inputs A ADIn 4 Read from analog input channel 4 Comfile Technology Inc CT1820 User s Manual 33 Of 93 ...

Страница 34: ...Data can be stored from addresses 0 H7FFF a total of 32KB The data will be retained between power cycles and no delay is required after a write FramWrite 14 HFF Writes HFF to address 14 FramRead variable FramRead address variable Variable to which the results will be stored address Address to read the data from Reads one byte of data from the FRAM at address address and stores the result in variab...

Страница 35: ...59 1 0 Minutes 101 Minutes 100 Minutes 0 59 2 0 12 24 AM PM Hours 101 Hours 100 Hours 0 23 3 0 0 0 0 0 Day of the week 1 7 1 Sun 7 Sat 4 0 0 Day 101 Day 100 Day 1 31 5 Century 0 0 Month 101 Month 100 Month 1 12 6 Year 101 Year 100 Year 0 99 Address 0 stores the number of seconds in the RTC s current time The data is stored as binary coded decimal BCD so the first 4 bits store the 101 digit while t...

Страница 36: ...r Do i RTCRead 0 Debug Goxy 1 1 Hex2 i Sec i RTCRead 1 Debug Goxy 1 2 Hex2 i Min i RTCRead 2 And h3f Debug Goxy 1 3 Hex2 i Hour i RTCRead 3 Debug Goxy 1 4 Hex2 i Day i RTCRead 4 Debug Goxy 1 5 Hex2 i Date i RTCRead 5 Debug Goxy 1 6 Hex2 i Month i RTCRead 6 Debug Goxy 1 7 Hex2 i Year Wait 500 Loop The results of this example are displayed in the Cubloc Studio debug terminal Comfile Technology Inc C...

Страница 37: ...Cubloc Studio From Cubloc Studio s menu choose File Store Current Time to CT1 820 RTC and the PC s current date and time will be stored to the CT1820 s RTC The CT18XX series RTC is battery powered so in between power cycles the RTC s date and time continue to increment However the RTC is not 100 accurate and if used for an extended period of time a drift may become apparent and will need to be re ...

Страница 38: ... audio feedback in the form of beeps and tones CT18Beep CT18Beep value value Integer variable or constant less than 255 Generates a beep To generate an adequate feedback beep on a touch event use a value between 20 and 50 Comfile Technology Inc CT1820 User s Manual 38 Of 93 ...

Страница 39: ...op bits receiveSize Receive buffer size Maximum 1024 bytes sendSize Send buffer size Maximum 1024 bytes Opens a serial port for use This command called before any data can be read from or written to the serial port Opencom 1 115200 3 80 80 Open Channel 1 By include CT18XX channel 3 can be used for RS 485 for communicating with RS 485 peripherals such as Comfile Technology s ModPort field I O contr...

Страница 40: ...ults set between 130 and 160 This value is stored in the EEPROM at address HFFF The following program shows how this value can be read and corrected to ensure an appropriate value Dim Cont_value As Byte Cont_value EERead hfff 1 If Cont_value 100 Or Cont_value 200 Then Ensure an appropriate value Cont_value 150 EndIf CT18Contrast Cont_value Comfile Technology Inc CT1820 User s Manual 40 Of 93 ...

Страница 41: ...Chapter 4 Touch Input Comfile Technology Inc CT1820 User s Manual 41 Of 93 ...

Страница 42: ...ommand creates a new button with an individual style location and size The MenuTitle command can be used to give the menu button a caption and the MenuCheck commands can be used to determine if a button has been touched Each button s status can be changed at any time by calling the MenuSet command and each button can be given a different function on a different screen resulting in virtually an unl...

Страница 43: ...nd lower right corners of the button respectively MenuReverse MenuReverse index index Menu index number This command causes the menu button identified by index to have it s colors reversed for visual feedback This is useful to provide visual feedback to a user indicating that a menu button has been touched MenuSetClear MenuSetClear Clears all menu buttons on the screen Call this before creating a ...

Страница 44: ...his command is exactly the same as the MenuReverse command but it used for buttons declared with the MenuSet2 command This command is not available in the CT1712C MenuTitle MenuTitle index x y string index Menu index number x y Coordinates of the caption from the button s top left corner string The caption to display MenuSet only draws the button itself Use the MenuTitle command to set the button ...

Страница 45: ...heck 0 TX1 TY1 1 Then Menureverse 0 Beep 18 180 End If Menu variable Menu index coordinate variable Variable to store the results 1 selected 0 unselected index Menu index number coordinate Coordinate to check 0 x1 1 y1 2 x2 3 y2 This function can be used to inspected the coordinates of a given menu button created coordinate 0 will read the x coordinate of the top left corner x1 1 will read the y c...

Страница 46: ...Pad Gosub GETTOUCH Menuset2 0 3 120 155 195 200 Menutitle 0 20 14 RESET Do Locate 15 6 Print DEC5 I Incr I Delay 200 Loop GETTOUCH TX1 Sys 10 TY1 Sys 11 Locate 0 0 Print Dec TX1 Dec TY1 If Menucheck 0 TX1 TY1 1 Then Menureverse2 0 3 Notice the 2 at the end of this command Ct18beep 20 Audio feedback I 0 End If Return Comfile Technology Inc CT1820 User s Manual 46 Of 93 ...

Страница 47: ...en a touch event occurs a routine called TouchInput will be called 2 When a touch event occurs execution will branch to this location The X and Y coordinates of the touch can be ready using the Sys 10 and Sys 11 function calls respectively 3 Draw a point on the display at the location where the touch occurred This method is different from the CT1721C as described below 1 Using Set Pad is not neces...

Страница 48: ...ust this value to change the screen contrast On Pad Gosub TouchInput Menuset 0 2 8 16 87 63 Menutitle 0 13 13 Start Menuset 1 2 96 16 176 63 Menutitle 1 13 13 End Menuset 2 2 184 16 264 63 Menutitle 2 13 13 Restart Low 18 Do Loop TouhcInput TX1 Sys 10 TY1 Sys 11 Circlefill TX1 TY1 10 If Menucheck 0 TX1 TY1 1 Then Menureverse 0 CT18beep 20 Audio feedback End If If Menucheck 1 TX1 TY1 1 Then Menurev...

Страница 49: ...d in the CT1820 s EEPROM so the calibration will be retained even if the CT1820 is powered off The PC s current date and time will also be synchronized with the CT1820 s RTC After the calibration is finished the screen contrast can be adjusted The screen contrast values will be written to EEPROM address HFFF and can be read at runtime if necessary Displays the current date and time Increase the sc...

Страница 50: ...can be read and assigned at runtime as shown below CT18Contrast EERead HFFF 1 To ensure the value in the EEPROM represents a usable value use the following code to filter out any values that may be too bright or too dark Dim Cont_value As Byte Cont_value EERead hfff 1 If Cont_value 100 Or Cont_value 200 Then Set and appropriate value if needed Cont_value 150 Endif CT18Contrast Cont_value Comfile T...

Страница 51: ... CT1820 s RTC s date and time to that of the PC running Cubloc Studio After setting the date and time the CT1820 will execute a program that can be used to adjust the screen contrast The screen contrast will be saved to the EEPROM at address HFFF and can be read to set the screen contrast at runtime Comfile Technology Inc CT1820 User s Manual 51 Of 93 ...

Страница 52: ...Chapter 5 ModPort I O Expansion Comfile Technology Inc CT1820 User s Manual 52 Of 93 ...

Страница 53: ...It can be purchased from http www comfiletech com modport aspx The CT2820 can be connected to the Modport to expand its I O capabilities The CT1820 features a library of built in commands to make it simple and easy to communicate with the Modport MD ADIN4 MD THRT4 MD DAOUT2 MD DORL8 Please refer to the illustration below to connect the CT1820 to the Modport T1820 C Comfile Technology Inc CT1820 Us...

Страница 54: ...dule RelayNumber Index of the individual relay 0 7 OnOff Whether to turn the relay on or off on 1 off 0 Command to turn on off an individual relay on the MD DORL8 output relay module MPRelay 1 3 1 Turn on module 1 relay 3 MD DOSO8 8 pin DC Source Output Module MPSource ID PinNumber OnOff ID The ID of the module PinNumber Index of the individual pin 0 7 OnOff Whether to turn the pin on or off on 1 ...

Страница 55: ...pin on the MD DOSI8 DC sink output module MPSink 1 2 1 Turn on module 1 pin 2 MD DIDC8 8 pin DC Input Module Variable MPIn ID PinNumber ID The ID of the module PinNumber Index of the individual pin 0 7 Reads the state of a pin on the MD DIDC8 module The value read is stored in Variable A MPIn 2 3 Read pin 3 of module 2 and store the results in A Comfile Technology Inc CT1820 User s Manual 55 Of 93...

Страница 56: ...s returned If the temperature is below the lower threshold 1111 is returned The value must be divided by 10 to obtain the actual temperature For example the value 254 represents a temperature of 25 4 C Negative temperatures are indicated with a most significant bit of 1 Note that this is not 2 s complement Please see the MD THRT4 s documentation for more information A MPThIn 2 1 Read temperature f...

Страница 57: ... MPADIn 2 3 Read from module 2 channel 3 and store value in A MD HADIN4 High Resolution 4 Channel analog input module Variable MPHADIn ID Channel ID The ID of the module Channel The number of the channel to read 1 4 Reads from one of the 4 channels on the MD HADIN4 module If the module cannot be found 199 999 is returned In 1 5V mode 111 111 is returned if voltage is less than 1V and 222 222 is re...

Страница 58: ...a MD DAOUT2 module MPDAOutV 1 2 B Outputs voltage B on module 1 channel 2 MD DAOUT2B Digital to analog current output module MPDAOutA ID Channel OutputValue ID The ID of the module Channel The channel to output to 1 or 2 OutputValue Integer value representing the current to output 0 60000 Outputs a current on one of the channels of a MD DAOUT2 module MPDAOutA 1 2 B Outputs current B on module 1 ch...

Страница 59: ...ad Gosub TouchOccur Main Do Loop Locate 1 1 Print MD DIDC8 Input Status Locate 3 3 Print 7 6 5 4 3 2 1 0 Locate 3 4 Print Do Locate 2 5 Print hex2 MPin 1 7 hex2 MPin 1 6 hex2 MPin 1 5 hex2 MPin 1 4 hex2 MPin 1 3 hex2 MPin 1 2 hex2 MPin 1 1 hex2 MPin 1 0 MPsource 2 0 MPin 1 0 MPsource 2 1 MPin 1 1 MPsource 2 2 MPin 1 2 MPsource 2 3 MPin 1 3 MPsource 2 4 MPin 1 4 MPsource 2 5 MPin 1 5 Comfile Techno...

Страница 60: ...1 Sys 11 Pset TX1 TY1 Ct18beep 10 Return Comfile Technology s input simulator is used in this example to make it easy to toggle and test inputs The input simulator can be purchased from http www comfiletech com inputsimulatoer aspx Comfile Technology Inc CT1820 User s Manual 60 Of 93 ...

Страница 61: ...Chapter 6 Sample Programs Comfile Technology Inc CT1820 User s Manual 61 Of 93 ...

Страница 62: ...uded with the Cubloc Studio installation 3241 Simply cut and past this code into Cubloc Studio to give it a try include CT18XX Dim I As Integer Ct18contrast 150 LCD contrast setting Do Locate 15 6 Print DEC5 I Incr I Delay 200 Loop Comfile Technology Inc CT1820 User s Manual 62 Of 93 ...

Страница 63: ...t 550 On Pad Gosub GETTOUCH Menuset 0 2 120 155 195 200 Menutitle 0 20 14 RESET Do Locate 15 6 Print DEC5 I Incr I Delay 200 Loop GETTOUCH TX1 Sys 10 TY1 Sys 11 If Menucheck 0 TX1 TY1 1 Then CT18beep 20 Audio feedback I 0 End If Return Set Pad is used to configure the dedicated kepad touchpad port On Pad is used to assign an interrupt service routine to jump to when a touch event occurs Comfile Te...

Страница 64: ... is touched include CT18XX Dim I As Integer Dim TX1 As Integer TY1 As Integer Ct18contrast 150 On Pad Gosub GETTOUCH Do Loop GETTOUCH TX1 Sys 10 TY1 Sys 11 Circlefill TX1 TY1 2 CT18beep 20 Audio feedback Return Comfile Technology Inc CT1820 User s Manual 64 Of 93 ...

Страница 65: ... 75 Menutitle 1 11 4 2 Menuset 2 2 245 50 275 75 Menutitle 2 11 4 3 Menuset 3 2 165 85 195 110 Menutitle 3 11 4 4 Menuset 4 2 205 85 235 110 Menutitle 4 11 4 5 Menuset 5 2 245 85 275 110 Menutitle 5 11 4 6 Menuset 6 2 165 120 195 145 Menutitle 6 11 4 7 Menuset 7 2 205 120 235 145 Menutitle 7 11 4 8 Menuset 8 2 245 120 275 145 Menutitle 8 11 4 9 Menuset 9 2 165 155 195 180 Menutitle 9 11 4 0 Menuse...

Страница 66: ...beep 20 Elseif Menucheck 6 TX1 TY1 1 Then I I 4 I I 7 CT18beep 20 Elseif Menucheck 7 TX1 TY1 1 Then I I 4 I I 8 CT18beep 20 Elseif Menucheck 8 TX1 TY1 1 Then I I 4 I I 9 CT18beep 20 Elseif Menucheck 9 TX1 TY1 1 Then I I 4 CT18beep 20 Elseif Menucheck 10 TX1 TY1 1 Then Locate 3 5 Print Hex4 i I 0 CT18beep 20 End If Locate 3 3 Print HEX4 I Return The final result is stored as binary coded decimal BC...

Страница 67: ...reated the CuCanvas WYSIWYG utility to make it easier for users to layout a user interface and generate the necessary BASIC code CuCanvas is a free download from Comfile Technology s website In CuCanvas click the Add Form button to create a new from called NumKey as shown below Comfile Technology Inc CT1820 User s Manual 67 Of 93 ...

Страница 68: ...a menu button After clicking the button draw the button on the screen The menu button index ID will be displayed in the top left corner Enter text in the Title textbox to change the button s caption Add additional buttons to create the numpad as shown below Comfile Technology Inc CT1820 User s Manual 68 Of 93 ...

Страница 69: ...the generated BASIC code As shown below Click the To Clipboard button to copy the code and paste it in Cubloc Studio The code can also be saved as a Cubloc Studio include file by choosing the Save to File button Comfile Technology Inc CT1820 User s Manual 69 Of 93 ...

Страница 70: ... TY1 1 Then I I 4 I I 1 CT18beep 20 Elseif Menucheck 1 TX1 TY1 1 Then I I 4 I I 2 CT18beep 20 Elseif Menucheck 2 TX1 TY1 1 Then I I 4 I I 3 CT18beep 20 Elseif Menucheck 3 TX1 TY1 1 Then I I 4 I I 4 CT18beep 20 Elseif Menucheck 4 TX1 TY1 1 Then I I 4 I I 5 CT18beep 20 Elseif Menucheck 5 TX1 TY1 1 Then I I 4 I I 6 CT18beep 20 Elseif Menucheck 6 TX1 TY1 1 Then I I 4 I I 7 CT18beep 20 Elseif Menucheck...

Страница 71: ...LUDE CT005 INC We must place the include directive at the end of the code as the generated code is in the form of a subroutine which must come after the End statement in the main program Comfile Technology Inc CT1820 User s Manual 71 Of 93 ...

Страница 72: ... track which screen is currently being displayed While switching to a new screen always update this variable Use the variable to determine which set of MenuCheck tests should be run for a particular screen Subroutines are very useful for compartmentalizing the code The following code can be cut an pasted into Cubloc Studio Comfile Technology Inc CT1820 User s Manual 72 Of 93 ...

Страница 73: ...isplayTime Set Onpad On Endif Delay 250 Loop ProcessTouch TX1 Sys 10 TY1 Sys 11 Select Case CurrentScreen Case _MAINMENU ProcessMainMenu Case _SUBMENU1 ProcessSubMenu1 Case _SUBMENU2 ProcessSubMenu2 Case _SUBMENU3 ProcessSubMenu3 Case _SUBMENU4 ProcessSubMenu4 End Select Return End Sub ProcessMainMenu If Menucheck 0 TX1 TY1 1 Then FlashMenu 0 CurrentScreen _SUBMENU1 Cls SUBMENU1 Elseif Menucheck 1...

Страница 74: ... End Sub Sub ProcessSubMenu2 If Menucheck 0 TX1 TY1 1 Then FlashMenu 0 Beeper 2 Elseif Menucheck 1 TX1 TY1 1 Then FlashMenu 1 CurrentScreen _MAINMENU Cls MAIN Endif End Sub Sub ProcessSubMenu3 If Menucheck 0 TX1 TY1 1 Then FlashMenu 0 Beeper 3 Elseif Menucheck 1 TX1 TY1 1 Then FlashMenu 1 CurrentScreen _MAINMENU Cls MAIN Endif End Sub Sub ProcessSubMenu4 If Menucheck 0 TX1 TY1 1 Then FlashMenu 0 B...

Страница 75: ...1 Menuset 0 2 40 96 144 128 Menutitle 0 20 8 Submenu 1 Menuset 1 2 168 96 280 128 Menutitle 1 24 8 Submenu 2 Menuset 2 2 40 152 144 184 Menutitle 2 20 8 Submenu 3 Menuset 3 2 168 152 280 184 Menutitle 3 24 8 Submenu 4 Linestyle 0 Dotsize 0 0 Color 1 Box 80 16 232 56 Font 4 0 End Sub Sub SUBMENU1 Font 6 1 Style 0 0 0 Glocate 96 24 Gprint Submenu 1 Linestyle 0 Dotsize 0 0 Color 1 Box 80 16 232 56 Fo...

Страница 76: ...224 120 Menutitle 0 16 8 Beep 3 times Menuset 1 2 0 208 72 239 Menutitle 1 10 7 BACK Font 4 0 End Sub Sub SUBMENU4 Font 6 1 Style 0 0 0 Glocate 96 24 Gprint Submenu 4 Linestyle 0 Dotsize 0 0 Color 1 Box 80 16 232 56 Font 2 1 Menuset 0 2 88 88 224 120 Menutitle 0 16 8 Beep 4 times Menuset 1 2 0 208 72 239 Menutitle 1 10 7 BACK Font 4 0 End Sub The CurrentScreen variable is used to keep track of the...

Страница 77: ...5 Gprint Contrast Ct18beep 30 Font 2 0 On Pad Gosub TouchOccur Main Loop Do Locate 0 0 Print 20 Hp Rtcread 6 2 1 Hp Rtcread 5 2 1 Hp Rtcread 4 2 1 Hp Rtcread 2 2 0 Hp Rtcread 1 2 1 Hp Rtcread 0 2 1 Locate 24 0 Print Contrast Dp CT18_cont_value 3 0 Wait 1000 Loop TouchOccur _TouchPosx Sys 10 _TouchPosy Sys 11 If _TouchPosy 120 Then CT18_cont_value CT18_cont_value 1 Ct18contrast CT18_cont_value Eewr...

Страница 78: ...d time are displayed on the top of the screen as read from the RTC Displays the current date and time Increase the screen contrast Decrease the screen contrast Comfile Technology Inc CT1820 User s Manual 78 Of 93 ...

Страница 79: ...Sample 8 RTC Adjustment This sample program can be used to adjust the RTC s date and time The user interface layout is created with CuCanvas Comfile Technology Inc CT1820 User s Manual 79 Of 93 ...

Страница 80: ... 0 Endif If Menucheck 2 TX1 TY1 1 Then Month EffectFlash 2 VaIncr 5 12 Elseif Menucheck 3 TX1 TY1 1 Then EffectFlash 3 VaDecr 5 1 Endif If Menucheck 4 TX1 TY1 1 Then Date EffectFlash 4 VaIncr 4 31 Elseif Menucheck 5 TX1 TY1 1 Then EffectFlash 5 VaDecr 4 1 Endif If Menucheck 6 TX1 TY1 1 Then Hour EffectFlash 6 VaIncr 2 23 Elseif Menucheck 7 TX1 TY1 1 Then EffectFlash 7 VaDecr 2 0 Endif If Menucheck...

Страница 81: ...er Dim Tm As Byte Dim Dtm As Byte Tm Rtcread AddrRTC Dtm Bcd2bin Tm If Dtm Limitunder Then Decr Dtm Tm Bin2bcd Dtm Rtcwrite AddrRTC Tm End Sub Sub Basic_FORM1 Font 2 0 Style 0 0 0 Menuset 0 2 15 40 45 60 Menutitle 0 11 2 Menuset 1 2 15 125 45 145 Menutitle 1 11 2 Menuset 2 2 65 40 95 60 Menutitle 2 11 2 Font 0 0 Menuset 3 2 65 125 95 145 Menutitle 3 11 2 Font 3 0 Menuset 4 2 115 40 145 60 Menutitl...

Страница 82: ...ont 3 0 Menuset 11 2 275 125 305 145 Menutitle 11 11 2 Linestyle 0 Dotsize 0 0 Color 1 Box 5 20 155 165 Box 165 20 315 165 Font 0 1 Glocate 15 175 Gprint Year Month Date Glocate 175 175 Gprint Hour Min Sec Font 6 1 Glocate 90 195 Gprint RTC Setting Font 4 0 End Sub Comfile Technology Inc CT1820 User s Manual 82 Of 93 ...

Страница 83: ... Locate 3 9 Print 16 17 18 19 20 21 22 23 Style 0 0 0 Do Locate 2 4 Print hex3 In 0 hex3 In 1 hex3 In 2 hex3 In 3 hex3 In 4 hex3 In 5 Locate 2 7 Print hex3 In 8 hex3 In 9 hex3 In 10 hex3 In 11 Print hex3 In 12 hex3 In 13 hex3 In 14 hex3 In 15 Locate 2 10 Print hex3 In 16 hex3 In 17 hex3 In 18 hex3 In 19 Print hex3 In 20 hex3 In 21 hex3 In 22 hex3 In 23 Wait 500 Loop Comfile Technology Inc CT1820 U...

Страница 84: ... TY1 1 Then Menureverse2 2 1 Reverse 34 Elseif Menucheck 3 TX1 TY1 1 Then Menureverse2 3 1 Reverse 35 Elseif Menucheck 4 TX1 TY1 1 Then Menureverse2 4 1 Reverse 40 Elseif Menucheck 5 TX1 TY1 1 Then Menureverse2 5 1 Reverse 41 Elseif Menucheck 6 TX1 TY1 1 Then Menureverse2 6 1 Reverse 42 Elseif Menucheck 7 TX1 TY1 1 Then Menureverse2 7 1 Reverse 43 Elseif Menucheck 8 TX1 TY1 1 Then Menureverse2 8 1...

Страница 85: ...RM1 Font 0 0 Style 0 0 0 Menuset2 0 1 70 80 105 100 Menutitle 0 10 4 32 Menuset2 1 1 110 80 145 100 Menutitle 1 10 4 33 Menuset2 2 1 150 80 185 100 Menutitle 2 10 4 34 Menuset2 3 1 190 80 225 100 Menutitle 3 10 4 35 Menuset2 4 1 5 115 40 135 Menutitle 4 10 4 40 Menuset2 5 1 45 115 80 135 Menutitle 5 10 4 41 Menuset2 6 1 85 115 120 135 Menutitle 6 10 4 42 Menuset2 7 1 125 115 160 135 Menutitle 7 10...

Страница 86: ...2 16 1 165 150 200 170 Menutitle 16 10 4 52 Menuset2 17 1 205 150 240 170 Menutitle 17 10 4 53 Menuset2 18 1 245 150 280 170 Menutitle 18 10 4 54 Menuset2 19 1 285 150 319 170 Menutitle 19 9 4 55 Font 6 1 Glocate 50 25 Gprint OUT PORT CHECK Font 4 0 End Sub Comfile Technology Inc CT1820 User s Manual 86 Of 93 ...

Страница 87: ...Chapter 7 Panel Mounting Comfile Technology Inc CT1820 User s Manual 87 Of 93 ...

Страница 88: ...Dimensions Comfile Technology Inc CT1820 User s Manual 88 Of 93 ...

Страница 89: ...Comfile Technology Inc CT1820 User s Manual 89 Of 93 ...

Страница 90: ...Panel Cutout Comfile Technology Inc CT1820 User s Manual 90 Of 93 ...

Страница 91: ...upper lower 2ea Preparation Insert the bolt into the mounting bracket as shown in the image below 1 Insert the unit into a properly prepared panel cutout per the previously described panel cutout dimensions Panel thickness can be between 1 and 6 mm Comfile Technology Inc CT1820 User s Manual 91 Of 93 ...

Страница 92: ... the mounting brackets into the groove on the side of the unit pull the bracket towards the rear of the unit 3 Slide the bracket laterally to secure in place Comfile Technology Inc CT1820 User s Manual 92 Of 93 ...

Страница 93: ...Caution Be careful not to tighten the bolts excessively to avoid damaging to the unit and or the panel 5 Repeat steps 2 4 for each remaining mounting bracket A look at the CT1820 after properly mounted Comfile Technology Inc CT1820 User s Manual 93 Of 93 ...

Отзывы: