User Tools

Site Tools

한국어

cubloc:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cubloc:index [2022/09/29 09:22]
COMFILE Technology [CUBLOC Studio and BASIC]
cubloc:index [2023/09/11 12:47]
COMFILE Technology [Additional Information]
Line 1: Line 1:
 +~~META:
 +title = CUBLOC - Embedded Controller
 +~~
  
 +{{htmlmetatags>​
 +metatag-description=(The CUWIN is a line of BASIC and Ladder Logic programmable logic controllers (PLC) from COMFILE Technology.)
 +metatag-keywords=(CUBLOC,​ Programmable Logic Controller, PLC, BASIC, Ladder Logic) ​
 +}}
 +
 +====== CUBLOC ======
 +
 +<​html>​
 +<span style="​font-weight:​bold;​ font-size: 16pt;">​BASIC and Ladder Logic Embedded Controller</​span>​
 +</​html>​
 +
 +[[../​Product warning|Warnings and Precautions]]
 +
 +===== Overview =====
 +
 +The main advantage of CUBLOC is that it fills Ladder Logic’s weaknesses with the BASIC language. Ladder Logic is good enough to replace sequence diagrams, but to collect data, print graphics, and process complex tasks is asking a little bit too much. That is why we added the BASIC language. You can now run both Ladder Logic and/or BASIC!
 +
 +  * [[.:​DownloadCubloc:​|Preparation]]
 +  * [[.:​Comportcheck:​|COM Port check]]
 +
 +
 +====== Core Modules ======
 +
 +^ MODEL     ^ CB210          ^ CB220         ^ CB320         ^ CB280         ^ CB380         ^ CB290          ^ CB400          ^ CB405          ^ CB405RT ​                ^
 +^ PACKAGE ​  | Arduino style  | 24pin DIP     | 24pin DIP     | 64pin module ​ | 64pin module ​ | 108pin module ​ | 108pin module ​ | 80pin module ​  | 80pin module ​           |
 +^ I/O PORT  | 20             | 16 + 6        | 16 + 6        | 49            | 49            | 91             | 83             | 64             | 58                      |
 +^ FLASH     | 80KB           | 80KB          | 200KB         | 80KB          | 200KB         | 80KB           | 200KB          | 200KB          | 200KB                   |
 +^ DATA      | 3KB            | 3KB           | 7KB           | 3KB           | 7KB           | 28KB           | 7KB            | 110KB          | 110KB                   |
 +^ EEPROM ​   | 4KB            | 4KB           | 4KB           | 4KB           | 4KB           | 4KB            | 4KB            | 4KB            | 4KB                     |
 +^ A/D       | 6CH 10bit      | 8CH 10bit     | 8CH 10bit     | 8CH 10bit     | 8CH 10bit     | 8CH 10bit      | 16CH 10bit     | 16CH 10bit     | 8CH 10bit \\ 8CH 16bit  |
 +^ PWM       | 3CH 16bit      | 6CH 10~16bit ​ | 6CH 10~16bit ​ | 6CH 10~16bit ​ | 6CH 10~16bit ​ | 6CH 10~16bit ​  | 12CH 10~16bit ​ | 12CH 10~16bit ​ | 12CH 10~16bit ​          |
 +^ RS232C ​   | 1CH            | 1CH           | 1CH           | 1CH           | 1CH           | 1CH            | 3CH            | 3CH            | 3CH                     |
 +^           ​| ​ [[.:​CB210|Pinout]] ​ |  [[.:​CB220/​320|Pinout]] ​ ||  [[.:​CB280/​380|Pinout]] ​ ||  [[.:​CB290|Pinout]] ​ |  [[.:​CB400|Pinout]] ​ |  [[.:​CB405|Pinout]] ​ |  [[.:​CB405RT|Pinout]] ​ |
 +^           ​| ​ [[http://​www.comfiletech.com/​cb210/​|Buy]] ​ |  [[http://​www.comfiletech.com/​cb220/​|Buy]] ​ |  [[http://​www.comfiletech.com/​cb320/​|Buy]] ​ |  [[http://​www.comfiletech.com/​cb280/​|Buy]] ​ |  [[http://​www.comfiletech.com/​cb380/​|Buy]] ​ |  [[http://​www.comfiletech.com/​cb290/​|Buy]] ​ |  [[http://​www.comfiletech.com/​cb400/​|Buy]] ​ |  [[http://​www.comfiletech.com/​cb405/​|Buy]] ​ |  [[http://​www.comfiletech.com/​cb405rt/​|Buy]] ​ |
 +
 +
 +----
 +
 +====== CUBLOC Studio and BASIC ======
 +
 +For an introduction to programming CUBLOC devices with CUBLOC Studio, please refer to the [[https://​comfiletech.com/​content/​cubloc/​cubloc_startbook.pdf|CUBLOC Start Book]].
 +
 +  * [[.:How to Use CUBLOC STUDIO:]]
 +  * [[.:CUBLOC BASIC Language:]]
 +    * [[.:Sub and Function:]]
 +    * [[.:​Variables:​]]
 +    * [[.:Array and Constants:​]]
 +    * [[.:​Operators:​]]
 +    * [[.:​Modifiers & Expressing Numbers:]]
 +    * [[.:The BASIC Preprocessor:​]]
 +    * [[.:​Interrupts:​]]
 +    * [[.:​Interoperating with Ladder Logic]]
 +    * [[.:Math Functions:​]]
 +    * [[.:String Functions:​]]
 +    * [[.:Type Conversion:​]]
 +
 +===== System Library =====
 +
 +^  -A-                      ^  -B-            ^  -C-                 ​^ ​ -D-              ^  -E-            ^  -F-               ^
 +| [[.:​Abs:​]] ​               | [[.:​Bcd2bin:​]] ​ | [[.:​Checkbf:​]] ​      | [[.:​Dcd:​]] ​       | [[.:​Eeread:​]] ​  | [[.:​Fabs:​]] ​       |
 +| [[.:​Acos:​]] ​              | [[.:​Bclr:​]] ​    | [[.:​Chr:​]] ​          | [[.:​Debug:​]] ​     | [[.:​Eewrite:​]] ​ | [[.:​Float:​]] ​      |
 +| [[.:​Adin:​]] ​              | [[.:​Beep:​]] ​    | [[.:​Compare:​]] ​      | [[.:​Dec:​]] ​       | [[.:​Ekeypad:​]] ​ | [[.:​Floor:​]] ​      |
 +| [[.:​Alias:​]] ​             | [[.:​Bfree:​]] ​   | [[.:​Const:​]] ​        | [[.:​Decr:​]] ​      | [[.:​Exp:​]] ​     | [[.:​For...Next:​]] ​ |
 +| [[.:​Aliason,​ Aliasoff:​]] ​ | [[.:​Bin2bcd:​]] ​ | [[.:Const Device:​]] ​ | [[.:​Delay:​]] ​     |                 | [[.:​Fp:​]] ​         |
 +| [[.:​Asc:​]] ​               | [[.:​Blen:​]] ​    | [[.:Cos, Cosh:​]] ​    | [[.:​Dim:​]] ​       |                 | [[.:​Freepin:​]] ​    |
 +| [[.:​Asin:​]] ​              | [[.:​Bytein:​]] ​  | [[.:​Count:​]] ​        | [[.:​Do...Loop:​]] ​ |                 | [[.:​Freqout:​]] ​    |
 +| [[.:​Atan:​]] ​              | [[.:​Byteout:​]] ​ | [[.:​Countreset:​]] ​   | [[.:​DP:​]] ​        ​| ​                ​| ​                   |
 +|                           ​| ​                ​| ​                     | [[.:​Dtzero:​]] ​    ​| ​                ​| ​                   |
 +
 +^  -G-            ^  -H-              ^  -I-                             ​^ ​ -K-           ​^ ​ -L-          ^
 +| [[.:​Get:​]] ​     | [[.:​Hadin:​]] ​     | [[.:​I2cread:​]] ​                  | [[.:​Keyin:​]] ​  | [[.:​Left:​]] ​  |
 +| [[.:​Geta:​]] ​    | [[.:​Hadin2:​]] ​    | [[.:​I2creadna:​]] ​                | [[.:​Keyinh:​]] ​ | [[.:​Len:​]] ​   |
 +| [[.:​Geta2:​]] ​   | [[.:​Heap:​]] ​      | [[.:​I2cstart:​]],​ [[.:​I2cstop:​]] ​ | [[.:​Keypad:​]] ​ | [[.:​Log:​]] ​   |
 +| [[.:​Getcrc:​]] ​  | [[.:​Heapclear:​]] ​ | [[.:​I2cwrite:​]] ​                 |                | [[.:​Log10:​]] ​ |
 +| [[.:​Getpad:​]] ​  | [[.:​Heapw:​]] ​     | [[.:​If..Endif:​]] ​                ​| ​               | [[.:​Low:​]] ​   |
 +| [[.:​Getstr:​]] ​  | [[.:​Hex:​]] ​       | [[.:​In:​]] ​                       |                | [[.:​Ltrim:​]] ​ |
 +| [[.:​Getstr2:​]] ​ | [[.:​High:​]] ​      | [[.:​Incr:​]] ​                     |                |               |
 +| [[.:​Gosub:​]] ​   | [[.:​HP:​]] ​        | [[.:​Input:​]] ​                    ​| ​               |               |
 +| [[.:​Goto:​]] ​    | [[.:​Hread:​]] ​     |                                  |                |               |
 +|                 | [[.:​Hwrite:​]] ​    ​| ​                                 |                |               |
 +
 +^  -M-                 ​^ ​ -N-        ^  -O-                 ​^ ​ -P-            ^  -R-             ​^ ​ -S- #1                    ^  -S- #2           ^
 +| [[.:​MemAdr:​]] ​       | [[.:​Ncd:​]] ​ | [[.:On Int:​]] ​       | [[.:​Pause:​]] ​   | [[.:​Ramclear:​]] ​ | [[.:​Select...Case:​]] ​      | [[.:Set SPI:​]] ​   |
 +| [[.:​Menu:​]] ​         | [[.:​Nop:​]] ​ | [[.:On LadderInt:​]] ​ | [[.:​Peek:​]] ​    | [[.:​Reverse:​]] ​  | [[.:​SetDebug:​|Set Debug]] ​ | [[.:Set UIF:​]] ​   |
 +| [[.:​Menucheck:​]] ​    ​| ​            | [[.:On Pad:​]] ​       | [[.:​Poke:​]] ​    | [[.:​Reset:​]] ​    | [[.:Set Display:​]] ​        | [[.:Set Until:​]] ​ |
 +| [[.:​Menureverse:​]] ​  ​| ​            | [[.:On Recv:​]] ​      | [[.:​Pulsout:​]] ​ | [[.:​Right:​]] ​    | [[.:Set I2c:​]] ​            | [[.:​Shiftin:​]] ​   |
 +| [[.:​Menuset:​]] ​      ​| ​            | [[.:On Timer:​]] ​     | [[.:​Put:​]] ​     | [[.:​Rnd:​]] ​      | [[.:Set Int:​]] ​            | [[.:​Shiftout:​]] ​  |
 +| [[.:​Menusetclear:​]] ​ |             | [[.:​Opencom:​]] ​      | [[.:​Puta:​]] ​    | [[.:​Rtcread:​]] ​  | [[.:Set Ladder:​]] ​         | [[.:Sin, Sinh:​]] ​ |
 +| [[.:​Menutitle:​]] ​    ​| ​            | [[.:​Out:​]] ​          | [[.:​Puta2:​]] ​   | [[.:​Rtcwrite:​]] ​ | [[.:Set Modbus:​]] ​         | [[.:​Spc:​]] ​       |
 +| [[.:​Mid:​]] ​          ​| ​            | [[.:​Output:​]] ​       | [[.:​Putstr:​]] ​  | [[.:​Rtrim:​]] ​    | [[.:Set OnGlobal:​]] ​       | [[.:​Spi:​]] ​       |
 +| [[.:​Mpadin:​]] ​       |             | [[.:​Outstat:​]] ​      | [[.:​Pwm:​]] ​     |                  | [[.:Set OnInt:​]] ​          | [[.:​Sqr:​]] ​       |
 +| [[.:​Mpdaouta:​]] ​     |             ​| ​                     | [[.:​Pwmoff:​]] ​  ​| ​                 | [[.:Set OnLadderInt:​]] ​    | [[.:​Stepaccel:​]] ​ |
 +| [[.:​Mpdaoutv:​]] ​     |             ​| ​                     |                 ​| ​                 | [[.:Set OnPad:​]] ​          | [[.:​Steppulse:​]] ​ |
 +| [[.:​Mphadin:​]] ​      ​| ​            ​| ​                     |                 ​| ​                 | [[.:Set OnRecv:​]] ​         | [[.:​Stepstat:​]] ​  |
 +| [[.:​Mpin:​]] ​         |             ​| ​                     |                 ​| ​                 | [[.:Set OnTimer:​]] ​        | [[.:​Stepstop:​]] ​  |
 +| [[.:​Mprelay:​]] ​      ​| ​            ​| ​                     |                 ​| ​                 | [[.:Set OutOnly:​]] ​        | [[.:​String:​]] ​    |
 +| [[.:​Mpsink:​]] ​       |             ​| ​                     |                 ​| ​                 | [[.:Set Pad:​]] ​            | [[.:​Sys:​]] ​       |
 +| [[.:​Mpsource:​]] ​     |             ​| ​                     |                 ​| ​                 | [[.:Set RS232:​]] ​          ​| ​                  |
 +| [[.:​Mpthin:​]] ​       |             ​| ​                     |                 ​| ​                 | [[.:Set Rs485:​]] ​          ​| ​                  |
 +
 +
 +^  -T-              ^  -U-           ​^ ​ -V-           ​^ ​ -W-           ​^ ​ -#-                   ^
 +| [[.:​Tadin:​]] ​     | [[.:​Udelay:​]] ​ | [[.:​Val:​]] ​    | [[.:​Wait:​]] ​   | [[.:​define:​|#​define]] ​        |
 +| [[.:Tan, Tanh:​]] ​ | [[.:​Usepin:​]] ​ | [[.:​Valhex:​]] ​ | [[.:​Waittx:​]] ​ | [[.:​if...endif:​|#​if...#​endif]] ​    |
 +| [[.:​Time:​]] ​      | [[.:​Utmax:​]] ​  | [[.:​Valsng:​]] ​ |                | [[.:​ifdef..endif:​|#​ifdef...#​endif]] ​ |
 +| [[.:​Timeset:​]] ​   |                |                |                | [[.:​include:​|#​include]] ​       |
 +
 +===== Graphic/​Display Library =====
 +
 +  * [[.:About CSG Module:|CSG Module]] - Seven Segment Display
 +  * [[.:About CLCD Module:​|CLCD Module]] - Character LCD
 +  * [[.:About GHB3224C Module:​|GHB3224C]] - Monochrome Graphics Display ​
 +   
 +
 +| [[.:​Arc:​]] ​          | [[.:​Contrast:​]] ​     | [[.:​Glayer:​]] ​      | [[.:​Linestyle:​]] ​   |
 +| [[.:​Bmp:​]] ​          | [[.:​Csgdec:​]] ​       | [[.:​Glocate:​]] ​     | [[.:​Locate:​]] ​      |
 +| [[.:​Box:​]] ​          | [[.:​Csghex:​]] ​       | [[.:​Gpaste:​]] ​      | [[.:​Offset:​]] ​      |
 +| [[.:​Boxclear:​]] ​     | [[.:​Csgnput:​]] ​      | [[.:​Gpop:​]] ​        | [[.:​Overlay:​]] ​     |
 +| [[.:​Boxfill:​]] ​      | [[.:​Csgxput:​]] ​      | [[.:​Gprint:​]] ​      | [[.:​Paint:​]] ​       |
 +| [[.:​Cls:​]] ​          | [[.:​Csron,​Csroff:​]] ​ | [[.:​Gpush:​]] ​       | [[.:​Print:​]] ​       |
 +| [[.:​Circle:​]] ​       | [[.:​Defchr:​]] ​       | [[.:​Hpaste:​]] ​      | [[.:​Pset:​]] ​        |
 +| [[.:​Circlefill:​]] ​   | [[.:​Dotsize:​]] ​      | [[.:​Hpop:​]] ​        | [[.:Set Display:​]] ​ |
 +| [[.:​Clcdout:​]] ​      | [[.:​Dprint:​]] ​       | [[.:​Hpush:​]] ​       | [[.:​Style:​]] ​       |
 +| [[.:​Clear:​]] ​        | [[.:​Elfill:​]] ​       | [[.:​Layer:​]] ​       | [[.:​Wmode:​]] ​       |
 +| [[.:​Cmode:​]] ​        | [[.:​Ellipse:​]] ​      | [[.:​Light:​]] ​       |                     |
 +| [[.:​Color:​]] ​        | [[.:​Font:​]] ​         | [[.:​Line,​Lineto:​]] ​ |                     |
 +
 +
 +
 +
 +
 +----
 +
 +
 +====== Ladder Logic ======
 +
 +Ladder Logic'​s greatest advantage is that all circuits are laid out in parallel;
 +they are all processed as fast as the ladder scan time will allow. This allows
 +for a more parallel execution path for unrelated functions.
 +
 +===== How to use Ladder logic =====
 +
 +  *[[.:​Starting Ladder Logic:]]
 +  * [[.:​Registers:​]]
 +  * [[.:Special Regsiters:​|Special Registers]]
 +  *[[.:Using I/O:|Using Ladder Logic I/O (About Alias)]]
 +  *[[.:Edit Ladder Logic:]]
 +  *[[.:​Monitorling:​|Monitoring]]
 +  *[[cubloc:​comparison_logic:​index|Comparison Logic]]
 +  *[[.:​Invalid Ladder Logic:]]
 +  <​html><​!--*[[.:​AD Input with MSB Logic:​]]--></​html>​
 +
 +
 +
 +===== Low Level Commands =====
 +
 +| [[.:​LOAD,​LOADN,​OUT:​]] ​ | [[.:​Comparison Logic:​]] ​  |
 +| [[.:​NOT,​AND,​OR:​]] ​     | [[.:​TON,​TAON:​]] ​         |
 +| [[.:​SETOUT,​RSTOUT:​]] ​  | [[.:​TOFF,​TAOFF:​]] ​       |
 +| [[.:​DEFCON:​]] ​         | [[.:​TMON,​TAMON:​]] ​       |
 +| [[.:​DF,​DFN:​]] ​         | [[.:​CTU,​CTD:​]] ​          |
 +| [[.:​LOOP:​]] ​           | [[.:​KCTU,​KCTD:​]] ​        |
 +| [[.:​MCS,​MCSCLR:​]] ​     |  |
 +
 +===== High Level Commands =====
 +
 +  * [[.:Storing Words and Double Words:]]
 +  * [[.:Binary, Decimal, Hexadecimal:​]]
 +
 +| [[.:​CALLS,​SBRT,​RET:​]] ​          | [[.:​WINV,​DWINV:​]] ​   |
 +| [[.:​FMOV:​]] ​                    | [[.:​WMOV,​DWMOV:​]] ​   |
 +| [[.:​GMOV:​]] ​                    | [[.:​WMUL:​]] ​         |
 +| [[.:​GOTO,​LABEL:​]] ​              | [[.:​WNEG,​DWNEG:​]] ​   |
 +| [[.:​INTON:​]] ​                   | [[.:​WOR,​DWOR:​]] ​     |
 +| [[.:​stepset_stepout:​|STEPOUT]] ​ | [[.:​WRCL,​DWRCL:​]] ​   |
 +| [[.:​stepset_stepout:​|STEPSET]] ​ | [[.:​WRCR,​DWRCR:​]] ​   |
 +| [[.:​TND:​]] ​                     | [[.:​WROL,​DWROL:​]] ​   |
 +| [[.:​WADD,​DWADD:​]] ​              | [[.:​WROR,​DWROR:​]] ​   |
 +| [[.:​WAND,​DWAND:​]] ​              | [[.:​WSUB,​DWSUB:​]] ​   |
 +| [[.:​WBCD:​]] ​                    | [[.:​WXCHG,​DWXCHG:​]] ​ |
 +| [[.:​WBCNT,​DWBCNT:​]] ​            | [[.:​WXOR,​DWXOR:​]] ​   |
 +| [[.:​WBIN:​]] ​                    ​| ​                     |
 +| [[.:​WCMP,​DWCMP:​]] ​              ​| ​                     |
 +| [[.:​WDIV,​DWDIV:​]] ​              ​| ​                     |
 +| [[.:​WINC,​WDEC:​]] ​               |                      |
 +
 +
 +----
 +
 +====== Additional Information ======
 +
 +  * [[.:About Modbus:]]
 +  * [[.:About CODESYS Modbus Address:]]
 +  * [[.:RS232C Howto:]]
 +  * [[.:​Interfacing:​|I/​O Interfacing]]
 +  * [[.:​I2C(CUNET) Interface:​]]
 +  * [[.:Using RS-232 on the CB400/​405/​405RT]]
 +
 +====== Application Notes ======
 +
 +  * [[.:Switch Input:]]
 +  * [[.:Keypad Input:]]
 +  * [[.:​Temperature Sensor:]]
 +  * [[.:Sound Bytes:]]
 +  * [[.:RC Servo Motor:]]
 +  * [[.:Digital Thermometer:​]]
 +  * [[.:DS1302 RTC:]]
 +  * [[.:MCP3202 12 Bit A/D Conversion:​|MCP3202 12-Bit A/D Converter]]
 +  * [[.:Reading from and Writing to an EEPROM:]]
 +  * [[.:​Connecting a Backup Battery to CB290/​CB405:​|Backup Battery for the CB290 / CB405 / CT1721]]
 +  * [[.:BASIC Modbus RTU Slave:|An Example Modbus RTU Slave Written in BASIC]]
 +  * [[.:BASIC Modbus RTU Master:|An Example Modbus RTU Master Written in BASIC]]
 +
 +[[http://​www.comfiletech.com/​content/​cubloc/​cublocmanual.pdf|Cubloc User's Manual PDF file]] - This is the CUBLOC manual as it existed before publishing the Comfile Documentation Library. ​ It is no longer maintained, but remains here as a historical record.
cubloc/index.txt · Last modified: 2023/09/11 12:47 by COMFILE Technology