Home

CUTOUCH CT1820 User`s Manual

image

Contents

1. 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 Firmware Download If downloading does not go well it may be helpful to download the firmware Help PLC Setup Wizard PC interface setup Editor environment setup Ladder Logic Environment Options Use English menu Firmware download Downloading the firmware will restore the CT1820 to its default factory state All user programs will 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 CT1820 Start 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 Comfile Technology Inc CT1820 User s Manual 17 Of 93 Contents CT1820 3 pin download cable 1 meter 40 pin connection cable 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
2. Comfile Technology Inc CT1820 User s Manual 67 Of 93 The toolbar on the left can be used to draw boxes circles lines etc Click the Menu for CUTOUCH button to add 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 Y Numkey cvs CuCANVAS File Edit Generate Tools View Help Duk Ue a Numkey Add Form Use tab key to select neighbor ones 1 Humkey A O a O Y A O El mear x yf sef x Add additional buttons to create the numpad as shown below Y Numkey cvs CuCANVAS File Edit Generate Tools View Help D cb Ed CS ci eod Numkey Add Form Use tab key to select neighbor ones 1 Humkey EnF PA en Enk El pu j EE para Je para TA co cn mM e 116 25 ess xf f vyf sef x Comfile Technology Inc CT1820 User s Manual 68 Of 93 Select the View Hide Code button from the top toolbar to show the generated BASIC code As shown below Click the To Clipboard button to copy the code and paste it in Cubloc Studio Real Time Code Generation x BASIC Code for CUBLOC SUB NUMKEY FONT 0 0 STYLE 0 0 0 MENUSET 0 2 190 65 215 90 MENUTITLE 0 9 4 1 MENUSET 1 2 225 65 250 90 MENUTITLE 1 9 4 2 MENUSET 2 2 260 65 285 90 MENUTITLE 2 9 4 3 MENUSET 3 2 190 100 215
3. data address Address to write the data to data Store 1 byte of data variables or constants Stores one byte of data data to the FRAM at address address Data can be stored from addresses O 8H7FFF a total of 32KB The data will be retained between power cycles and no delay is required after a write FramWrite 14 amp HFF Writes amp 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 variable A FramRead 14 Reads one byte of data from address 14 Comfile Technology Inc CT1820 User s Manual 34 Of 93 Real Time Clock The CT1820 has a real time clock RTC that can be used to measure calendar date and time The RTCWrite command is used set the RTC s date and time and the RTCRead command is used to read the RTC s current date and time RTCRead Variable RTCRead address Variable The variable to which the result will be stored address RTC s register address The following details the format of the data retrieved from the RTC BIT4 0 Seconds 10 0 Minutes 10 0 12 24 AM PM Hours 10 NCC EN Day of the week 17 12Sun 7 Sat ET Day 10 Day 10 Day 131 0 0 Month 10 Month 10 Month 1 12 Year 10 Year 10 Year 0 99 Address 0 stores the number of seconds in the RTC
4. 125 MENLITITLE 3 9 4 4 MENUSET 4 2 225 100 250 125 MENUTITLE 4 9 4 5 MENUSET 5 2 260 100 285 125 MENUTITLE 5 9 4 6 MENUSET 6 2 190 135 215 160 MENUTITLE 6 9 4 7 MENUSET 7 2 225 135 250 160 MENUTITLE 7 9 4 8 MENUSET 8 2 260 135 285 160 MENUTITLE 8 9 4 9 MENUSET 9 2 190 170 215 195 MENUTITLE 9 9 4 0 MENUSET 10 2 225 170 285 195 MENUTITLE 10 12 4 ENTER FONT 4 0 To Clipboard Save to File The code can also be saved as a Cubloc Studio include file by choosing the Save to File button Save Your Design To BASIC Code WE amp AR C3 APPNOTE S amp er E CTO05 INC Comfile Technology Inc CT1820 User s Manual Fe OLECN I AACS 2 SAC CUBLOC BASIC Code inc HA d as 69 Of 93 Include files make it easy to change the interface of a program without a lot of cut and paste operations within the main code The following program is exactly same as Sample 4 except an include file is used for the virtual keypad include Crike oo Dim TX1 As Integer TY1 As Integer Dim I As Integer Ctl8contrast 150 On Pad Gosub GETTOUCH NUMKEY Calls subroutine in CT005 inc to draw the user interface I 0 Do Loop GET TOUCH TX1 Sys 10 LY 2 Sys 11 TE Menucheck 0 Tx i Then I I lt lt 4 LS El CT18beep 20 Elseif Menucheck 1 TX1 TY1 1 Then TSE lt A 1 2 CT18beep 20 Hise t Menucheck TXL TYL 1 Then A mA IM 3 CT18beep 20 Elser Menucheck 3 TXL AS 1 Then TENE
5. 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 Chapter 2 I O Comfile Technology Inc CT1820 User s Manual 19 Of 93 The CT1820 s I O Ports The following image shows the location of the various I O ports on the back and side of the CT1820 40PIN I O TERMINAL m NPN TR OUTPUT Jy A DC IV hi 244 in MPNTR O WPNTR OUT 8101214 G 17 19 21 25 G 49 51 5355 V G9 111315 16 18 20 22 48 50 52 54 G i i m LU Ji IE T L inano f inden B DOWNLOAD nnnm 9 COMM TERMINAL pa E C POWER INPUT Please use a 24VDC power supply 20 25VDC and pay 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 A The Digital Input Output ports A contain 6 24VDC inputs and 4 NPN transistor outputs Number O0 Input 20 28VDC for active high Output Current Sink NPN transistor output On creates a path to ground
6. Cubloc Studio Comfile Technology Inc CT1820 User s Manual 72 Of 93 include YOTLExx Ramclear DIESE pedes 150 On Pad Gosub ProcessTouch Dim TX1 As Integer Dim TY1 As Integer Dim CurrentScreen As Byte define _MAINMENU define SUBMENUI define SUBMENU2 define _SUBMENU3 define SUBMENUA IS U D S CO MAIN Current sereno MATNIMENU Do IE CurrentScereen _MAINMENU Then Set Onpad Off DisplayTime Set Onpad On Endif Delay 250 Loop ProcessTouch TXL Sys PYL Sys 11 Select Case Current acreen Case MAINMENU ProcessMainMenu Case SUBMENU ProcessSubMenul Case SUBMENUZ ProcessSubMenu2 Case Fs UBMENUS ProcessSubMenu3 Case SUBMENU4 ProcessSubMenu4 End Select Return End Sub ProcessMainMenu MS me li eS RS te FlashMenu 0 Current creen _ SUBMENUI Es SUBMENU1 Eset Memuche ck al le sya Sa FlashMenu 1 Sure eses sE MENU Z CIES Comfile Technology Inc CT1820 User s Manual 73 Of 93 SUBMENU2 pLlseii Menucheck 2 TXL TXL 1 Then FlashMenu 2 Guns cre cn ES UIBME NUS elke SUBMENU3 Eset Menuchec amp k Sl ry ren FlashMenu 3 Ctro te cn SUBMENUA CIS SUBMENU4 EACLE BNE SWO Sub ProcessSubMenul IS che Oe AA ese SO FlashMenu 0 Beeper 1 EESSi Menucheck bx c e a FlashMenu 1 CUpbenesereen MAN MENO Silos MAIN Endif EnO Swo Sub ProcessSubMenu2 TE Mere mec TXL TXILI 1L Then FlashMenu 0 Beeper 2 Rec essreMenucheck 1 TXL TXL L1 Then FlashMenu 1
7. 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 s caption Menularle 07 psc Gas herr Menu rte les dG ls Initialize Menubrri e 2 ils ls Total Cost Gas left Initialize Total cost Comfile Technology Inc CT1820 User s Manual 44 Of 93 MenuCheck variable MenuCheck index touchX touchY variable Variable to which the results will be stored 1 touched O not touched index Menu index number touchX X coordinate of touch touchY Y coordinate of touch Use this function to determine if a menu button has been touched touchX and touchY are the x and y coordinates of where the user touched the screen If the coordinates of the touch lie within the area of the button 1 is returned otherwise O is returned it Memnucheck D AS Wem Menureverse 0 Beep 18 180 Eno LE Menu variable Menu index coordinate variable Variable to store the results 1 selected O unselected index Menu index number coordinate Coordinate to check O x1 1 y1 2 x2 3 y2 This function can be used to inspected the coordinates of a given menu button created coordinate O will read the x coordinate of the top left corner x1 1 will read the y coordinate of the top left corner y1 2 will read the x coordinate of the bottom right corner x2 and 3 will read the y coor
8. Status Monitor This program displays the state of each digital input Finclude Crile x style 0 070 Locate 1 1 Print Input SS uS Style 0 0 1 Locate 3 3 Tcro e ODD 2 3 4 M Locate 3 6 Print 8 9 10 11 12 13 14 15 Locate 3 9 Beime posu le L19 20 21I 22A 7M Style 0 0 0 Do Locate 2 4 Peint next One In 1 hex3 In 2 eS bere hnhex3 tints Locate 2 1 Peint Mex sa In 8 hex3 In 9 hnhexs In 10 hnhex3s In 11 Print hexs3s Mingle nex tins ez In 14 inex oe In 15 Locate 2 10 Print hess imber hex En Li nex gt En Ls nex gt ino Peint hex3 mmu D ess In 21 hnhex3 In 22 nes in 22 Wait 500 Loop Comfile Technology Inc CT1820 User s Manual 83 Of 93 Sample 10 Digital Output Control This program can be used to control the state of each digital output degere uicem e Ibo Dim TX1 As Integer Dim TY1 As Integer Dim Ixx As Integer Basie EORMI Byteout 4 0 Byteout 5 0 Byteout 6 0 OBS os uo Touchoccur Do Loop POLEN CIU TXI Sys 10 TYL Sys 11 Ctl8beep 10 ee Menge neck Oey E Elseif Elseif Elseif Elseif Elseif Elseif Elseif Balls eq Elseif Elseif Elseif Menureverse2 0 1 Reverse 32 Menucheck 1 Px hry 1 Menureverse2 1 1 Reverse 33 Menuecne ea qan Menureverse2 2 1 Reverse 34 Menucheck 37 1x1 Ty Menureverse2 3 1 Reverse 35 Menucheck 4 TX1 TY1 Menureverse2 4 1 Reverse 40 Menucheck 5 T Menureverse2 5 1 Reverse 41 Me
9. Sub SUBMENUZ Porno Style 0 0 0 Glocate 96 24 Gorint submenu 2 Linestyle 0 Dotsize 0 0 Cotos il EAT BIO MORE ercnd Mentis ermo oo o aa qe Menutitle 0 16 8 Beep 2 times MENS ia DE PU oe Meni tea SEACE Font 4 0 End Sub Sub SUBMENU3 Font PL Style 0 0 0 Glocate 96 24 Gprint Submenu 3 Linestyle 0 Dorcsize 0 0 Co Rom dl lores dup Er BOTE PE MES cq onn Dum Menutitle 0 16 8 Beep 3 times Menusem e peo T2 239 Mera de qne Mes AR Font 4 0 aro sole Sub SUBMENU Font roca Style 0 0 0 Glocate 96 24 Gorint Submenu 4 Linestyle 0 DoOtsize 0 0 Color al BOS ED PORN MES A O o pee TP Menutitle 0 16 8 Beep 4 times Menuset OM T2 239 Menmu assie AiG EU Font 4 0 End Sub The CurrentScreen Variable is used to keep track of the active page being displayed This variable is checked in the touch interrupt service routine to determine which set of MenuChecks to perform Comfile Technology Inc CT1820 User s Manual 76 Of 93 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 amp HFFF aude P OPE S Dain CW dL Se cole allie e ENTE S CTle CONE value Wiesel entiri 1 I CTG Con value shii Then CEIS T Con Ta lue ETa TELE Culo Contra ia rlo e ont ale Box 10 20 310 100 Eoo c FOME p1 Glocate 120550 Gorint YContrast da Gloecate 707 d Gorint YContrast Ctl8beep 30 pont 2
10. V Built in protection diode If the load is a relay this must be connected to the positive terminal CT1820 The output circuit is illustrated below 5 30VDC CT1820 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 damage to the unit Comfile Technology Inc CT1820 User s Manual 21 Of 93 B This is a 40 pin terminal block connector with 16 inputs 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 999929999999999999999 Comfile Technology Inc CT1820 User s Manual 22 Of 93 20 28VDC for active high 20 28VDC for active high Output Current Sink NPN transistor output On creates a path to ground Output Current Sink NPN transistor output On creates a path to ground Built in protection If the load is a relay this must be connected to diode the positive terminal Me Tone Scie ld kehelet INPUT OUTPUT 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
11. a da 56 Sape Dessus ese nd ud PUPRLEI i 57 Sala ect tacdansnte T Gabae too aueennennse auiamee nna eee 58 Sampras 59 sample 4 Numero TN PUES tias 60 Sample S CUCINI S aa a A D 62 Sample 6 Multi page Menu ImplementatiOD occcccoccccnnncnnccnnnarnccr rc rr nr rr rra 67 Sample 7 Contrast AdjUSUM CU ta A A ii cu cs 72 Sampe RTEC ACTUS Mirta is AA II EI EO A atlas 74 sample 9 Input Status MONO A Rias 78 sample 10 Digltal OUtput Control aia 79 Chapter 7 Panel Molt a a 82 DINENSIONS ea dada id ARA A ANA 83 Pane E Gre deem 84 Panel Mounting Procedure vir A EIE DU Peto tu AA Rudd 85 Comfile Technology Inc CT1820 User s Manual 3 Of 93 Comfile Technology Inc CT1820 User s Manual Product Comparison New in 2013 LCD Screen LCD Screen 5 7 Monochrome 5 7 Monochrome GHB3224C Core Module CB290 80KB Data Memory 28KB 32 24VDC 32 NPN TR Front Panel IP65 Rating Download Cable SUB 9 PIN Battery Backup RTC and RTC Batter uilt in Comfile Technology Inc uU ETA COM 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 N 3 50 es CT1820 User s Manual 5 Of 93 CUTOUCH Overview The Cutouch is a Cubloc Core with an integrated LCD and Touchscreen It can be programmed to draw graphics lines circle etc on the LCD and to read the coordinates of touch inputs from a user To
12. 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 A A A A A ram t 1 i Comfile Technology Inc CT1820 User s Manual 91 Of 93 2 Insert the mounting brackets into the groove on the side of the unit pull the bracket towards the rear of the unit XS 3 Slide the bracket laterally to secure in place Comfile Technology Inc CT1820 User s Manual 92 Of 93 4 Tighten the bolts to secure the unit to the panel Caution Be careful not to tighten the bolts excessively to avoid damaging to the unit and or the panel f a f r 4 7 7 ry L4 j di m bd b J lt E a t T Y gt m M T 5 ZI t 4 i ba bs I3 E Lg i 1 Faa r Ld iJ Pd 4 P E rE r A y A iy f vy yA X 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
13. from the serial port as it s being received because the CT1820 can process data much faster than the serial port can receive it Rather it would be best to leverage the CT1820 s built in Modbus RTU protocol The Modbus RTU protocol will handle the data processing so the user doesn t have to OpenCom OpenCom channel baudRate settings receiveSize sendSize channel The RS 232 channel to use baudRate The baud rate settings Serial settings data bits parity and stop 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 5 80 80 Open Channel T 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 controller Be sure to use Set RS485 to set pin 71 as the transmit enable pin Configure the serial port at the beginning of the source file Opencom 375 1000 3519 59 Ser Rsdos 5 7L Set Pim as the transmit enable pin The Set RS232 command can be used to change the serial settings tinelude CTL Ser RS232 3 115200 3 Change chamnnel gt se gerial sett ngs Comfile Technology Inc CT1820 User s Manual 39 Of 93 LCD Contrast Adjustment The CT1820 s screen contrast is adjustable through software CT18Contrast CT18Contrast value value Integer va
14. s current time The data is stored as binary coded decimal BCD so the first 4 bits store the 10 digit while the lower 4 bits store the 10 digit T LE Therefore if address O stores the value 0001 0001 then then the number of seconds is 11 not 17 Displaying the value in hexadecimal is one way to show the value in decimal as illustrated in the example below A RTCRead 0 Debug Hex2 A Cr Comfile Technology Inc CT1820 User s Manual 35 Of 93 pLinclude Cie ou Dim i As Integer Wait 100 RTCWrite 0 amp h20 Sec RTCWrite 1 amp h59 MEE RTCWrite 2 amp h23 Hour 245 RTCOCWELte 3 m day 1 7 1 Sun 2 Mon 3 Tue 4 Wed 5 Thu 6 FRI 7 SAT RTCWrite 4 amp h h31 Date RTCW LTCS 57 S mb Month RTCWrite 6 amp h08 Year Do i RTCRead 0 Debug CORY ll Hex Sec i RTCRead 1 Debug Goxy 1 2 HexZ 1 gt Min i RTCRead 2 And amp h3f DebuguGoxy c Hex a OB i RTCRead 3 Debug Goxy 1 4 Hex2 1 Day i RTCRead 4 Debug Goxy lo Hexz a Date i RTCRead 5 Debug Goxy 1 6 HexzZ a Month i RTCRead 6 Debug Goxy l 1 Hexz 1 Year Wait 500 Loop The results of this example are displayed in the Cubloc Studio debug terminal Debug Terminal Port Baud Rate Parity Data Bits Tx 12 ll com y 115200 y none fe ox 23 Hour 7 Day 31 Date 12 Month 8 Year Close Fix Right Side Comfile Technology Inc CT1820 User s Manual 36 Of 93 RTCWrite RTCWr
15. voltage to output 0 60000 Outputs a voltage on one of the channels of a MD DAOUT2 module MPDAOutV Ll 2 B Outpukrs voltage B on module 1 channel 2 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 MPDAOUEA 1 2 8 Outpubs current B on module 1 channel 2 Comfile Technology Inc CT1820 User s Manual 58 Of 93 Modport Test Program The following program reads the status of 8 inputs on the MD DIDC8 digital module and simultaneously outputs each status to the MD DOSO68 digital output module sao ERIS OH be Dim TX1 As Integer Dim TY1 As Integer Om Pad Gosub TouchOccur Y VXKCkCk KC KCk Ck KC kk Kk Ck ck ck k ko k k kk Main Do Loop ACkCkCkCKCk Kk kKCk ck KC kock k Ck ck k k kk k kk Locate 1 1 print MD DIDCO Input Status Locate 3 3 Print 7 6 543532 1 0 Locate 3 4 Print Do Locate 2 5 Print hnhex2 MPa 7 hex 2 Mern il 6 hex 2 MP als esc MPein i 4 nex MPN L 3 hnex2 Meanie 2 nex MET EAN EO MPsourece 2 0 MPam 0 MPsource 2 IMPI MPsource 2 2 MPin MPsource 2 3 MPin MPsource 2 4 MPin MPsource 2 5 Mran Comfile Technology Inc CT1820 User s Manual 59 Of 93 MPsource 2 6 MPin 1 6 MPSsource 2 1 MPan LE 7 Wait 500 Loop TOlenOs cure TXI Ss lo TY Sys
16. 1 1 Then Menureverse 2 CT18beep 20 Audio feedback Eno LE Return os Jom e Comfile Technology Inc CT1820 User s Manual 48 Of 93 Touch Calibration Prnt Ladder In Cubloc Studio select the Touch calibration for CT1820 menu option from the File Print BASIC menu to download and execute a program to calibrate the touchscreen Print Setup m SEA The user will be prompted to touch 4 points Download from object file on the screen to complete the calibration BMP download far CT1721C Touch calibration for CT1 21C BMP download for CT1820 Touch calibration for CT1820 Store Current Time to CT1820 RTC The calibration settings will be stored 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 amp HFFF and can be read at runtime if necessary Displays the Increase the current 2013 07 11 21 24 10 Contrast 150 screen cata ang contrast Touch Calibration Done Decrease Contrast the screen contrast Comfile Technology Inc CT1820 User s Manual 49 Of 93 Each CT1820 will have to have its contrast set individually It can be set at runtime using the CT18Contrast command as shown below QD DOC niu usto l5 If using the Touch calibration fo
17. 7 0 On Pad costo Leouch ccur Y Jc oko o KK OK SKK OK KS Main Loop Xo ck deck c OK UK OK RARA AAA aes Do Locate 0 0 Peine uO Recrcead lor 2 yak ayaa Hp lo osa als o d epe d 2d ak y Ep UREeCread2 72 0 II RECread h 2 l mo RECEA 2 L Locate 21 0 print Concrast Dieter ore Wait 1000 Loop TouchOccur s Os oss EB _TouchPosy Sys 11 I _ToOuchPosy gt 120 Then CTl CONE value CTI Cont value Calo co nerds Cri e om value Smile Niir Eig e om ale al Else CTl Cont values CTl cont value Ed Ve ommrcc wells Re om vane Ese ike O PIS comte Volus Endif Ctl8beep 30 Re Gian End Comfile Technology Inc CT1820 User s Manual 77 Of 93 The date and time are displayed on the top of the screen as read from the RTC Displays the Increase the current 2013 07 11 21 24 10 Contrast 150 screen date and contrast Touch Calibration Done Contrast Decrease the screen contrast Comfile Technology Inc CT1820 User s Manual 78 Of 93 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 Y RTCsetting cvs CuCANVAS File Edit Project Tools View Help Korean 16x15 58 gt Style Shadowed Box y EngiNum FER Month Date Hour Min RTC Setting 256 56 x 75 fos 125 145 size 31 x Comfile Technology Inc CT1820 User s Manual 79 Of 93 include OO Dim
18. An LCD Touch Screen with an Integrated BASIC Ladder Logic Controller CUTOUCH CT1820 i THC Drain Tank Sys Last Updated 2015 06 08 COMFILE TECHNOLOGY www ComfileTech com Comfile Technology Inc CT1820 User s Manual 1 Of 93 Introduction The CT1820 is the latest next generation CUTOUCH improving upon the previously released CT1721C It is comprised of a built in CB400 Cubloc core module a GHB3224 graphical LCD and touch panel and includes a wide variety of I O capabilities The following shows the how the CT1820 compares to the CT1721C The LCD is the same The program memory has been increased 80KB gt 200KB The data memory has been reduced 28KB gt 7KB FRAM non volatile memory has been added 32KB The number of communication ports have been increased 1 to 3 I O can be extended with Comfile Technology s MODPORT Field I O O ae a D a The enclosure is rated waterproof IP65 A ANC re Communication Ports Total I O Count MODPORT Connectivity Not Supported Supported CT1721C Backward Compatibility CT2721C code is not portable to the CT1820 Comfile Technology Inc CT1820 User s Manual 2 Of 93 Table of Contents LATA dUCIO Ni doors 2 Chapter LOVE VIG Wisin 4 Producte COMPA ON pidas id tea 5 CUTOUCE Ee Iis A id di 6 The CTI1920 S APPS Neri aida 7 CUBLOC STUDIO dai 10 Downloading Programs to the CTI820 riria a ex vue esduureses che ica dois era ebU ots 11 Download and EXeculblO tzse
19. CurrentScreesn VAI NENG CIES MAIN Endif End Sub Sub ProcessSubMenu3 pq Mente ne Sl ug Sea FlashMenu 0 Beeper 3 Hi Menucheck A a E 1 Then FlashMenu 1 Curr reMtTSCreen MATNIMIENU SES MAIN Endif Bno Suo Sub ProcessSubMenu4 If Menucheck 0 TX1 TY1 1 Then FlashMenu 0 Beeper 4 Bikeseat Menucheck 1 TXL TXL 1 Then FlashMenu 1 Cute ns recen _ MATNIMENU CIRS MAIN Endif Comfile Technology Inc CT1820 User s Manual 74 Of 93 End sub Sub Beeper Num As Byte Dim i As Byte For i 1 To Num CT18beep 20 wait 200 Next Bnc Suelo Sub FlashMenu Num As Byte Menureverse Num Delay 150 Menureverse Num End Sub Sub DisplayTime Glocate 6 220 Font 0 0 DOCint Do Bec2bin RCCreaC May 27 1 s Bedia res aa IZ PD End Sub Sub MAIN Font 6p 1 Style 0 0 0 Glocate 96 24 Gprint Main Menu Font 0 1 Meanie A IS ela aye Menuticle 0 20 5e des Mens Gia plies vus SS Menuticle ely oe Ue pepe Menuset 2 2 40 152 144 184 Merle Se Sto Me eS Mens o los woz ms Menuticle 3 24 8 Subonenu 4 Linestyle 0 oteuze 040 Color 1 Bos dU I CE E Font 4 0 End Sub Sub SUBMENUI1 Rote OY Style 0 0 0 Glocate 96 24 Gprint Submenu 1 Linestyle 0 Dotsize 0 0 Colora Eo AS ES Ripe E Mens Sto yates qe Menutitle 0 22 8 Beep 1 time Menus set eo oi to Mental dar Ga B AGIS Font 4 0 Comfile Technology Inc CT1820 User s Manual r tie reto pam ere de 75 Of 93 Ene Sulo
20. I I1 4 CT18beep 20 Bilsert Menueheck d TX fy nen I DE 4 L 5 CT18beep 20 Elseif Menucheck 5 TX1 TY1 1 Then I I lt 4 i gt i ae 6 CT18beep 20 Elseif Menucheck 6 TX1 TY1 1 Then o hk lt lt 4 LSL a 7 CT18beep 20 Elseif Menucheck 7 TX1 TY1 1 Then I I lt 4 1 13 8 CT18beep 20 Elseif Menucheck ts Lx fyi 1 Then T ES 4 I2 1 749 CT18beep 20 mlseift Menucheck 9 TXL mU E 1 Then I I lt 4 CT18beep 20 Elseatr Menucheck b TKL TXL 1 Then qoe CT18beep 20 EUR TE Comfile Technology Inc CT1820 User s Manual 70 Of 93 Locate 3 p3 Brinc HEXA T REUNAN BAC r INCLUDE METEO ING 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 Sample 6 Multi page Menu Implementation This sample demonstrates how to set up a paging and menu system Switching between screens is quite simple Maintain a variable that keeps 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 Submenu 1 EPI Submenu 2 CTA Main Menu Submenu 3 ETIECH Submenu 4 The following code can be cut an pasted into
21. On module 1 in 2 Comfile Technology Inc CT1820 User s Manual 54 Of 93 MD DOSI8 DC Sink Output Module MPSink 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 off 0 Command to turn on off a pin on the MD DOSI8 DC sink output module ME Sto e A 1 mucna on module I orin 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 MD THRT4 4 channel Resistance Thermometer Module Variable MPThIn 1D Channel ID The ID of the module Channel Channel selection 1 4 Reads temperature in C from a PT100 resistance thermometer If the module cannot be found 9999 is returned If the temperature exceeds the upper threshold 5555 is 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
22. TX1 As Integer Dim TY1 As Integer Dim Va As Integer Bagic FORMI On Pad Gosub TouchOccur Y ULLUS em do di div dip di dp sib dib Xie dip dio db xp sp db iio b dio diio c Main Loop dio di dir dir dio dir dir dir di dir dir dio di dir dio dir di dir dir di dir dio dis Do Locate 2 3 printe o ea Hc 21 MEE EG ec n ae Hp Rtcread 4 2 1 Estate 233 print Hpo RTCOCreacd 2 1 o Hoi Reeread D727 ie y Ho REcCread 0 2 1 Wait 1000 Loop CAOCCA TX1 Sys 10 TYL ys O If Menucheck 0 TX1 TY1 1 Then Year Pere RES SD Valnecr oo mlseift Menucheck ye Greek 1 Then EffectBlissh i VabDecr 0 0 Endif If Menucheck 2 TX1 TY1 1 Then 1 Montem BErectELlash 2 Male 5 12 Elseif Menucheck 3 TX1 TY1 1 Then EffectFlash 3 Vabecr 5 i Endif If Menucheck 4 TX1 TY1 1 Then Date EffectFlash 4 Vainer 4731 Bn cempeMenmeheci ncm AS ie hive EffectFlash 5 VaDecr 4 1 Endif If Menucheck 6 TX1 TY1 1 Then TOS MOUT EffectFlash 6 WSOP S Elseif Menucheck 7 TX1 TY1 1 Then EffectFlash 7 Vabecr 2 0 Endif If Menucheck 8 TX1 TY1 1 Then DON I Besse Varner t Elseif Menucheck 9 TXl TYl 1 Then EffectFlash 9 Vabecr 1 0 Endif TE Menueneck 0 a EE Sec Berecrnlasihn 10 Nate pe t Comfile Technology Inc CT1820 User s Manual 80 Of 93 Enc Sub Ene Sub End Sub End Sub Elseif Menucheck 11l TXL TYL 1 Then merecet lasa alll VaDecr 0 0 ao Saas Return EffectFl
23. Technology Inc CT1820 User s Manual 63 Of 93 Sample 3 This sample draws a filled circle wherever the screen is touched include CT18XX Dim I As Integer Dim TX1 As Integer TY1 As Integer Calls contras iiO On Pad Gosub GETTOUCH Do Loop GENIO TXI Sys 10 TYL ys 11 Cire lari L A RNG lee CT18beep 20 Audio feedback INE beim Comfile Technology Inc CT1820 User s Manual 64 Of 93 Sample 4 Numeric Input This sample shows how one can implement a numeric keypad Enter a number on the keypad and the value entered will be displayed on the screen Finclude Crile xx Dim TX1 As Integer TY1 As Integer Dim I As Integer I 0 CElScontrast 150 On Pad Gosub GETTOUCH Mens er oon boo 1s Mente Oia ay Menus 2 205 50 2557 15 Mente Menus iS O 415 15 Menutatle 2 1 4 sm Menmusete v duobns boo IM Mente lec dq dq Menuseu d 2205 09 2339 LLO Mentales ad Menuset o pedo 00 2 RO Menta bes ii ae M nutset o 2 lou 120 195 145 MENTEIATLE TO qM Member rs us Menut zecd4o 5 11 2 MSN Menusei 6 2 45 2072103113 Menutirctle 8 11 2 9M Menus ero 2 65 55 105 100 Menuitat te 2 oy ada DM Mentset UO s sioe em Menutrtle 10 qd ENTER I 0 Do Loop GETTOUCH TXI Sys 10 TYI Sys 11 If Menucheck 0 TX1 TY1 1 Then Comfile Technology Inc CT1820 User s Manual 65 Of 93 MM 4 LST p l CT18beep 20 Audio feedback Else Menucheck CPE i then T M 4 l 1I 2 CT18beep 20 Elseif Menu
24. UM a lA SOS ey 5 SO A Pete DO IS OS S Or eS CN 223 IOS e LS ME aon a 208 bes i Se M O 5st 35 ed Then Then Then Then Then Then Then Then cicle 9 Menuset t2 10 Menutit Menutit cicle 10 Menuset2 11 Ope indo 10 4 d 2e9y Abe JURO DS UA 6 Wu EM pq Menuti Menuse Menuti Menuse Menuti Comfile Technology Inc e e e e e eo e DD oO Oo Sr SE SLOP LG Dade Ate yee dU le 12 i0 atom CT1820 User s Manual 85 Of 93 Mentsertz2 14 ies Lo 1207 d Menut tLle 14 10 24 507 Member a lo les loo 0140 Menutatle bog 2 5p Mentser 6 loe boul TIT Menuet berth EOL 1 5 Menusei iil OOO Mentir ateo eM Memik et Zale W245 SO o OO Menutatle 198 10 42 392 Menuset ORE oS OO qu Mente 1 oo dmm Font O Glocate 50 25 Gorint O UAB te Le E Font 4 0 mne Sulo Comfile Technology Inc CT1820 User s Manual 86 Of 93 Chapter 7 Panel Mounting Comfile Technology Inc CT1820 User s Manual Dimensions Comfile Technology Inc CT1820 User s Manual 88 Of 93 154 I B i i i Comfile Technology Inc CT1820 User s Manual 89 Of 93 Comfile Technology Inc CT1820 User s Manual Panel Mounting Procedure Panel mounting brackets and matching bolts are included with each purchase upper lower Zea Preparation Insert the bolt into the mounting bracket
25. an be used Comfile Technology Inc CT1820 User s Manual 11 Of 93 Comfile Technology Inc CT1820 User s Manual 12 Of 93 After the host PC is connected to the CT1820 via the download cable open Cubloc Studio and choose Setup PC interface setup from the menu Setup Help PLC Setup Wizard PC interface setup Editor environment setup Ladder Logic Environment Options Use English menu Firmware download Select the host PC s serial port Com Port that is connected to the CT1820 Com Port E RS232 Part Echo Test Cancel Comfile Technology Inc CT1820 User s Manual 13 Of 93 Download and Execution In Cubloc Studio choosing Run from the menu or typing CTRL R will compile and download the currently open program to the CT1820 Clicking this icon will save the source code compile and initiate downloading Cubloc Studio c program files x86 comfetools cublocstudio samples ct1820_ 1 cul m File Edit Device Run Setup Help Dea 9 Gd eg Qm m BASIC LADDER i Const Device CI1820 3 Dim i As Integer j As Integer 4 Dim TouchPosx As Integer 5 Dim TouchPosy As Integer E Dim Touchupdown As Byte 7 Dim TouchTemplstValue As Byte 8 Dim TouchRegStartAdr As Byte 3 Dim Tv 7 As Byte 10 Dim CT18 const value As Byte 12 define 13 define 14 define 16 Tv 0 17 Tv 1 18 Tv 2 j2 Tw13Y 4
26. 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 Designation WPO 7 16 bits 1 word For accessing P in word units WMO WM63 16 bits 1 word For accessing M in word units Lower numbered designations are stored in the lower significant bits and higher numbered designations are stored in higher significant bits For example the P region would appear as follows when accessed as WP weo bel TTT TE ETT TT e wet le A e wez bel E wes bel ETT e Comfile Technology Inc CT1820 User s Manual 31 Of 93 Chapter 3 Command Reference Comfile Technology Inc CT1820 User s Manual CT1820 Analog Input The CT1820 has 8 analog input channels ADIn variable ADIn channel Variable Variable to which the results will be stored Channel Analog input 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 e Channels 0 3 are 0 20mA current analog inputs e 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 CT1820 s Non volatile FRAM Data that needs to be retained between power cycles can be stored in the CT1820 s non volatile FRAM FramWrite FramWrite address
27. ash IxM As Integer Menureverse IxM Ctl8beep 20 Wait 200 Menureverse IxM Sub Valncr AddrRTC As Integer LimitThis As Integer Dim Tm As Byte Dim Dtm As Byte Tm Rtcread AddrRTC Dtm Bcd2bin Tm eE Drm IE Dem etras Then Decr Drem Tm Bin2bcd Dtm RCCWELTS oe pre Tin Sue VaDecr AddrRTC As Integer Limitunder As Integer Dim Tm As Byte Dim Dtm As Byte Tm Rtcread AddrRTC Dtm Bcd2bin Tm IE Dem gt Limicuncder Then Decr Dem Tm Bin2bcd Dtm Ruente dde TE Sub Bas TCT EORMI Font 2 0 Style 0 0 0 Mentset Mi 7995 Menucicle 0 11 2p WF Mernusep lee SS ME heb E uc Menuset 2 2 69 40 95 60 Menor Rc ph EM Bon Mennis erko r eo nog qu SVEN ODE ty eed Mave I NEL Font 3 0 Menueein 45 2 lo 40 4 560 Ier pedes qu SE Menusetecb o qs ds Mentiroso p TES Menmusepeo rd que catre Menucicle 6 1l IE Mentec SS eds MENTE dal en METS So a o Comfile Technology Inc CT1820 User s Manual 81 Of 93 MENTA e o Menterne ue M d Mente cg qp Font 2 0 Menus ee rcs cH 0 506 0 Menthe dahon Oe T Font 3 0 MNCS erie wel lee o OaS Mn rte Linestyle 0 loo equo Color 1 Box 5720 155 165 Box 165 20 315 165 Font 0 1 ClecCaves wks ce Gprint Year Month Date Elo Gai era lito Gprint Hour Min Sec Font com Glocates USOS Gorint VET Setting Font 4 0 Ene Sub Comfile Technology Inc CT1820 User s Manual 82 Of 93 Sample 9 Input
28. check 2 TX1 TY1 1 Then IDE UE 4 TS IRE MES CT18beep 20 Hiseur Menucheck 3 TO iyi 1 Then I I lt 4 I I 4 CT18beep 20 Elseif Menucheck 4 TX1 TY1 1 Then I I lt 4 I I 5 CT18beep 20 E cempeMenucheck AS En if Ss SS 4 t AS CT18beep 20 Edisea rt Menucheck 6 TXL SD 1 Then I I lt 4 Lsp 7 CT18beep 20 EdsostoMenuechecek IAS S MM LA I I1I 8 CT18beep 20 Elseif Menucheck 9o TXl TYl 1 Then T I 4 JE m dE ose CT18beep 20 Elseif Menucheck 9 TX1 TY1 1 Then I I lt 4 CT18beep 20 Blsere Menucheck 10 TXL TYL 1 Then Locate 3 5 Print Hex4 1 Tee 0 CT18beep 20 Diao LE Locate 3 3 Princ HEXA I RE The final result is stored as binary coded decimal BCD so the BCD2Bin command is used to convert the value to binary format Comfile Technology Inc CT1820 User s Manual 66 Of 93 Sample 5 CuCanvas It can be quite inconvenient to compute coordinates and layout a user interface in code so Comfile Technology created 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 Y ISS CuCANVAS File Edit Generate Tools View Help Dee Ser 2 Numkey Add Form Use tab key to select neighbor ones 1 Humkey A O a O A O EJ 11625 Np iS if m ele E jo
29. dinate of the bottom right corner y2 TE Memu 0 1 lt 100 THEN Y IF menu burton Q es top 1s less than 100 Comfile Technology Inc CT1820 User s Manual 45 Of 93 To test the CT1820 menu buttons copy and paste the following program to Cubloc Studio include CT18XX Dim I As Integer Dim TX1 As Integer TY1 As Integer Coman tea On Pad Gosub GETTOUCH Menuset2 0 3 120 155 195 200 MENTE AE e SE Do Eocate 156 Print DECS I mmer 1 Delay 200 Loop CERK EDS TXI Sys 10 TYL Sys 11 Locate 0 0 Perime Dec Li Dcr TE Menucneck 07 Sen Menureverse2 0 3 Notice the 2 at the end of this command Ctl8beep 20 Audio feedback I 0 Doo LE IRE ei Comfile Technology Inc CT1820 User s Manual 46 Of 93 Processing Touch Input The method for processing touch input on the CT1820 is slightly different from that of the CT1721C The following program shows how to determine when and where a touch event occurs and process it Demo for Curtouch Y dtum educi mU TION Dim TX1 As Integer TY1 As Integer On Pad Gosub TouchInput 1 Attach Interrupt Service Routine Do Loop atem e mE es ASS SON 2 Start of Interrupt Service Routine TYL Sys lbs Circelefill Cin iG 3 Draw a point where touched Re unn 1 On Pad Gosub TouchInput When 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
30. eL Eset TXL TY1 Ctl8beep 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 Chapter 6 Sample Programs Comfile Technology Inc CT1820 User s Manual Sample 1 This sample program displays an ever increasing number This sample is included with the Cubloc Studio installation 3241 Simply cut and past this code into Cubloc Studio to give it a try tinclude CT18XX Dim 1 As Integer Ctrlecontrast 150 LCD contrast Setting Do hocate 15 6 Print DECS T Tacr X Delay 200 Loop Comfile Technology Inc CT1820 User s Manual 62 Of 93 Sample 2 This sample program is similar the previous sample program but adds a RESET button to restart the count at 0 3241 RESET fanclude Cies Dim 1 As Integer Ctl8contrast 150 LCD contrast setting Dim TX1 As Integer TY1 As Integer Contrast 550 On Pacl esc SIMIO uo peru sese rcu Moritur ec Mp TM Do Locate 15 6 Princ Dacs I T neg Delay 200 Loop GE LELOUCH TX1 Sys 10 TY1 Sys 11 If Menueneck 0 TX1 TY1 1 Then CT18beep 20 Audio feedback I 0 Eno LE 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
31. ecommended Operating Voltage O or 24VDC Recommended Operating Current At least 2mA Input Impedance 2 2KQ O 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 250mA Pin 10mA Pin High speed counter and external interrupt features are not supported Comfile Technology Inc CT1820 User s Manual 27 Of 93 Interfacing to Proximity Sensors Proximity sensors can be used to detect the existence movement and 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 24VDC CT1820 A 7KQ SENSOR Comfile Technology Inc CT1820 User s Manual 29 Of 93 DC 3 Wire Model PNP type Sensor output connected in reverse 24VDC SENSOR CT1820 PNP type DC 3 Wire Model NPN type Sensor output connected in reverse 24VDC SENSOR CT1820 NPN type Comfile Technology Inc CT1820 User s Manual 30 Of 93 CT18XX Series Relays amp Registers The following lists the various relays and registers available for use in Ladder Logic Designation PO P31 M Internal Relays MO M511 For saving internal status System status P M
32. from module 2 channel 1 and store in A Comfile Technology Inc CT1820 User s Manual 56 Of 93 MD ADIN4 4 Channel analog input module Variable MPADIn 1D 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 ADIN4 module If the module cannot be found 19999 is returned In 1 5V mode 11 111 is returned if voltage is less than 1V and 22 222 is returned if value is greater than 5V Values falling within the 1 5V rage will return a value between O and 10 000 13 3 bit resolution A 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 returned if value is greater than 5V Values falling within the 1 5V rage will return a value between O and 100 000 13 3 bit resolution A MPHADIn 2 3 Read from module 2 channel 3 and store value in A Comfile Technology Inc CT1820 User s Manual 57 Of 93 MD DAOUT2 Digital to analog voltage output module MPDAOutV ID Channel OutputValue ID The ID of the module Channel The channel to output to 1 or 2 OutputValue Integer value representing the
33. ite address data address RTC s register address see table for RTCRead data The data to store variable or constant Stores Data to the RTC s register address Address effectively setting the RTC s current date and time The RTC s current date and time can be set from a PC within Cubloc Studio From Cubloc Studio s menu choose File Store Current Time to CT1820 RTC and the PC s current date and time will be stored to the CT1820 s RTC BMP download for CT1721C Touch calibration for CT1721C EMP download for CT1820 Touch calibration for CT1820 Store Current Time to CT1820 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 synchronized with a current time source Comfile Technology Inc CT1820 User s Manual 37 Of 93 Beep Sound The CT1820 has a built in buzzer than can be used to generated 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 RS 232 485 Communication The CT1820 has two RS 232 serial ports and one RS 485 serial port Note It is recommended to not analyze the data
34. l yl x2 y2 index Menu index number Style Button style 0 2 X1 yl x2 y2 Menu button s screen coordinates index value must be a number from O through 49 style specifies the style of the button as shown below 0 1 2 xl yl x2 y2 are the x and y screen coordinates of the upper left and 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 Initialize Total cost MenuSetClear MenuSetClear Clears all menu buttons on the screen Call this before creating a new menu This commands is not available in the CT1721C Comfile Technology Inc CT1820 User s Manual 43 Of 93 MenuSet2 MenuSet2 index style xl yl x2 y2 index Menu index number style Button style 0 3 xl yl x2 y2 Menu button coordinates This command is exactly the same as the MenuSet command but can draw different styles This command is not available in the CT1712C MenuReverse2 MenuReverse2 index style index Menu index number style Button style This 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
35. nucheck 6 TXL TYL Menureverse2 6 1 Reverse 42 Menucheck 7 TX1 TY1 Menureverse2 7 1 Reverse 43 Memuecneek o op el Menureverse2 8 1 Reverse 44 Menucheck 9 TXL TYl Menureverse2 9 1 Reverse 45 Mente reco sp Menureverse2 10 1 Reverse 46 Menucheck 11 TX1 TY1 Menureverse2 11 1 Comfile Technology Inc 1 Then 1 Then 1 Then 1 Then 1 Then 1 Then 1 Then 1 Then 1 Then 1 Then 1 Then CT1820 User s Manual 84 Of 93 Beg Elseif Elseif Elseif Elseif Elseif Elseif Elseif BACILE Return End Reverse 47 Menten erat T Menureverse2 12 1 Reverse 48 Menueneci id sx E Sal Menureverse2 13 1 Reverse 49 Menucheck 14 TX1 TY1 Menureverse2 14 1 Reverse 50 Mente cit loi spa Menureverse2 15 1 Reverse 51 Menucheck 16 TXL TYL Menureverse2 16 1 Reverse 52 Menuecheck Gly E ACT Menureverse2 17 1 Reverse 53 Menucheck 18 TXL TXL Menureverse2 18 1 Reverse 54 Menuchec raro Ti T5 Menureverse2 19 1 Reverse 55 sub Basic FORMA Es rice Style 0 0 0 Menuse Menuti Menuse Menuti Menuse Menuti Menuse Menuti Menuse Menuti Menuse Menuti Menuse Menuti Menuse Menuti Menuse Menuti Menuse c c e c e UL e c c e UL e e e e c c e e ELO O s EMO roe O8 ey ie oe Qe HOLS OLA Soe Ls Pil ee Ss Osio Ae MS DS OO EN le EQ DEIN Apis Lo ge ike ts La E
36. r As El Search F3 Fa rs re rz Fe ra Fa F12 NOT END Insert Delete 7 High iorst Shiftout ioq 9 Shiftout iod 10 Low iorst 11 Delay 1 12 High iorst 13 Shiftout iod 14 Shiftout iod 15 Low iorst MASTER START STOP MCS 0 ASA MASTER START STOP M250 t 17 Do 18 High iors 19 adr amp h8 LOOP1 EXT P32 20 Shiftout PENES START CYCL 22 Debug He 23 Low iorsy 24 Delay 10 25 Loop M PIERCE1 EXT P33 4 LOOP1 EXT P32 CUTOFF1 RET To program the CT1820 be sure to tinclude CT18xx at the top of the source file Comfile Technology Inc CT1820 User s Manual 10 Of 93 Downloading Programs to the CT1820 After authoring and compiling source code using Cubloc Studio it can be downloaded to the CT1820 via the host PC s RS 232 serial port for execution Once the program is downloaded to the CT1820 it will remain in in the CT1820 s read only memory even between power cycles First the CT1820 s download 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 SPOX 5268 female connector If the host PC does not have any built in RS 232 serial ports a USB to serial adapter c
37. r the CT1820 menu option in Cubloc Studio the contrast value can be read and assigned at runtime as shown below CT18Contrast EERead amp 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 Dain Comes ee RECS Cont value EE Rec hn EDU I Cont value lt 100 Or Cont value gt 200 Then Set and appropriate value if needed Cont valus 150 ENCILE CTLOCONTrast Cont value Comfile Technology Inc CT1820 User s Manual 50 Of 93 Setting the RTC s Date and Time BMP download for CT1721C Touch calibration for CT1721C BMP download for CT1820 Touch calibration for CT1820 Store Current Time to CT1820 RTC In Cubloc Studio s File menu there is a Store Current Time to CT1820 RTC menu option This feature can be used to set the 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 amp HFFF and can be read to set the screen contrast at runtime Comfile Technology Inc CT1820 User s Manual 51 Of 93 Chapter 5 ModPort I O Expansion Comfile Technology Inc CT1820 User s Manual Using the CT2820 with the Modport The Modport is a modular RS 485 Modbus field I O controller from Comfile Technology featuring digital input and outp
38. riable or constant 0 255 Sets the LCD s contrast For best results set between 130 and 160 This value is stored in the EEPROM at address amp HFFF The following program shows how this value can be read and corrected to ensure an appropriate value Dim Coma wells As lo Cont value E Reca ple dis Cont value lt 100 Or Cont value gt 200 Then Ensure an appropriate value Cont valus 150 EndIf CTleContrast Cont value Comfile Technology Inc CT1820 User s Manual 40 Of 93 Chapter 4 Touch Input Comfile Technology Inc CT1820 User s Manual Menu System Library The CT1820 includes additional commands that can be used to create and manipulate menus With this menu library it is easy to create a user interface like that depicted below Comfile Automobile gas pressurizer Select gas nm Autotype Menu Commands Up to 50 menu buttons can be created on the CT1820 Each call to the MenuSet command 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 unlimited number of menus and buttons Comfile Technology Inc CT1820 User s Manual 42 Of 93 MenuSet MenuSet index style x
39. secstetoitacidudevsau idR SS 13 Fini Wabe DOWN Odin idas 14 CTIS20 Start Pack balas 15 Chapter 2 IO A A asa 16 Thee T1920S U O POLLS a 17 O ad iE pESS DIM suc En a Dora Er cueing ie or pastas tan adt uita au deca mr ILLA M eee oe ene ees 20 CTI920 s 1 0 Port Electrical Specifications s iade eodd cxi de er RE RE REOS Ec taa d rr RR CORO ORO ERE R EE PEE EA 23 Interfacing to Proximity SehsOES uve nant ec A cutus sap tac RMERRREU AA c n s vince EO DOC ed 24 CT18XX Series Relays amp Reglsters ii esce A t 26 Chapter o Command Reference iei tees edu ao ia D DU A AA DeL 27 CEISZ0 Analog Input 3 53 95 v aman utat v ida 28 CT1820 S Non Volatlle FRAM x csasaxxuiatas ee rii cue cad eee tea tus daud opi VEI PS rus DM on dd Ded 29 Reak ME Clocks iaa 30 Beep SOUNO hai A none ee Aa 33 RS 232 485 COMMUNMIGAEO Ns dd id PE T EUM 34 ECD Contrast AC USt merits ans il id dd ds 35 Chapter 4 TOUCH INPUT naa a a A Osa 36 Menu Systen Das ca di asa 37 Menu COMME 37 PROCESSING TOUCH IAPUt A PEE 42 TOUCH ePi ini Aisa 44 Setting the RTCS Date arid TIME it a ets Eas 46 Chapter 5 MOGdBOFE FO EXPANSION siete U EPUM Iud M MU AS dus v OU RH pL ROO eee Pare 47 Using the CT2820 with the MOGDOM rriro eheu van A A A ER SEIS RUE RE ER 48 Modport FUNCION EID IY e ob acqua uet gu chiudi AA IEA 49 Modport TSt Progra oi oki A cece rua en It od 54 Chapter o Sal ple Progra nS iis cm cconcancacita tkt anaddaur aet aaa i Roda aaa uetus toe A cu ted HIT Fette
40. 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 necessary 2 The Sys function call is used instead of GetPad to read the touch coordinates CT1721C CT18XX Sep Pad 0 4 5 On Pad Gosub TouchInput On Pad Gosub TouchInput Do Do Loop Loop Touch input MO Wie Del Uke Tx Getpad 2 Tx Sys 10 Ty GetPad 2 Ty 5ys 11 STC ISIC bei Comfile Technology Inc CT1820 User s Manual 47 Of 93 The following program shows how all of the previously mentioned features can be utilized to easily create an intuitive and responsive user interface When a button is pressed its colors will be reversed for visual feedback and a beep sound will be generated for audio feedback Demo for Cutouch Y due lude eq ex Dim TX1 As Integer TY1 As Integer Dim k As Long CES Comte asi 150 Adjust this value to change the screen contrast On Pad Gosub TouchInput MENTES ro OS Menutat be 0 LoS S Menus Siem ie eae Wor OS Menvuratr le iS iS Rn Memuset 12 2 Lol 16 201 105 Menutatle 2 LL Restart Low 18 Do Loop omite ptes TX1 Sys 10 TY1 Sys 11 CirelefiLll A TE Menucneck 0 TE IS i ihen Menureverse 0 CT18beep 20 Audio feedback Ene LE Tft MenuchneckK 1 TXL Vy 1 Then Menureverse 1 CT18beep 20 Audio feedback Ene LE If Menucheck 2 TX1 TY
41. the unit Comfile Technology Inc CT1820 User s Manual 23 Of 93 PWM Output The CT1820 has 3 PWM outputs They are available in the 40 pin I O port as pins 43 44 and 45 Dis zm mm re Je ail olla erede INPUT OUTPUT The following 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 Pw 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 24VDC Comfile Technology Inc CT1820 User s Manual 24 Of 93 C This port contains the RS 232 485 communication channels and the main power supply connection Terminals Description Ch1 Ch2 Ch3 Rs232 Rs232 Rs485 Comfile Technology Inc CT1820 User s Manual 25 Of 93 D These ports consist of the analog input ports and the download port ADC Channel Number InputType Description 0 3 0 20mA For reading current signals 47 7 0 10VDC For reading voltage signals Warning Please do not exceed the specified current and voltage ranges or the device may become damanged Current Transmitter 4 OUT 5 10V DC Power supply Comfile Technology Inc CT1820 User s Manual 26 Of 93 CT1820 s I O Port Electrical Specifications All input pins are 24VDC inputs only Input Specifications Input Voltage Range 20 28VDC R
42. uchscreen LCD Cubloc 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 Touchscreen PLC Cutouch Comfile Technology Inc CT1820 User s Manual 6 Of 93 The CT1820 s Appearance THC Drain Tank S Comfile Technology Inc CT1820 User s Manual 7 Of 93 Comfile Technology Inc CT1820 User s Manual 8 Of 93 DC24V IN DC24V IN NPNTR OUT NPRTR OUT 8 10 12 14 G 17 19 21 23 G 49 51 5355 V G 9 1113 15 16 18 20 22 G 8505254 G CT 1820 vsus Touch conoser COMFILE me or com 9 11 1315 16 15 20 27 G v COMFILE CE te 9 Of 93 CT1820 User s Manual Comfile Technology Inc CUBLOC STUDIO Cubloc Studio is the Integrated Development Environment used to program the CT1820 in both BASIC and Ladder Logic It is a free download available from www ComfileTech com Cubloc Studio ciprogram files x86 comfiletools cu diolsamplesids1302 cul mE X File Edit Device Run Setup Help Dae B9GeQ 3e a BASIC UNENEEEENET IE e de i Const Devicell File Edit Device Run Setup Help Const iorst i n2 algae aoa galm a Const iodio BASIC LADDER 4 Const ioclk 5 Dim I As Int a iP MRE q ES ONE Dim ad
43. ut analog input temperature sensing and a variety of other features 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 Tm AA MODPORT Please refer to the illustration below to connect the CT1820 to the Modport POWER LED CT1820 Comfile Technology Inc CT1820 User s Manual 53 Of 93 Modport Function Library This section describes each of the CT1820 s built in Modport functions Each Modport module is assigned an ID The ID is used to distinguish it from other modules of the same type The ID can be assigned a number from 0 9 See the Modport manual for more information MD DORLS 8 pin Output Rela MPRelay ID RelayNumber OnOff ID The ID of the module 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 Neeley alee 6 all murca on module l relay gt 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 off 0 Command to turn on off a pin on the MD DOSO8 DC source output module Mesourcs le xq Turn

Download Pdf Manuals

image

Related Search

Related Contents

Bharat Heavy Electricals Limited Electronics Division  Détecteur DAX 3F - Dalemans Gas Detection  EK Water Blocks 3831109840627  operating instructions and warranty  SCAN-DIY CR-PRO User's Manual  3 - Belgian Financial Forum  Descargar - Plataforma Som Energia  The Puck / Tool Sharpener ザ・パック 取扱説明書  セミスタティックロープ  (JIS IPX8 (JIS IPX8 防水規格合格)  

Copyright © All rights reserved.
Failed to retrieve file