gfk1283e - cimplicity hmi basic control engine language reference manual

of 522 /522
GE Fanuc Automation CIMPLICITY  ®  Monitoring and Control Products CIMPLICITY HMI Basic Control Engine Language Reference Manual GFK-1283E November 1998  

Author: eduardo-nascimento

Post on 07-Jan-2016

328 views

Category:

Documents


21 download

Embed Size (px)

DESCRIPTION

Cimplicity reference language

TRANSCRIPT

  • GE Fanuc Automation

    CIMPLICITY Monitoring and Control Products

    CIMPLICITY HMI

    Basic Control EngineLanguage Reference Manual

    GFK-1283E November 1998

  • GFL-002

    Warning notices are used in this publication to emphasize that hazardous voltages, currents, temperatures, or otherconditions that could cause personal injury exist in the equipment or may be associated with its use.In situations where inattention could cause either personal injury or damage to equipment, a Warning notice is used.

    Caution notices are used where equipment might be damaged if care is not taken.

    NoteNotes merely call attention to information that is especially significant to understanding and operating the equipment.

    This document is based on information available at the time of publication. While efforts have been made to be accurate,the information contained herein does not purport to cover all details or variations in hardware or software, not to providefor every possible contingency in connection with installation, operation, or maintenance. Features may be describedherein which are not present in all hardware and software systems. GE Fanuc Automation assumes no obligation ofnotice to holders of this document with respect to changes subsequently made.

    GE Fanuc Automation makes no representation of warranty, expressed, implied, or statutory with respect to, and assumesno responsibility for the accuracy, completeness, sufficiency, or usefulness of the information contained herein. Nowarranties of merchantability or fitness for purpose shall apply.

    CIMPLICITY is a registered trademark of GE Fanuc Automation North America, Inc.Windows, Windows NT, and Windows 95 are registered trademarks of Microsoft CorporationPortions of the Basic Control Engine are copyright 1992-1995 by Summit Software

    This manual was produced using Doc-To-Help, by WexTech Systems, Inc.

    Copyright 1996-1997 GE Fanuc Automation North America, Inc.All rights reserved

  • GFK-1283 iii

    Preface

    Contents of this ManualChapter 1. Introduction: Gives a brief description of the Basic Control Enginelanguage syntax, and lists the language elements by category.

    Chapter 2. Symbols: Defines the symbols used by the Basic Control Enginelanguage.

    Chapter 3. A: Discusses language elements - Abs through Atn.Chapter 4. B: Discusses language elements - Basic.Capability through ByVal.Chapter 5. C: Discusses language elements - Call through CVErr.Chapter 6. D: Discusses language elements - Date through DropListBox.Chapter 7. E: Discusses language elements - ebAbort through Expression.Chapter 8. F: Discusses language elements - False through Fv.Chapter 9. G: Discusses language elements - Get through GroupBox.Chapter 10. H: Discusses language elements - Hex through Hour.Chapter 11. I: Discusses language elements - If..Then...Else through ItemCount.Chapter 12. K: Discusses language elements- Keywords through Kill.Chapter 13. L: Discusses language elements - LBound through LTrim$.Chapter 14. M: Discusses language elements - Main through MsgBox.Chapter 15. N: Discusses language elements - Name through Null.Chapter 16. O: Discusses language elements - Object through Or.Chapter 17. P: Discusses language elements - Pi through Pv.Chapter 18. R: Discusses language elements - Random through RTrim$.Chapter 19. S: Discusses language elements - SaveFilename$ through SYD.Chapter 20. T: Discusses language elements - Tab through Type.Chapter 21. U: Discusses language elements - UBound through User-DefinedTypes.

    Chapter 22. V: Discusses language elements - Val through VarType.

  • iv CIMPLICITY HMI Basic Control Engine Language Reference Manual GFK-1283

    Chapter 23. W: Discusses language elements - Weekday through WriteIni.Chapter 24. X: Discusses language elements - Xor.Chapter 25. Y: Discusses language elements - Year.Chapter 26. CIMPLICITY Extensions to Basic: Discusses the CIMPLICITYextensions to the Basic Control Engine language - Acquire through TraceEnable.

    Related PublicationsFor more information, refer to these publications:

    CIMPLICITY MMI and MES/SCADA Products User Manual (GFK-1180)CIMPLICITY MMI and MES/SCADA Products Basic Control Engine ProgramEditor Operation Manual (GFK-1305)CIMPLICITY MMI and MES/SCADA Products Event Editor Operation Manual(GFK-1282)

  • GFK-1283 v

    ContentsIntroduction 1-1

    About the Basic Control Syntax ............................................................................................. 1-1Using the Basic Control Engine Language Reference............................................................ 1-2Language Elements By Category ........................................................................................... 1-3

    Arrays....................................................................................................................... 1-3Clipboard ................................................................................................................. 1-3Comments ................................................................................................................ 1-3Comparison operators .............................................................................................. 1-3Controlling other programs...................................................................................... 1-4Controlling program flow ........................................................................................ 1-4Controlling the operating environment .................................................................... 1-5Conversion ............................................................................................................... 1-5Data types ................................................................................................................ 1-6Database................................................................................................................... 1-6Date/time.................................................................................................................. 1-6DDE ......................................................................................................................... 1-7Error handling .......................................................................................................... 1-7File I/O..................................................................................................................... 1-8File system ............................................................................................................... 1-8Financial................................................................................................................... 1-9Getting information from Basic Control Engine ...................................................... 1-9INI Files ................................................................................................................... 1-9Logical/binary operators ........................................................................................ 1-10Math....................................................................................................................... 1-10Miscellaneous ........................................................................................................ 1-10Numeric operators.................................................................................................. 1-11Objects ................................................................................................................... 1-11Parsing ................................................................................................................... 1-11Predefined dialogs.................................................................................................. 1-11Printing .................................................................................................................. 1-12Procedures.............................................................................................................. 1-12String operators...................................................................................................... 1-12Strings .................................................................................................................... 1-12User dialogs ........................................................................................................... 1-13Variables and constants.......................................................................................... 1-14Variants.................................................................................................................. 1-14

    Symbols 2-1& (operator) ........................................................................................................................... 2-1 (keyword) ............................................................................................................................. 2-1() (keyword) ........................................................................................................................... 2-2* (operator)............................................................................................................................. 2-3+ (operator) ............................................................................................................................ 2-4

  • vi CIMPLICITY HMI Basic Control Engine Language Reference Manual GFK-1283

    - (operator) ............................................................................................................................. 2-5. (keyword) ............................................................................................................................. 2-6/ (operator).............................................................................................................................. 2-7< (operator) ............................................................................................................................ 2-7 (operator) ............................................................................................................................ 2-8>= (operator) .......................................................................................................................... 2-9\ (operator).............................................................................................................................. 2-9^ (operator)........................................................................................................................... 2-10_ (keyword) .......................................................................................................................... 2-11

    A 3-1Abs (function)......................................................................................................................... 3-1And (operator) ........................................................................................................................ 3-2AnswerBox (function) ............................................................................................................ 3-3Any (data type) ....................................................................................................................... 3-4AppActivate (statement)......................................................................................................... 3-5AppClose (statement) ............................................................................................................. 3-6AppFind$ (function)............................................................................................................... 3-7AppGetActive$ (function)...................................................................................................... 3-7AppGetPosition (statement) ................................................................................................... 3-8AppGetState (function) .......................................................................................................... 3-9AppHide (statement) ............................................................................................................ 3-10AppList (statement) .............................................................................................................. 3-11AppMaximize (statement) .................................................................................................... 3-12AppMinimize (statement)..................................................................................................... 3-13AppMove (statement)........................................................................................................... 3-14AppRestore (statement) ........................................................................................................ 3-15AppSetState (statement) ....................................................................................................... 3-16AppShow (statement) ........................................................................................................... 3-17AppSize (statement) ............................................................................................................. 3-18AppType (function) .............................................................................................................. 3-19ArrayDims (function) ........................................................................................................... 3-20Arrays (topic) ....................................................................................................................... 3-21ArraySort (statement) ........................................................................................................... 3-23Asc (function)....................................................................................................................... 3-23AskBox$ (function) .............................................................................................................. 3-24AskPassword$ (function) ..................................................................................................... 3-25Atn (function) ....................................................................................................................... 3-26

    B 4-1Basic.Capability (method) ...................................................................................................... 4-1Basic.Eoln$ (property) ........................................................................................................... 4-2Basic.FreeMemory (property) ................................................................................................ 4-2Basic.HomeDir$ (property).................................................................................................... 4-2Basic.OS (property)................................................................................................................ 4-3Basic.PathSeparator$ (property) ............................................................................................ 4-3Basic.Version$ (property) ...................................................................................................... 4-4Beep (statement)..................................................................................................................... 4-4Begin Dialog (statement)........................................................................................................ 4-5

  • GFK-1283 Contents vii

    Boolean (data type) ................................................................................................................ 4-7ByRef (keyword).................................................................................................................... 4-7ByVal (keyword).................................................................................................................... 4-8

    C 5-1Call (statement) ...................................................................................................................... 5-1CancelButton (statement) ....................................................................................................... 5-2CBool (function) .................................................................................................................... 5-3CCur (function) ...................................................................................................................... 5-4CDate, CVDate (functions) .................................................................................................... 5-5CDbl (function) ...................................................................................................................... 5-6ChDir (statement) ................................................................................................................... 5-6ChDrive (statement) ............................................................................................................... 5-7CheckBox (statement) ............................................................................................................ 5-8Choose (function)................................................................................................................... 5-9Chr, Chr$ (functions) ........................................................................................................... 5-10CInt (function)...................................................................................................................... 5-11Clipboard$ (function)........................................................................................................... 5-12Clipboard$ (statement)......................................................................................................... 5-12Clipboard.Clear (method)..................................................................................................... 5-13Clipboard.GetFormat (method) ............................................................................................ 5-13Clipboard.GetText (method) ................................................................................................ 5-14Clipboard.SetText (method)................................................................................................. 5-14CLng (function).................................................................................................................... 5-15Close (statement).................................................................................................................. 5-15ComboBox (statement)......................................................................................................... 5-16Command, Command$ (functions)....................................................................................... 5-17Comments (topic) ................................................................................................................. 5-17Comparison Operators (topic) .............................................................................................. 5-18Const (statement).................................................................................................................. 5-20Constants (topic) .................................................................................................................. 5-22Cos (function)....................................................................................................................... 5-23CreateObject (function)........................................................................................................ 5-23CSng (function) .................................................................................................................... 5-25CStr (function) ..................................................................................................................... 5-26CurDir, CurDir$ (functions)................................................................................................. 5-27Currency (data type)............................................................................................................. 5-27CVar (function) .................................................................................................................... 5-28CVErr (function) .................................................................................................................. 5-29

    D 6-1Date (data type) ...................................................................................................................... 6-1Date, Date$ (functions) .......................................................................................................... 6-2Date, Date$ (statements) ........................................................................................................ 6-3DateAdd (function) ................................................................................................................ 6-4DateDiff (function)................................................................................................................. 6-6DatePart (function)................................................................................................................. 6-7DateSerial (function) .............................................................................................................. 6-8DateValue (function).............................................................................................................. 6-9Day (function) ........................................................................................................................ 6-9DDB (function) .................................................................................................................... 6-10DDEExecute (statement) ...................................................................................................... 6-11DDEInitiate (function) ......................................................................................................... 6-12

  • viii CIMPLICITY HMI Basic Control Engine Language Reference Manual GFK-1283

    DDEPoke (statement)........................................................................................................... 6-13DDERequest, DDERequest$ (functions).............................................................................. 6-14DDESend (statement)........................................................................................................... 6-15DDETerminate (statement)................................................................................................... 6-16DDETerminateAll (statement).............................................................................................. 6-17DDETimeout (statement) ..................................................................................................... 6-18Declare (statement)............................................................................................................... 6-19DefType (statement)............................................................................................................. 6-25Dialog (function) .................................................................................................................. 6-27Dialog (statement) ................................................................................................................ 6-28Dim (statement) .................................................................................................................... 6-29Dir, Dir$ (functions)............................................................................................................. 6-31DiskDrives (statement) ......................................................................................................... 6-33DiskFree (function) .............................................................................................................. 6-33DlgControlId (function)........................................................................................................ 6-34DlgEnable (function) ............................................................................................................ 6-35DlgEnable (statement) .......................................................................................................... 6-36DlgFocus (function).............................................................................................................. 6-37DlgFocus (statement)............................................................................................................ 6-38DlgListBoxArray (function) ................................................................................................. 6-39DlgListBoxArray (statement) ............................................................................................... 6-40DlgProc (function)................................................................................................................ 6-41DlgSetPicture (statement)..................................................................................................... 6-44DlgText (statement).............................................................................................................. 6-45DlgText$ (function).............................................................................................................. 6-46DlgValue (function).............................................................................................................. 6-48DlgValue (statement)............................................................................................................ 6-49DlgVisible (function)............................................................................................................ 6-50DlgVisible (statement).......................................................................................................... 6-51Do...Loop (statement)........................................................................................................... 6-53DoEvents (function) ............................................................................................................. 6-55DoEvents (statement) ........................................................................................................... 6-56Double (data type) ................................................................................................................ 6-57DropListBox (statement) ...................................................................................................... 6-58

    E 7-1ebAbort (constant).................................................................................................................. 7-1ebAbortRetryIgnore (constant)............................................................................................... 7-1ebApplicationModal (constant) .............................................................................................. 7-2ebArchive (constant) .............................................................................................................. 7-2ebBold (constant) ................................................................................................................... 7-2ebBoldItalic (constant) ........................................................................................................... 7-3ebBoolean (constant).............................................................................................................. 7-3ebCancel (constant) ................................................................................................................ 7-3ebCritical (constant) ............................................................................................................... 7-4ebCurrency (constant) ............................................................................................................ 7-4ebDataObject (constant) ......................................................................................................... 7-4ebError (constant)................................................................................................................... 7-5ebDate (constant).................................................................................................................... 7-5ebDefaultButton1 (constant) .................................................................................................. 7-6ebDefaultButton2 (constant) .................................................................................................. 7-6ebDefaultButton3 (constant) .................................................................................................. 7-6ebDirectory (constant) ............................................................................................................ 7-7ebDos (constant)..................................................................................................................... 7-7

  • GFK-1283 Contents ix

    ebDouble (constant) ............................................................................................................... 7-8ebEmpty (constant) ................................................................................................................ 7-8ebExclamation (constant) ....................................................................................................... 7-8ebHidden (constant) ............................................................................................................... 7-9ebIgnore (constant)................................................................................................................. 7-9ebInformation (constant) ...................................................................................................... 7-10ebInteger (constant).............................................................................................................. 7-10ebItalic (constant)................................................................................................................. 7-11ebLong (constant)................................................................................................................. 7-11ebNo (constant) .................................................................................................................... 7-11ebNone (constant) ................................................................................................................ 7-12ebNormal (constant)............................................................................................................. 7-12ebNull (constant) .................................................................................................................. 7-13ebObject (constant) .............................................................................................................. 7-13ebOK (constant) ................................................................................................................... 7-13ebOKCancel (constant) ........................................................................................................ 7-14ebOKOnly (constant) ........................................................................................................... 7-14ebQuestion (constant)........................................................................................................... 7-14ebReadOnly (constant) ......................................................................................................... 7-15ebRegular (constant) ............................................................................................................ 7-15ebRetry (constant) ................................................................................................................ 7-16ebRetryCancel (constant) ..................................................................................................... 7-16ebSingle (constant)............................................................................................................... 7-17ebString (constant) ............................................................................................................... 7-17ebSystem (constant) ............................................................................................................. 7-18ebSystemModal (constant) ................................................................................................... 7-18ebVariant (constant) ............................................................................................................. 7-18ebVolume (constant) ............................................................................................................ 7-19ebWin32 (constant) .............................................................................................................. 7-19ebYes (constant)................................................................................................................... 7-20ebYesNo (constant) .............................................................................................................. 7-20ebYesNoCancel (constant) ................................................................................................... 7-20Empty (constant) .................................................................................................................. 7-21End (statement) .................................................................................................................... 7-21Environ, Environ$ (functions).............................................................................................. 7-22EOF (function) ..................................................................................................................... 7-23Eqv (operator) ...................................................................................................................... 7-24Erase (statement) .................................................................................................................. 7-25Erl (function)........................................................................................................................ 7-26Err (function)........................................................................................................................ 7-27Err (statement)...................................................................................................................... 7-28Error (statement) .................................................................................................................. 7-29Error Handling (topic).......................................................................................................... 7-30Error, Error$ (functions) ...................................................................................................... 7-31Exit Do (statement) .............................................................................................................. 7-32Exit For (statement).............................................................................................................. 7-33Exit Function (statement) ..................................................................................................... 7-33Exit Sub (statement) ............................................................................................................. 7-34Exp (function) ...................................................................................................................... 7-34Expression Evaluation (topic) .............................................................................................. 7-35

  • x CIMPLICITY HMI Basic Control Engine Language Reference Manual GFK-1283

    F 8-1False (constant) ...................................................................................................................... 8-1FileAttr (function) .................................................................................................................. 8-2FileCopy (statement) .............................................................................................................. 8-3FileDateTime (function) ......................................................................................................... 8-4FileDirs (statement) ................................................................................................................ 8-5FileExists (function) ............................................................................................................... 8-6FileLen (function)................................................................................................................... 8-6FileList (statement)................................................................................................................. 8-7FileParse$ (function) .............................................................................................................. 8-9Fix (function)........................................................................................................................ 8-10For...Next (statement)........................................................................................................... 8-11Format, Format$ (functions)................................................................................................. 8-13FreeFile (function)............................................................................................................... 8-18Function...End Function (statement)..................................................................................... 8-18Fv (function)......................................................................................................................... 8-22

    G 9-1Get (statement) ....................................................................................................................... 9-1GetAttr (function)................................................................................................................... 9-4GetObject (function)............................................................................................................... 9-6Global (statement) .................................................................................................................. 9-7GoSub (statement) .................................................................................................................. 9-7Goto (statement) ..................................................................................................................... 9-8GroupBox (statement) ............................................................................................................ 9-9

    H 10-1Hex, Hex$ (functions) .......................................................................................................... 10-1HLine (statement)................................................................................................................. 10-2Hour (function)..................................................................................................................... 10-2HPage (statement) ................................................................................................................ 10-3HScroll (statement)............................................................................................................... 10-3HWND (object) .................................................................................................................... 10-4HWND.Value (property)...................................................................................................... 10-5

    I 11-1If...Then...Else (statement) ................................................................................................... 11-1IIf (function) ......................................................................................................................... 11-2Imp (operator) ...................................................................................................................... 11-3Inline (statement).................................................................................................................. 11-4Input# (statement)................................................................................................................. 11-4Input, Input$ (functions)....................................................................................................... 11-7InputBox, InputBox$ (functions) ......................................................................................... 11-8InStr (function) ..................................................................................................................... 11-9Int (function) ...................................................................................................................... 11-10Integer (data type) .............................................................................................................. 11-10IPmt (function) ................................................................................................................... 11-11IRR (function) .................................................................................................................... 11-13Is (operator)........................................................................................................................ 11-14IsDate (function)................................................................................................................. 11-15IsEmpty (function).............................................................................................................. 11-15

  • GFK-1283 Contents xi

    IsError (function) ............................................................................................................... 11-16IsMissing (function) ........................................................................................................... 11-17IsNull (function)................................................................................................................. 11-17IsNumeric (function) .......................................................................................................... 11-18IsObject (function) ............................................................................................................. 11-19Item$ (function).................................................................................................................. 11-20ItemCount (function) .......................................................................................................... 11-21

    K 12-1Keywords (topic).................................................................................................................. 12-1Kill (statement)..................................................................................................................... 12-2

    L 13-1LBound (function)................................................................................................................ 13-1LCase, LCase$ (functions) ................................................................................................... 13-2Left, Left$ (functions) .......................................................................................................... 13-2Len (function)....................................................................................................................... 13-3Let (statement)...................................................................................................................... 13-4Like (operator) ..................................................................................................................... 13-5Line Input# (statement) ........................................................................................................ 13-6Line Numbers (topic) ........................................................................................................... 13-6Line$ (function).................................................................................................................... 13-7LineCount (function) ............................................................................................................ 13-8ListBox (statement) .............................................................................................................. 13-9Literals (topic).................................................................................................................... 13-11Loc (function)..................................................................................................................... 13-12Lock (statement)................................................................................................................. 13-13Lof (function) ..................................................................................................................... 13-15Log (function) .................................................................................................................... 13-15Long (data type) ................................................................................................................. 13-16LSet (statement) ................................................................................................................. 13-17LTrim, LTrim$ (functions)................................................................................................. 13-18

    M 14-1Main (statement) .................................................................................................................. 14-1MCI (function) ..................................................................................................................... 14-2Mid, Mid$ (functions) .......................................................................................................... 14-4Mid, Mid$ (statements) ........................................................................................................ 14-5Minute (function) ................................................................................................................. 14-6MIRR (function)................................................................................................................... 14-6MkDir (statement) ................................................................................................................ 14-8Mod (operator) ..................................................................................................................... 14-9Month (function) ................................................................................................................ 14-10MsgBox (function) ............................................................................................................. 14-11MsgBox (statement) ........................................................................................................... 14-13Msg.Close (method) ........................................................................................................... 14-14Msg.Open (method) ........................................................................................................... 14-15Msg.Text (property) ........................................................................................................... 14-16Msg.Thermometer (property) ............................................................................................. 14-17

  • xii CIMPLICITY HMI Basic Control Engine Language Reference Manual GFK-1283

    N 15-1Name (statement).................................................................................................................. 15-1Named Parameters (topic) .................................................................................................... 15-3Net.AddCon (method) .......................................................................................................... 15-4Net.Browse$ (method) ......................................................................................................... 15-5Net.CancelCon (method) ...................................................................................................... 15-6Net.GetCon$ (method) ......................................................................................................... 15-7Net.User$ (property) ............................................................................................................ 15-7New (keyword)..................................................................................................................... 15-8Not (operator)....................................................................................................................... 15-9Nothing (constant) .............................................................................................................. 15-10Now (function) ................................................................................................................... 15-10NPer (function)................................................................................................................... 15-11Npv (function) .................................................................................................................... 15-12Null (constant).................................................................................................................... 15-13

    O 16-1Object (data type) ................................................................................................................. 16-1Objects (topic)...................................................................................................................... 16-2Oct, Oct$ (functions) ............................................................................................................ 16-5OKButton (statement) .......................................................................................................... 16-6On Error (statement)............................................................................................................. 16-7Open (statement) .................................................................................................................. 16-9OpenFilename$ (function).................................................................................................. 16-11Operator Precedence (topic)............................................................................................... 16-12Operator Precision (topic) .................................................................................................. 16-13Option Base (statement) ..................................................................................................... 16-13Option Compare (statement) .............................................................................................. 16-14Option CStrings (statement) ............................................................................................... 16-15OptionButton (statement) ................................................................................................... 16-16OptionGroup (statement).................................................................................................... 16-17Or (operator) ...................................................................................................................... 16-18

    P 17-1Pi (constant) ......................................................................................................................... 17-1Picture (statement)................................................................................................................ 17-2PictureButton (statement) ..................................................................................................... 17-4Pmt (function)....................................................................................................................... 17-6PopupMenu (function) ......................................................................................................... 17-7PPmt (function) .................................................................................................................... 17-8Print (statement) ................................................................................................................... 17-9Print# (statement) ............................................................................................................... 17-10Private (statement).............................................................................................................. 17-12Public (statement)............................................................................................................... 17-14PushButton (statement) ...................................................................................................... 17-16Put (statement).................................................................................................................... 17-17Pv (function)....................................................................................................................... 17-19

  • GFK-1283 Contents xiii

    R 18-1Random (function) ............................................................................................................... 18-1Randomize (statement)......................................................................................................... 18-2Rate (function) ..................................................................................................................... 18-3ReadIni$ (function) .............................................................................................................. 18-4ReadIniSection (statement) .................................................................................................. 18-5Redim (statement) ................................................................................................................ 18-6Rem (statement) ................................................................................................................... 18-7Reset (statement) .................................................................................................................. 18-7Resume (statement) .............................................................................................................. 18-8Return (statement) ................................................................................................................ 18-9Right, Right$ (functions)...................................................................................................... 18-9RmDir (statement).............................................................................................................. 18-10Rnd (function) .................................................................................................................... 18-11RSet (statement) ................................................................................................................. 18-12RTrim, RTrim$ (functions) ................................................................................................ 18-13

    S 19-1SaveFilename$ (function) .................................................................................................... 19-1Screen.DlgBaseUnitsX (property)........................................................................................ 19-3Screen.DlgBaseUnitsY (property)........................................................................................ 19-3Screen.Height (property) ...................................................................................................... 19-4Screen.TwipsPerPixelX (property) ...................................................................................... 19-4Screen.TwipsPerPixelY (property) ...................................................................................... 19-5Screen.Width (property)....................................................................................................... 19-5Second (function) ................................................................................................................. 19-6Seek (function) ..................................................................................................................... 19-7Seek (statement) ................................................................................................................... 19-8Select...Case (statement) ...................................................................................................... 19-9SelectBox (function) .......................................................................................................... 19-11SendKeys (statement)......................................................................................................... 19-12Set (statement).................................................................................................................... 19-15SetAttr (statement) ............................................................................................................. 19-16Sgn (function)..................................................................................................................... 19-17Shell (function)................................................................................................................... 19-18Sin (function) ..................................................................................................................... 19-19Single (data type) ............................................................................................................... 19-19Sleep (statement) ................................................................................................................ 19-20Sln (function) ..................................................................................................................... 19-20Space, Space$ (functions) .................................................................................................. 19-21Spc (function)..................................................................................................................... 19-21SQLBind (function)............................................................................................................ 19-22SQLClose (function) .......................................................................................................... 19-23SQLError (function)........................................................................................................... 19-24SQLExecQuery (function).................................................................................................. 19-25SQLGetSchema (function) ................................................................................................. 19-26SQLOpen (function)........................................................................................................... 19-29SQLRequest (function)....................................................................................................... 19-30SQLRetrieve (function) ...................................................................................................... 19-31SQLRetrieveToFile (function) ........................................................................................... 19-33Sqr (function) ..................................................................................................................... 19-34Stop (statement) ................................................................................................................. 19-34

  • xiv CIMPLICITY HMI Basic Control Engine Language Reference Manual GFK-1283

    Str, Str$ (functions) ............................................................................................................ 19-35StrComp (function)............................................................................................................. 19-35String (data type) ................................................................................................................ 19-37String, String$ (functions) .................................................................................................. 19-38Sub...End Sub (statement) .................................................................................................. 19-39Switch (function) ................................................................................................................ 19-41SYD (function) ................................................................................................................... 19-42System.Exit (method) ......................................................................................................... 19-43System.FreeMemory (property) ......................................................................................... 19-43System.FreeResources (property)....................................................................................... 19-44System.MouseTrails (method)............................................................................................ 19-44System.Restart (method) .................................................................................................... 19-44System.TotalMemory (property) ........................................................................................ 19-45System.WindowsDirectory$ (property).............................................................................. 19-45System.WindowsVersion$ (property) ................................................................................ 19-45

    T 20-1Tab (function)....................................................................................................................... 20-1Tan (function)....................................................................................................................... 20-2Text (statement).................................................................................................................... 20-2TextBox (statement) ............................................................................................................. 20-3Time, Time$ (functions)....................................................................................................... 20-5Time, Time$ (statements)..................................................................................................... 20-6Timer (function) ................................................................................................................... 20-6TimeSerial (function) ........................................................................................................... 20-7TimeValue (function) ........................................................................................................... 20-7Trim, Trim$ (functions)........................................................................................................ 20-8True (constant) ..................................................................................................................... 20-8Type (statement)................................................................................................................... 20-9

    U 21-1UBound (function) ............................................................................................................... 21-1UCase, UCase$ (functions) .................................................................................................. 21-2Unlock (statement) ............................................................................................................... 21-3User-Defined Types (topic).................................................................................................. 21-5

    V 22-1Val (function) ....................................................................................................................... 22-1Variant (data type)................................................................................................................ 22-2VarType (function)............................................................................................................... 22-5VLine (statement)................................................................................................................. 22-6VPage (statement) ................................................................................................................ 22-6VScroll (statement)............................................................................................................... 22-7

    W 23-1Weekday (function) .............................................................................................................. 23-1While...Wend (statement)..................................................................................................... 23-2Width# (statement) ............................................................................................................... 23-3WinActivate (statement)....................................................................................................... 23-4WinClose (statement) ........................................................................................................... 23-5WinFind (function)............................................................................................................... 23-6WinList (statement) .............................................................................................................. 23-6

  • GFK-1283 Contents xv

    WinMaximize (statement) .................................................................................................... 23-7WinMinimize (statement)..................................................................................................... 23-8WinMove (statement)........................................................................................................... 23-9WinRestore (statement)...................................................................................................... 23-10WinSize (statement) ........................................................................................................... 23-11Word$ (function)................................................................................................................ 23-12WordCount (function) ........................................................................................................ 23-12Write# (statement).............................................................................................................. 23-13WriteIni (statement) ........................................................................................................... 23-14

    X 24-1Xor (operator) ...................................................................................................................... 24-1

    Y 25-1Year (function) ..................................................................................................................... 25-1

    CIMPLICITY Extensions to Basic 26-1Acquire (Function) ............................................................................................................... 26-1Acquire, Release (Statements).............................................................................................. 26-2AlarmGenerate (Method) ..................................................................................................... 26-3AlarmUpdate (Method) ........................................................................................................ 26-4ChangePassword (Method) .................................................................................................. 26-6CimEMAlarmEvent (Object) ............................................................................................... 26-6CimEMAlarmEvent.AlarmID (Property, Read) ................................................................... 26-7CimEMAlarmEvent.FinalState (Property, Read) ................................................................. 26-7CimEMAlarmEvent.GenTime (Property, Read) .................................................................. 26-8CimEMAlarmEvent.Message (Property, Read) ................................................................... 26-8CimEMAlarmEvent.PrevState (Property, Read) .................................................................. 26-9CimEMAlarmEvent.RefID (Property, Read) ....................................................................... 26-9CimEMAlarmEvent.ReqAction (Property, Read) .............................................................. 26-10CimEMAlarmEvent.ResourceID (Property, Read) ............................................................ 26-10CimEMEvent (Object) ....................................................................................................... 26-10CimEMEvent.ActionID (Property, Read) .......................................................................... 26-11CimEMEvent.AlarmEvent (Function)................................................................................ 26-11CimEMEvent.EventID (Property, Read)............................................................................ 26-11CimEMEvent.PointEvent ................................................................................................... 26-12CimEMEvent.TimeStamp (Property, Read)....................................................................... 26-12CimEMEvent.Type (Property, Read) ................................................................................. 26-13CimEMPointEvent (Object) ............................................................................................... 26-14CimEMPointEvent.Id ......................................................................................................... 26-14CimEMPointEvent.State (Property, Read)......................................................................... 26-15CimEMPointEvent.TimeStamp (Property, Read) .............................................................. 26-15CimEMPointEvent.Value (Property, Read) ....................................................................... 26-15CimGetEMEvent (Function) .............................................................................................. 26-16CimIsMaster (Function) ..................................................................................................... 26-16GetKey (Function).............................................................................................................. 26-17LogStatus (Property, Read/Write) ...................................................................................... 26-18Point (Subject).................................................................................................................... 26-19Point (Object)..................................................................................................................... 26-22Point.AlarmAck (Property, Read) ...................................................................................... 26-22Point.Cancel (Method) ....................................................................................................... 26-23Point.DataType (Property, Read) ....................................................................................... 26-24

  • xvi CIMPLICITY HMI Basic Control Engine Language Reference Manual GFK-1283

    Point.DisplayFormat (Property, Read) ............................................................................... 26-25Point.DownloadPassword (Property, Read) ....................................................................... 26-25Point.Elements (Property, Read) ........................................................................................ 26-26Point.EnableAlarm (Method) ............................................................................................. 26-26Point.Enabled (Property, Read).......................................................................................... 26-26Point.EuLabel (Property, Read) ......................................................................................... 26-27Point.Get (Method)............................................................................................................. 26-27Point.GetArray (Method) ................................................................................................... 26-28Point.GetNext (Function) ................................................................................................... 26-29Point.GetNext (Method)..................................................................................................... 26-29Point.GetRawArray (Method) ............................................................................................ 26-30Point.GetValue (Property, Read)........................................................................................ 26-31Point.HasEuConv (Property, Read).................................................................................... 26-31Point.Id (Property, Read/Write) ......................................................................................... 26-32Point.InUserView (Property, Read).................................................................................... 26-32Point.Length (Property, Read)............................................................................................ 26-33Point.OnAlarm (Method) ................................................................................................... 26-33Point.OnAlarmAck (Method) ............................................................................................. 26-34Point.OnChange (Method) ................................................................................................. 26-34Point.OnTimed (Method) ................................................................................................... 26-35Point.PointTypeId (Property, Read) ................................................................................... 26-35Point.RawValue (Property, Read/Write) ............................................................................ 26-36Point.ReadOnly (Property, Read)....................................................................................... 26-37Point.Set (Method) ............................................................................................................. 26-37Point.SetArray (Method) .................................................................................................... 26-38Point.SetpointPriv (Property, Read) ................................................................................... 26-39Point.SetRawArray (Method) ............................................................................................. 26-39Point.SetValue (Property, Write) ....................................................................................... 26-40Point.State (Property, Read)............................................................................................... 26-41Point.TimeStamp (Property, Read) .................................................................................... 26-42Point.Value (Property, Read/Write) ................................................................................... 26-42PointGet (Function)............................................................................................................ 26-43PointGetNext (Function) .................................................................................................... 26-43PointSet (Statement)........................................................................................................... 26-44Trace (Command)............................................................................................................... 26-45TraceEnable/TraceDisable (Command) ............................................................................. 26-45

    Index i

  • GFK-1283 1-1

    Introduction

    About the Basic Control SyntaxThis chapter contains a complete, alphabetical listing of all keywords in the BasicControl Engine script language. When syntax is described, the following notationsare used:

    Notation DescriptionWhile...Wend Elements belonging to the Basic Control Engine script

    language, referred to in this manual as keywords, appear inthe typeface shown to the left.

    variable Items that are to be replaced with information that yousupply appear in italics. The type of replacement is indicatedin the following description.

    text$ The presence of a type-declaration character following aparameter signifies that the parameter must be a variable ofthat type or an expression that evaluates to that type.

    If a parameter does not appear with a type-declarationcharacter, then its type is described in the text.

    [parameter] Square brackets indicate that the enclosed items areoptional.

    In Basic Control Engine script language, you cannot end astatement with a comma, even if the parameters are optional:

    MsgBox "Hello",,"Message"

  • 1-2 CIMPLICITY HMI Basic Control Engine Language Reference Manual GFK-1283

    Using the Basic Control Engine Language ReferenceThe Reference chapter is organized like a dictionary containing an entry for eachlanguage element. The language elements are categorized as follows:

    Category Descriptiondata type Any of the support data types, such as Integer, String, and

    so on.

    function Language element that takes zero or more parameters, performsan action, and returns a value

    keyword Language element that doesnt fit into any of the other categories

    operator Language elements that cause an evaluation to be performedeither on one or two operands

    statement Language element that takes zero or more parameters andperforms an action.

    topic Describes information about a topic rather than a languageelement

    Each entry in the Reference chapter contains the following headings:

    Heading DescriptionSyntax The syntax of the language element. The conventions used in

    describing the syntax are described in Chapter 1.

    Description Contains a one-line description of that language element.

    Comments Contains any other important information about that languagekeyword.

    Example Contains an example of that language keyword in use. Anexample is provided for every language keyword.

    See Also Contains a list of other entries in the Reference section thatrelate either directly or indirectly to that language element.

  • GFK-1283 Introduction 1-3

    Language Elements By CategoryThe following subsections list Basic Control Engine language elements by category.

    ArraysArrayDims Return the number of dimensions of an array

    ArraySort Sort an array

    Erase Erase the elements in one or more arrays

    LBound Return the lower bound of a given array dimension

    Option Base Change the default lower bound for array declarations

    ReDim Re-establish the dimensions of an array

    UBound Return the upper bound of a dimension of an array

    ClipboardClipboard$ (function) Return the content of the clipboard as a stringClipboard$ (statement) Set the content of the clipboardClipboard.Clear Clear the clipboard

    Clipboard.GetFormat Get the type of data stored in the clipboard

    Clipboard.GetText Get text from the clipboard

    Clipboard.SetText Set the content of the clipboard to text

    Comments Comment to end-of-line

    REM Add a comment

    Comparison operators< Less than

    Greater than

    >= Greater than or equal to

  • 1-4 CIMPLICITY HMI Basic Control Engine Language Reference Manual GFK-1283

    Controlling other programsAppActivate Activate an application

    AppClose Close an application

    AppFind Return the full name of an application

    AppGetActive$ Return the name of the active applicationAppGetPosition Get the position and size of an application

    AppGetState Get the window state of an application

    AppHide Hide an application

    AppList Fill an array with a list of running applications

    AppMaximize Maximize an application

    AppMinimize Minimize an application

    AppMove Move an application

    AppRestore Restore an application

    AppSetState Set the state of an applications window

    AppShow Show an application

    AppSize Change the size of an application

    AppType Return the type of an application

    SendKeys Send keystrokes to another application

    Shell Execute another application

    Controlling program flowCall Call a subroutine

    Choose Return a value at a given index

    Do...Loop Execute a group of statements repeatedly

    DoEvents (function) Yield control to other applicationsDoEvents (statement) Yield control to other applicationsEnd Stop execution of a script

    Exit Do Exit a Do loop

    Exit For Exit a For loop

    For...Next Repeat a block of statement a specified number oftimes

    GoSub Execute at a specific label, allowing control to returnlater

    Goto Execute at a specific label

    If...Then...Else Conditionally execute one or more statements

    IIf Return one of two values depending on a condition

  • GFK-1283 Introduction 1-5

    Main Define a subroutine where execution begins

    Return Continue execution after the most recent GoSub

    Select...Case Execute one of a series of statements

    Sleep Pause for a specified number of milliseconds

    Stop Suspend execution, returning to a debugger (ifpresent)

    Switch Return one of a series of expressions depending on acondition

    While...Wend Repeat a group of statements while a condition is True

    Controlling the operating environmentCommand, Command$ Return the command lineEnvironm Environ$ Return a string from the environment

    ConversionAsc Return the value of a character

    CBool Convert a value to a Boolean

    CCur Convert a value to Currency

    CDate Convert a value to a Date

    CDbl Convert a value to a Double

    Chr, Chr$ Convert a character value to a stringCInt Convert a value to an Integer

    CLng Convert a value to a Long

    CSng Convert a value to a Single

    CStr Convert a value to a String

    CVar Convert a value to a Variant

    CVDate Convert a value to a Date

    CVErr Convert a value to an error

    Hex, Hex$ Convert a number to a hexadecimal stringIsDate Determine if an expression is convertible to a date

    IsError Determine if a variant contains a user-defined errorvalue

    IsNumeric Determine if an expression is convertible to a number

    Oct, Oct$ Convert a number to an octal stringStr, Str$ Convert a number to a stringVal Convert a string to a number

  • 1-6 CIMPLICITY HMI Basic Control Engine Language Reference Manual GFK-1283

    Data typesBoolean Data type representing True of False values

    Currency Data type used to hold monitary values

    Date Data type used to hold dates and times

    Double Data type used to hold real number with 15-16 digitsof precision

    HWND Data type used to hold windows

    Integer Data type used to hold whole numbers with 4 digits ofprecision

    Long Data type used to hold whole numbers with 10 digitsof precision

    Object Data type used to hold OLE automation objectsSingle Data type used to hold real number with 7 digits of

    precision

    String Data type used to hold sequences of characters

    Variant Data type that holds a number, string, or OLEautomation objects

    DatabaseSQLBind Specify where to place results with SQLRetrieveSQLClose Close a connection to a databaseSQLError Return error information when an SQL function failsSQLExecQuery Execute a query on a databaseSQLGetSchema Return information about the structure of a databaseSQLOpen Establishes a connection with a databaseSQLRequest Run a query on a databaseSQLRetrieve Retrieve all or part of a querySQLRetrieveToFile Retrieve all or part of a query, placing results in a file

    Date/timeDate, Date$ (functions) Return the current dateDate, Date$ (statements) Change the system dateDateAdd Add a number of date intervals to a date

    DateDiff Subtract a number of date intervals from a date

    DatePart Return a portion of a date

    DateSerial Assemble a date from date parts

    DateValue Convert a string to a date

  • GFK-1283 Introduction 1-7

    Day Return the day component of a date value

    Hour Return the hour part of a date value

    Minute Return the minute part of a date value

    Month Return the month part of a date value

    Now Return the date and time

    Second Return the seconds part of a date value

    Time, Time$ (functions) Return the current system timeTime, Time$(statements)

    Set the system time

    Timer Return the number of elapsed seconds since midnight

    TimeSerial Assemble a date/time value from time components

    TimeValue Convert a string to a date/time value

    Weekday Return the day of the week of a date value

    Year Return the year part of a date value

    DDEDDEExecute Execute a command in another application

    DDEInitiate Initiate a DDE conversation with another application

    DDEPoke Set a value in another application

    DDERequest,DDERequest$

    Return a value from another application

    DDESend Establishe a DDE conversation, then sets a value inanother application

    DDETerminate Terminate a conversation with another application

    DDETerminateAll Terminate all conversations

    DDETimeOut Set the timeout used for non-responding applications

    Error handlingErl Return the line with the error

    Err (function) Return the error that caused the current error trapErr (statement) Set the value of the errorError Simulate a trappable runtime error

    Error, Error$ Return the text of a given errorOn Error Trap an error

    Resume Continue execution after an error trap

  • 1-8 CIMPLICITY HMI Basic Control Engine Language Reference Manual GFK-1283

    File I/OClose Close one or more files

    Eof Determine if the end-of-file has been reached

    FreeFile Return the next available file number

    Get Read data from a random or binary file

    Input# Read data from a sequential file into variables

    Input, Input$ Read a specified number of bytes from a fileLine Input # Read a line of text from a sequential file

    Loc Return the record position of the file pointer within a file

    Lock Lock a section of a file

    Lof Return the number of bytes in an open file

    Open Open a file for reading or writing

    Print # Print data to a file

    Put Write data to a binary or random file

    Reset Close all open files

    Seek Return the byte position of the file pointer within a file

    Seek Set the byte position of the file pointer which a file

    UnLock Unlock part of a file

    Width# Specify the line width for sequential files

    Write # Write data to a sequential file

    File systemChDir Change the current directory

    ChDrive Change the current drive

    CurDir, CurDir$ Return the current directoryDir, Dir$ Return files in a directoryDiskDrives Fill an array with valid disk drive letters

    DiskFree Return the free space on a given disk drive

    FileAttr Return the mode in which a file is open

    FileCopy Copy a file

    FileDateTime Return the date and time when a file was last modified

    FileDirs Fill an array with a subdirectory list

    FileExists Determine if a file exists

    FileLen Return the length of a file in bytes

    FileList Fill an array with a list of files

    FileParse$ Return a portion of a filename

  • GFK-1283 Introduction 1-9

    GetAttr Return the attributes of a file

    Kill Delete files from disk

    MkDir Create a subdirectory

    Name Rename a file

    RmDir Remove a subdirectory

    SetAttr Change the attributes of a file

    FinancialDDB Return depreciation of an asset using double-declining

    balance method

    Fv Return the future value of an annuity

    IPmt Return the interest payment for a given period of anannuity

    IRR Return the internal rate of return for a series ofpayments and receipts

    MIRR Return the modified internal rate of return

    NPer Return the number of periods of an annuity

    Npv Return the net present value of an annuity

    Pmt Return the payment for an annuity

    PPmt Return the principal payment for a given period of anannuity

    Pv Return the present value of an annuity

    Rate Return the interest rate for each period of an annuity

    Sln Return the straight-line depreciation of an asset

    SYD Return the Sum of Years Digits depreciation of anasset

    Getting information from Basic Control EngineBasic.Capability Retu