Professional Documents
Culture Documents
DISCLAIMER
Citect Corporation makes no representations or warranties with respect to this manual and, to the maximum extent permitted by law, expressly limits
its liability for breach of any warranty that may be implied to the replacement of this manual with another. Further, Citect Corporation reserves the right
to revise this publication at any time without incurring an obligation to notify any person of the revision.
COPYRIGHT
Copyright 2004 Citect Corporation. All rights reserved.
TRADEMARKS
Citect Pty. Limited has made every effort to supply trademark information about company names, products and services mentioned in this manual.
Trademarks shown below were derived from various sources.
Citect, CitectHMI, and CitectSCADA are registered trademarks of Citect Corporation.
IBM, IBM PC and IBM PC AT are registered trademarks of International Business Machines Corporation.
MS-DOS, Windows, Windows 95, Windows NT, Windows 98, Windows 2000, Windows for Workgroups, LAN Manager, Microsoft Windows XP, Excel
and MSMAIL are trademarks of Microsoft Corporation.
DigiBoard, PC/Xi and Com/Xi are trademarks of DigiBoard.
Novell, Netware and Netware Lite are registered trademarks of Novell Inc.
dBASE is a trademark of Borland Inc.
GENERAL NOTICE
Some product names used in this manual are used for identification purposes only and may be trademarks of their respective companies.
July 2004 edition for CitectSCADA Version 6.0
Manual Revision Version 6.0.
Printed in Australia.
Contents
Introducing Cicode
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Using Cicode Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Part I
Using Cicode
Chapter 1
Chapter 2
Chapter 3
iv
Contents
Chapter 4
Chapter 5
21
22
23
23
23
23
Writing Functions
Cicode Function Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Function Uses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Writing Groups of Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Cicode Function Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Creating a Function Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Pseudocode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Using Comments in Cicode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Using Comments for Debugging Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Following Cicode Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Cicode Function Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
End of line markers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Function Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Declaring the Return Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Declaring Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Naming Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Function Argument Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Declaring Argument Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Naming Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Setting Default Values for Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Returning Values from Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Chapter 6
Using Variables
Declaring Variable Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Declaring the Variable Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Naming Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Setting Default Variable Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Using Variable Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Using Database Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Chapter 7
Using Arrays
Declaring Array Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Declaring the Array Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Naming Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Contents
Declaring the Variable Array Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Setting Default (Initial) Array Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Passing Array Elements as Function Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Using One-dimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Using Two-dimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Using Three-dimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Using Array Elements in Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Using the Table (Array) Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
vi
Contents
Starting the Cicode Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Changing the default Cicode Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Creating Cicode files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Creating functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Saving files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Opening Cicode files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Deleting Cicode files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Finding text in Cicode files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Compiling Cicode files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Viewing Cicode compile errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Cicode Editor Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Docking the windows and toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Displaying the Editor Options Properties dialog . . . . . . . . . . . . . . . . . . . . . . 83
Windows and Bars tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Viewing Editor windows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Option Properties tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Language Formatter Properties tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Debugging Cicode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Using debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Debugging functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Debugging functions remotely . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Using breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Inserting or removing breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Enabling/disabling breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Stepping through code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Chapter 13
Contents
Part II
Function Categories
Chapter 14
vii
viii
Contents
Part III
Functions Reference
Chapter 15
Part IV
Functions Reference
Cicode Errors
Chapter 16
Cicode Errors
Hardware/Cicode Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
Cicode and General Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
Appendix A
747
Contents
[Alarm]MaxOptimisedQueries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 759
[Alarm]Period. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
[Alarm]Primary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
[Alarm]SavePeriod. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
[Alarm]SavePrimary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
[Alarm]SaveSecondary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
[Alarm]SaveStyle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
[Alarm]ScanTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
[Alarm]Server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762
[Alarm]SetTimeOnAck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762
[Alarm]SetTimeOnOff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
[Alarm]Sort. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
[Alarm]SortMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
[Alarm]StartTimeout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
[Alarm]SummaryLength. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764
[Alarm]SummaryMode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764
[Alarm]SummarySort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764
[Alarm]SummarySortMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
[Alarm]SummaryTimeout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
[Alarm]SummaryTolerance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
[Alarm]SummaryShutdownMode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
[Alarm]SumStartupCopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
Alarm Logging Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766
[AlarmLog]DefaultSearchDays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
[AlarmLog]Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
[AlarmLog]NumFiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
Animator Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768
[Animator]BoldWeight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 769
[Animator]ButtonCancelMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770
[Animator]CacheSize. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770
[Animator]ConfigureMouseCommand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770
[Animator]EatMouseClick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770
[Animator]EatMouseFocus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771
[Animator]FastDisplay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771
[Animator]FlashTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
[Animator]FormFontWidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
[Animator]FullScreen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
[Animator]InvalidRegionExpansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
[Animator]InvalidRegionQueueLength. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
[Animator]LibraryError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
[Animator]LibraryLength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
[Animator]LibraryTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
[Animator]MaxAn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
[Animator]PrintXScale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
[Animator]PrintYScale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
ix
Contents
[Animator]TabFactor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
[Animator]TemplateUpdate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
[Animator]TooltipFont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
[Animator]UseCTGIfNewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
AnmCursor Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776
[AnmCursor]Colour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776
[AnmCursor]Height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
[AnmCursor]InvertText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
[AnmCursor]MouseSnapToCursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777
[AnmCursor]Thickness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
[AnmCursor]Width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
Backup Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
[Backup]IncludeDBOn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
CrashHandler Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
[CrashHandler]Enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
LLC (CiNet) Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
[LLC]Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
[LLC]Compress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
[LLC]Delay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
[LLC]MaxPending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
[LLC]PollTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
[LLC]Retry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
[LLC]Timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
[LLC]WatchTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
Client Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
[Client]Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
[Client]Primary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
[Client]ReadOnly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
[Client]Standby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
Code Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
[Code]AutoReRead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784
[Code]BackwardCompatibleErrHw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784
[Code]DebugMessage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784
[Code]DllCallErrorPopup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
[Code]DllCallProtect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
[Code]EchoError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
[Code]Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
[Code]HaltOnError. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
[Code]IgnoreCase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
[Code]Queue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
[Code]ScaleCheck. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
[Code]Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
[Code]ShutdownTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
[Code]Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
[Code]Startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 788
Contents
[Code]StrictArgumentCheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 788
[Code]Threads. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 788
[Code]TimeData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789
[Code]TimeSlice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789
[Code]TimeSlicePage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789
[Code]Unsigned. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789
[Code]VBASupport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789
[Code]WriteLocal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
Com Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
[Com]StartTimeOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
CrashMailer Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
[CrashMailer]Enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
CtAPI Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
[CtAPI]Remote. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791
[CtAPI]CpuLoadCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
[CtAPI]CpuLoadSleepMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
CtCicode Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
[CtCicode]MLCommentThreshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
CtDraw.RSC Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
[CtDraw.RSC]BitmapCompression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
[CtDraw.RSC]ColorDepthWarning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
[CtDraw.RSC]PurgeGenieLists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
CtEdit Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
[CtEdit]ANSIToOEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795
[CtEdit]Backup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
[CtEdit]Bin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
[CtEdit]CompileErrorForm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
[CtEdit]Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
[CtEdit]Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
[CtEdit]DbFiles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
[CtEdit]FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
[CtEdit]MaxCicodeFunctions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
[CtEdit]MaxFields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
[CtEdit]MaxHelpRec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
[CtEdit]Run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
[CtEdit]ShowToolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
[CtEdit]SubtAnValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
[CtEdit]SubtPageValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799
[CtEdit]UpdateAnPage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799
[CtEdit]UpdateAnPageVer5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799
[CtEdit]User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
DDE Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
[DDE]Timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
Debug Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
[Debug]CrashOnError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
xi
xii
Contents
[Debug]DisableWinTop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
[Debug]DriverCheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
[Debug]DrWatson . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
[Debug]Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
[Debug]LogShutDown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
[Debug]Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
[Debug]Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
[Debug]Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806
[Debug]ShutDownProtect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806
[Debug]SysErrDsp. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806
[Debug]SysLogSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806
Device Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
[Device]CreateHistoryFiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
[Device]DiscardSpoolOnError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808
[Device]ForceHistoryOpenMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808
[Device]FormLength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808
[Device]LptDosANSIToOEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808
[Device]MaxSpool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808
[Device]SQLConnectOnStartUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
[Device]WatchTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
Dial Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
[Dial]CacheRefresh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810
[Dial]CallerIDTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810
[Dial]ConnectionRetries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810
[Dial]Debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
[Dial]MaxConnectionTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
[Dial]MaxQueueTime. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
[Dial]MaxTimeAfterDisconnect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
[Dial]ModemRetryDelay. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
[Dial]ReadThroughCache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
[Dial]RingCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
[Dial]WatchTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
DisableIO Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
[DisableIO]<Device name> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
[DisableIO]<Server name> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813
DiskDrv Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813
[DiskDrv]UpDateTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813
DNS Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813
[DNS]<Server name> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813
Event Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
[Event]InhibitEvent. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
[Event]Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
[Event]Server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815
[Event]WatchTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
Font Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
Contents
[Font]Echo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
[Font]Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
[Font]General. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
[Font]Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817
[Font]Prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817
General Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817
[General]AdvancedDDEPoll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819
[General]BadOptimise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819
[General]BufferIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819
[General]CheckAddressBoundary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 820
[General]CitectRunningCheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 820
[General]Ctl3D. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 821
[General]DebugInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 821
[General]DisablePlotSetupForm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 821
[General]DisableRemoteBlocking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 821
[General]FormatCheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 822
[General]InfoDestroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 822
[General]LockDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 822
[General]LockRetry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 822
[General]LongFilename . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
[General]OSErrors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
[General]PasswordExpiry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
[General]PointLimitMsg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824
[General]PrinterColourMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824
[General]RegionalNumbersFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824
[General]ServerMonitoringPeriod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824
[General]ShareFiles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825
[General]ShowDriverError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825
[General]Stack. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825
[General]StartDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825
[General]SymbolicInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826
[General]TagDB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826
[General]TagStartDigit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826
[General]TrnPrinter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828
[General]Verbose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828
Internet Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828
[Internet]Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829
[Internet]Display. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830
[Internet]FTPTimeout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830
[Internet]FTPWatchTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830
[Internet]IPAddress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830
[Internet]LogFile. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830
[Internet]Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830
[Internet]Password. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831
[Internet]Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831
xiii
xiv
Contents
[Internet]Redundancy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831
[Internet]RunFTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 832
[Internet]SearchCurrentPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 832
[Internet]Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 832
[Internet]ShowFileFTPDlg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 832
[Internet]ShowSetupDlg. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833
[Internet]UpdateTime. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833
[Internet]ZipFiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833
Intl Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834
[Intl]bDecimal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834
[Intl]iDate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834
[Intl]iTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
[Intl]s1159 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
[Intl]s2359 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
[Intl]sDate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
[Intl]sDecimal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
[Intl]sTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
IOServer Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836
[IOServer]AlwaysCallStopChannel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837
[IOServer]AlwaysCallStopUnit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
[IOServer]AsyncConnect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
[IOServer]BlockWrites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
[IOServer]CacheDebug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
[IOServer]CacheIgnoreDriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
[IOServer]CacheOptMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
[IOServer]CacheReadAhead. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
[IOServer]CancelTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
[IOServer]DebugLogTagHandshake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
[IOServer]HeartTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
[IOServer]HWAlarmOnDeviceDisable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
[IOServer]InitMsg. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
[IOServer]LogTagHandshake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
[IOServer]MaxTagHandshakeSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
[IOServer]Name. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
[IOServer]RedundancyDebug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
[IOServer]SaveFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
[IOServer]SaveNetwork. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
[IOServer]SavePeriod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
[IOServer]SaveTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
[IOServer]Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
[IOServer]TagAddressNoCase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844
[IOServer]WatchDog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844
[IOServer]WatchDogPrimary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844
Kernel Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
[Kernel]BufPoolProtect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
Contents
[Kernel]Idle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
[Kernel]Queue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
[Kernel]Retries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846
[Kernel]Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846
[Kernel]Watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846
[Kernel]WatchdogTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846
[Kernel]WinShutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846
Keyboard Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
[Keyboard]ButtonOnlyLeftClick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
[Keyboard]ButtonRaw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
[Keyboard]EchoPopUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848
[Keyboard]LogExtendedDate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848
[Keyboard]NonPrint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848
[Keyboard]NonPrintChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848
[Keyboard]Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
LAN Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
[LAN]BackOffTime. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
[LAN] Bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
[LAN]CancelOnClose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
[LAN]Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
[LAN]Disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
[LAN]GroupName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
[LAN]KillPiggyBackAck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 852
[LAN]LanA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 852
[LAN]LocalNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853
[LAN]NetBIOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
[LAN]NetTrace. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
[LAN]NetTraceBuf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
[LAN]NetTraceErr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
[LAN]NetTraceLog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855
[LAN]Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855
[LAN]Poll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855
[LAN]ReadPool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856
[LAN]RemoteTimeOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856
[LAN]Retry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856
[LAN]SendTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856
[LAN]SesRecBuf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
[LAN]SesSendBuf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
[LAN]Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
[LAN]TCPIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
[LAN]TimeOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
[LAN]WaitBufTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
[LAN]WritePool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
Language Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859
[Language]CaseSensitive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 859
xv
xvi
Contents
[Language]CharSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 860
[Language]ClientTranslateFile. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 860
[Language]DisplayError. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861
[Language]LocalLanguage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861
Memory Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862
[Memory]Free . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862
[Memory]MinPhyK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862
[Memory]PageLock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863
[Memory]Segment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863
OID Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863
[OID]Reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 863
Page Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 864
[Page]Alarm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 866
[Page]AnmDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 866
[Page]BackgroundColour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867
[Page]ComBreak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868
[Page]ComBreakText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868
[Page]Date. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868
[Page]Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 869
[Page]DelayRenderAdvancedAnimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 869
[Page]DelayRenderAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 869
[Page]DisabledAlarm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 869
[Page]DynamicComBreakColour. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 870
[Page]DynamicComBreakDensity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 870
[Page]DynamicSizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871
[Page]HwAlarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871
[Page]InheritParentScale. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 872
[Page]KeyEcho . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 872
[Page]LastAlarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 872
[Page]MaintainAspectRatio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 872
[Page]MaxInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 873
[Page]MaxLast. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 873
[Page]MaxRecursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 873
[Page]MaxStr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 873
[Page]MenuDisable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 873
[Page]MenuShutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 873
[Page]Name. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 874
[Page]Prompt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 874
[Page]RangeCheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 874
[Page]ScaleTextToMax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 874
[Page]ScanTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 875
[Page]Startup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 875
[Page]StartUpCancel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876
[Page]Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876
[Page]Tip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876
Contents
[Page]TipHelp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876
[Page]TipTimeOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877
[Page]Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877
[Page]Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877
[Page]WinTitle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877
Path Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877
[Path]"PathName" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878
Privilege Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878
[Privilege]Exclusive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878
Protocol Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878
Proxi Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
[Proxi]<I/O Server name> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
RemoteDB Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
[RemoteDB]DefaultComment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
[RemoteDB]DefaultEngFull . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
[RemoteDB]DefaultEngZero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
[RemoteDB]DefaultEU. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
[RemoteDB]DefaultRawFull. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
[RemoteDB]DefaultRawZero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
Report Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882
[Report]ComBreak. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882
[Report]Disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 882
[Report]HeartBeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
[Report]HeartBeatTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
[Report]InhibitEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
[Report]Primary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
[Report]RunStandby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
[Report]Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
[Report]Startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 885
[Report]WatchTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 885
Server Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 885
[Server]Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 885
Shutdown Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886
[Shutdown]NetworkIgnore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886
[Shutdown]NetworkStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886
[Shutdown]Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886
SPC Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 887
[SPC]AlarmBufferSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 888
[SPC]XFreak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 888
[SPC]PartialSubgroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 888
[SPC]RAboveUCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 888
[SPC]RBelowLCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
[SPC]ROutsideCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
[SPC]XAboveUCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
[SPC]XBelowLCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
xvii
xvii
Contents
[SPC]XDownTrend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 889
[SPC]XErratic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 890
[SPC]XGradualDown. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 890
[SPC]XGradualUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 890
[SPC]XMixture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 890
[SPC]XOutsideCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 890
[SPC]XOutsideWL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 890
[SPC]XStratification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
[SPC]XUptrend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
SQL Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
[SQL]QueryTimeout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
[SQL]TextColWidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
Time Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
[Time]Deadband . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
[Time]Disable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
[Time]PollTime. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
[Time]RTsync . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 893
[Time]Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 893
Trend Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 893
[Trend]AllFiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 895
[Trend]BlockByIODevice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 896
[Trend]BytesReadBeforeSleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 896
[Trend]BytesWrittenBeforeSleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 896
[Trend]CacheSize0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 897
[Trend]CacheSize1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 897
[Trend]CacheSize2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898
[Trend]CacheSize3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898
[Trend]CacheSize4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 899
[Trend]CacheSize5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 899
[Trend]CacheSize6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
[Trend]CacheSize7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
[Trend]CacheSize8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 901
[Trend]ClientRequestTime. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 901
[Trend]CopyFilesMessage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 902
[Trend]CursorColour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 902
[Trend]DeleteIfIncompatible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
[Trend]Disable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
[Trend]EnableBackfill. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
[Trend]FileNameType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
[Trend]GapFillMode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 904
[Trend]GapFillSamples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 904
[Trend]GapFillTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905
[Trend]InhibitEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905
[Trend]MaxBackfillsAtOnce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
[Trend]MaxRdnSamples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
Contents
[Trend]MaxRequestLength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
[Trend]MaxSetTableQue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
[Trend]MaxSetTableStnbyPending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
[Trend]MissedSamplesAlarmTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
[Trend]RangeCheck . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
[Trend]ReadWatchTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
[Trend]Redundancy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
[Trend]Server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908
[Trend]ShowCacheSizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908
[Trend]StaggerRequestSubgroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908
[Trend]TrendDebug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 909
[Trend]WatchTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 910
[Trend]WriteWatchTime. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 910
Win Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 911
[Win]AltEsc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 911
[Win]AltSpace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 912
[Win]AltTab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 912
[Win]Configure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 912
[Win]CtrlEsc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 912
[Win]ScreenSaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 913
Index
915
xix
xx
Contents
Introducing Cicode
Cicode is a programming language designed for use in CitectSCADA to monitor
and control plant equipment. It is a structured language similar to Visual Basic
or 'C'. You need no previous programming experience to use it.
Using Cicode, you can access all real-time data (variables) in the CitectSCADA
project, and all CitectSCADA facilities: variable tags, alarms, trends, reports, and
so on. You can use Cicode to interface to various facilities on the computer, such
as the operating system and communication ports. Cicode supports advanced
features including pre-empted multitasking, multi threads, and remote
procedure calls.
Getting Started
Use the following sections as a quick start to using Cicode in your CitectSCADA
projects:
See Also
Cicode can be stored in procedures called functions for multiple reuse and
centralized maintenance. For details, see Using Cicode Files.
Cicode expressions are used to display and log data for monitoring and
analysis, and to trigger various elements in your system, such as alarms,
events, reports, and data logging. For information on using expressions, see
Using Cicode Expressions.
The Cicode Editor is the code editing tool provided with CitectSCADA for
the writing, editing and debugging of your Cicode code. For details, see The
Cicode Editor.
Introducing Cicode
Part I
Using Cicode
In a report
Setting Variables
You can set a Variable in CitectSCADA within a Command field, an Expression
field, or in a Cicode Function, by using the mathematical 'equals' sign ( = )
assignment operator. The value on the right is assigned (set) to the variable on
the left, as shown in the following Cicode example :
<VAR_TAG> = Val;
where:
<VAR_TAG> is the name of the variable,
Val is the value being assigned to the variable.
To set a digital variable (named BIT_1) to OFF (0), use the command:
BIT_1 = 0;
To set a digital variable (named B1_PUMP_101_M) to OFF (0), use the command:
B1_PUMP_101_M = 0;
To set an analog variable (named B1_TIC_101_SP) to a value of ten (10), use the
command:
B1_TIC_101_SP = 10;
You can copy a variable to another by assigning (setting) the value of a variable
to the value of another variable, for example:
B1_PUMP_101_COUNT = B1_PUMP_101_CLIMIT;
Performing Calculations
Mathematical calculations can be performed between variables in a Cicode
statement. For example:
B1_TIC_101_SP = B1_TIC_101_PV + B1_TIC_102_PV - 100;
The example above uses three statements, separated by semi-colons ( ; ). The first
statement sets the variable B1_PUMP_101_COUNT to the value of the variable
B1_PUMP_101_CLIMIT; the second statement sets the variable BATCH_NAME
to the string "Bread"; and the third statement sets the variable B1_TIC_101_SP to
10. Each statement is executed in order.
Note: You must separate each statement in a command with a semi-colon (;) or
CitectSCADA does not recognize the end of a statement, and an error will result
when the project is compiled.
The number of statements you can enter in a command property is limited only
by the size of the field. However, for clarity, you should not use too many
statements; enter the statements into an Include File or write a Cicode Function.
You then refer to the include file or call the function in the command property
field.
Command: @<SETVARS.CII>
In the above example, the SETVARS.CII Include File would contain commands
to be substituted for the Command property when you compile your project, for
example:
PV12 = 10;
PV22 = 20;
PV13 = 15;
PV23 = 59;
PageDisplay("Mimic");
Note: The Include File name can contain a maximum of 64 characters, or 253
characters including a path, and can consist of any characters other than the
semi-colon (;) or the single quote('). You do not need to include the .CII
extension, but if the file is not in the project directory, you must enter the full
path to the file. If the file is not in the project directory, it will not be backed up
with the Backup facility.
Note: Do not attempt to open an Include file within the Cicode Editor.
A key sequence can include provision for the operator to enter data. In the
following example, the operator can set the value of the variable B1_TIC_101_SP:
The value 123 is passed to the command, and B1_TIC_101_SP is set to 123.
You should always use a specific key (for example, Enter) to signal the end of a
key sequence. If, for example, you use the key sequence F2 ####, the operator
must enter 4 characters for the command to be executed - CitectSCADA waits
for the fourth character. But if you use F2 #### Enter, the operator can enter
between one and four characters as required. The command executes as soon as
the Enter key is pressed.
To use more than one argument in a command, separate the arguments with
commas ( , ):
The values 123 and 18 are passed to the command. B1_TIC_101_SP is set to 123
and B1_TIC_101_PV is set to 18.
10
Numeric expression: 8 + 4
In the above example, the value of the expression is always a constant (12)
because the elements of the expression are constants (8 and 4).
See Also
See Also
In this case, the value of the expression is the combined total. As the value of one
variable (or both variables) changes, the value of the expression changes.
Using Cicode Expressions
12
Decision-Making
Some expressions return only one of two logical values, either TRUE(1) or
FALSE(0). You can use these expressions to make decisions, and to perform one
of two actions, depending on whether the return value is TRUE or FALSE. For
example, you can configure a text object with appearance as follows:
B1_TIC
B1_TIC_101_PV + B1_TIC_102_PV
[log]:B1_TIC
B1_TIC
B1_TIC_101_PV + B1_TIC_102_PV
[log]:B1_TIC
B1_PUMP_101_CMD
13
14
where:
FunctionName is the name of the function
Arg1, Arg2, ... are the arguments you pass to the function
Page_Down
Command
PageNext();
Evaluating Functions
You can use a function in any expression. For example, the AlarmActive()
function returns TRUE (1) if any alarms are active, and FALSE (0) if no alarms
are active. In the following text object, either "Alarms Active" or "No Alarms
Active" is displayed, depending on the return value of the expression.
ON text when
AlarmActive(0)
ON Text
"Alarms Active"
16
Note: All functions return a value. This value is often just an indication of the
success or failure of the function, and in many cases (e.g. when used in a
command) the return value can be ignored. You must use the parentheses () in
the function name, even if the function uses no arguments. Function names are
not case-sensitive: PageNext(), pagenext() and PAGENEXT() call the same
function.
Each statement is executed in order. The "Shift" report is started first, the
variable B1_TIC_101_PV is set to 10 next, and finally, the "Boiler 1" page is
displayed.
Functions combine with operators and conditional executors to give you
specific control over your processes, for example, you can test for faulty
conditions and act on them.
PageDisplay("Boiler 1");
This function displays the graphics page called "Boiler 1". Note that when you
pass a string to a function, you must always enclose the string in double quotes.
PageDisplay("Boiler 2");
You can use the Report() function to run a report (for example, the "Shift"
report) when the command executes:
Command
Report("Shift");
The following example uses the Prompt() function to display the message "Press
F1 for Help" on the screen when the command executes:
Command
String assignment
17
18
Login("Manager", "ABC");
The order of the arguments is important to the operation of any function. The
Login() function logs a user into your runtime system. The first argument (
"Manager" ) indicates the name of the user, and the second argument ( "ABC" ) is
the user's password. If you reverse the order of the arguments, the function
would attempt to login a user called "ABC" - if a user by this name does not
exist, an error message displays.
AlarmAck(2, 35);
Command
PageDisplay(Arg1);
When the command executes, the page name is passed to the function as Arg1.
The operator can then display any page, for example:
Date();
The following example shows an entry command event for a graphics page,
using a combination of two functions. The FullName() function returns the name
of the user who is currently logged in to the run-time system, passing this name
to the calling function, Prompt(). When the page is opened, a welcome message
displays in the prompt line.
On page entry
For example, if the current user is John Citizen, the message "Hello, John
Citizen" displays.
19
20
See Also
Alarm Functions
Page Functions
Keyboard Functions
Report Functions
Time/date Functions
Miscellaneous Functions
Alarm Functions
You can use alarm functions to display alarms and their related alarm help
pages, and to acknowledge, disable, and enable alarms. You can assign a
privilege to each command that uses an alarm function, to ensure that only an
operator with the appropriate privilege can perform these commands. However,
you should assign privileges to commands only if you have not assigned
privileges to individual alarms.
22
AlarmHelp: Displays an alarm help page for the alarm. Each alarm in your
system can have an associated help page. The help page for the alarm at the
position of the cursor (when the command is executed) is displayed.
AlarmSplit: Duplicates an entry in the alarm summary display. You can use
this function to add additional comments to the alarm entry.
Page Functions
With the page functions, you can display your graphics pages and the standard
alarm pages.
PageDisplay: Displays a new page on the screen. The Page name or number
is required as an argument. (Use the PageLast() function to go back to the
last page - the page that this new page replaced).
PageGoto: Displays a new page on the screen. This function is similar to the
PageDisplay() function, except that if PageLast() is called, it does not return
to the last page.
PageLast: Displays the graphics page that was displayed before the current
one. You can use this function to 'step back' through the last ten pages.
PageNext: Displays the next graphics page (defined in the Next Page
property of the Pages form).
PagePrev: Displays the previous graphics page (defined in the Prev Page
property of the Pages form).
Keyboard Functions
Keyboard functions control the processing of keyboard entries and the
movement of the keyboard cursor on the graphics page.
KeyBs: Backspaces (removes) the last key from the key command line. You
should use this function with a 'Hotkey' command. It is normally used to
erase keyboard characters during runtime command input.
KeyDown: Moves the cursor down the page to the closest animation point
number (AN).
KeyLeft: Moves the cursor left (across the page) to the closest animation
point number (AN).
KeyRight: Moves the cursor right (across the page) to the closest animation
point number (AN).
KeyUp: Moves the cursor up the page to the closest animation point
number (AN).
Report Functions
To run a report by operator action, use the following function:
Time/date Functions
The following functions return the current date and time:
Miscellaneous Functions
FullName: Returns the full name of the user who is currently logged in to
the system.
InfoForm: Displays the animation information form. This form displays the
real-time data that is controlling the current animation.
23
24
Name: Returns the user name of the user who is currently logged in to the
system.
The line immediately following the FUNCTION statement, contains the name of
the function, which is used to identify the function to CitectSCADA. This name
is referred to when the function is called upon (called) to be executed (perform
26
Function Uses
Cicode functions can have many purposes. Most often, functions are used to
store a common set of commands or statements that would otherwise require
repetitious typing and messy command or expression fields.
Some functions are simple, created to avoid a long command or expression. For
example, the following command increments the variable tag COUNTER:
Command
This command would be easier to use (and re-use) if it was written as a function
that can be called in the command:
Command
IncCounter ( );
To be able to use the function like this, you must write it in a Cicode file, and
declare it with the FUNCTION keyword:
FUNCTION
IncCounter ( )
IF COUNTER < 100 THEN
COUNTER = COUNTER + 1;
ELSE
COUNTER = 0;
END
27
28
Pseudocode
The pseudocode above is a Cicode comment, enclosed between the comment
markers /* and */, and is ignored by the compiler. With pseudocode, you can get
the logic of the function correct in a more readable structure, before you write it
in Cicode syntax, leaving the pseudocode within the finished code as comments.
You should also use comments as file headers at the start of each Cicode file, to
describe the functions in the file - their common purpose, a broad description of
how they achieve that purpose, special conditions for using them, and so on.
You can also use the header to record maintenance details on the file, such as its
version number and date of revision. For example:
/*
** FILE: Recipe Download.Ci
**
** AUTHOR:AJ Smith
**
** DATE: March 1996
**
29
30
Single line ( ! ) and C++ style ( // ) comments can have a line of their own, where
they refer to the block of statements either before or after it. (You should set a
convention for these comments.) These comments can also be on the same line as
a statement, to explain that statement only. All characters after the ! or // (until
the end of the line) are ignored by the compiler.
Block (C style) comments begin with /* and end with */. These C style comments
need no punctuation between the delimiters.
The complete ELSE condition of the IF conditional executor will be ignored (and
not execute) so long as the block comment markers are used in this example.
Note: The inline ( // ) comments have no effect within the block ( /* and */ )
comments (as the whole section is now one big comment), and should remain
unchanged, so that when you do remove the block comments, the inline
comments will become effective again.
Use of comments
31
32
The rules for formatting statements in Cicode functions are simple, and ensure
that the functions compile without error.
You should use white space to make your code more readable. In the example
above, all code between the FUNCTION and END statements is indented, and
the statement within the IF THEN conditional executor is further indented to
make the conditions and actions clear. You should develop a pattern of
indentation - and stick to it. Extra blank lines in the code make it easier to read
(and understand).
where:
END = END Statement: required, indicates the end of the function, keyword,
no semicolon. See the section titled Declaring Functions.
Most statements within the function are separated by semicolons ( ; ) but some
exceptions exist. The FUNCTION and END Statements (the start and end of the
function) have no semicolons, nor does the Scope or Return Data Type
Statements, nor any statement that ends with a reserved word..
Where a statement is split over several lines (for example, within the IF THEN
conditional executor), each line ends with a semicolon - unless it ends in a
reserved word.
Function Scope
The optional Scope Statement of a function (if used), precedes all other
statements of a function declaration in Cicode, including the FUNCTION
Statement.
The scope of a function can be either PRIVATE or PUBLIC, and is declared
public by default. That is, if no Scope Statement is declared, the function will
have public scope.
Both PRIVATE and PUBLIC are Cicode keywords and as such, are reserved.
A private scope function is only accessible (can be called) within the file in which
it is declared.
33
34
To declare the data type that will be returned to the calling code, you must prefix
the FUNCTION Statement with one of the Cicode data type keywords, in the
<ReturnDataType> placeholder in the following example.
<ReturnDataType>
FUNCTION
FunctionName ( <Arguments> )
<Statement> ;
If the RETURN Statement within the function encounters a different data type to
that declared in the Return Data Type Statement, the value is converted to the
declared return data type.
In the example below, the variable Status is declared as a real number within the
function. However, Status is converted to an integer when it is returned to the
caller, because the data type of the return was declared as an integer type in the
Return Data Type Statement:
INT
FUNCTION
FunctionName ( <Arguments> )
<Statement> ;
REAL Status = 5;! declare variable as a REAL number
<Statement> ;
RETURN Status;! returned as an integer number
END
Note: If you do not specify a return data type, the function does not return a
value.
Declaring Functions
The required FUNCTION Statement follows the optional Scope Statement (if
used) and the optional Return Data Type Statement (if used), and precedes all
other statements of a function declaration in Cicode. Everything between it and
the END Statement, contains the function.
Both FUNCTION and END are Cicode keywords and as such, are reserved.
35
36
The FUNCTION Statement must be followed by the Name Statement, then the
Argument Statement, before any code statements that will be processed by the
function.
For information on the Name and Argument Statements, see the sections titled
Naming Argumentsand Function Argument Structure.
All code (as represented by the <Statement> placeholders) located between the
FUNCTION and END Statements, will be executed (processed by the function)
when called to do so.
Functions can execute a large variety of statements, and are commonly used to
process and manipulate data, including the arguments passed when the
function was called, plant-floor and other CitectSCADA data, Windows data,
and so on. CitectSCADA provides many pre-built functions. For more
information, see the section titled Working with Commonly Used Functions.
Naming Functions
The required Name Statement follows the FUNCTION Statement and precedes
the Arguments Statement in a CitectSCADA function. The function name is used
elsewhere in CitectSCADA to activate (call) the function to have it perform the
statements it contains.
Replace the <FunctionName> placeholder in the following function example
with an appropriate name for your function. See the section titled Function
Naming Standardsfor details.
FUNCTION
<FunctionName> ( <Arguments> )
<Statement> ;
<Statement> ;
<Statement> ;
END
Your functions take precedence over any other entity in CitectSCADA with the
same name:
Variable Tags. When you call a function by the same name as a variable tag,
the function has precedence. The variable tag can never be referred to
because the function executes each time the name is used.
Pre-built Functions. You can give your function the same name as any prebuilt Cicode function. Your function takes precedence over the pre-built
function - the pre-built function cannot be called. Because pre-built Cicode
functions cannot be changed, this provides a method of 'modifying' any prebuilt function to suit an application. For example, you might want to display
the message "Press F1 for Help" whenever you display a page. You could
simply write a new function called PageDisplay ( ). The body of the function
would be the statements that display the page and prompt message:
Note: Your function is invoked whenever you use the function name in
CitectSCADA.
37
38
For your function to perform tasks with data, it requires accessibility to the data.
One way to achieve this, is to pass the data directly to the function when the
function is being called. To enable this facility, Cicode utilises arguments in its
function structure. An argument in Cicode is simply a variable that exists in
memory only as long as its function is processing data, so the scope of an
argument is limited to be local only to the function. Arguments cannot be arrays.
Arguments are variables that are processed within the body of the function only.
You cannot use an argument outside of the function that declares it.
As arguments are variables used solely within functions, they must be declared
just as you would otherwise declare a variable in Cicode. See the section titled
Declaring Variable Properties. An argument declaration requires a data type, a
unique name, and may contain an initial value which also behaves as the default
value for the argument.
Note: In the following function syntax example:
where:
In this example, the function would accept any two integer values as its
arguments, add them together, and return them to the caller as one integer value
equal to the summed total of the arguments values passed into the function.
This functionality of passing values into a function as arguments, manipulating
the values in some way, then being able to return the resultant value, is what
makes functions potentially very powerful and time saving. The code only needs
to written once in the function, and can be utilised any number of times from
any number of locations in CitectSCADA. Write once, use many.
39
40
To declare the argument data type that will be used in the function, you must
prefix the Argument Name Statement with one of the Cicode data type
keywords, in the <ArgumentDataType> placeholder in the following example.
FUNCTION
FunctionName ( <ArgumentDataType> <ArgumentName> [ =
<InitialDefaultValue> ] )
<Statement> ;
<Statement> ;
<Statement> ;
END
The Argument Statement in a Cicode function must have only one set of
surrounding parentheses ( ) brackets, even if no arguments are declared in the
function.
If more than one argument is used in the function, each must also be separated
by a comma.
Argument Statements can be separated over several lines to aid in their
readability.
Naming Arguments
If an argument is listed in a Cicode function declaration, the Argument Name
Statement is required, and is listed second, after the required Argument Data
Type Statement, and before the optional Argument Initialisation Statement.
The argument name is used only within the function to refer to the argument
value that was passed into the function when the function was called. The name
of the argument variable should be used in the executable statements of the
You can use up to 32 ASCII text characters to name your arguments. You can use
any valid name except for a reserved word. The case is not important to the
CitectSCADA compiler, so you can use upper and lower case to make your
names clear. For example, iPacketQnty is easier to read than ipacketqnty or
IPACKETQNTY .
FUNCTION
FunctionName ( INT iPacketQnty )
<Statement> ;
<Statement> ;
<Statement> ;
END
To refer to the argument (in the body of your function) you use the name of the
argument in an executable statement:
INT
FUNCTION
AddTwoIntegers ( INT FirstInteger, INT SecondInteger )
INT Solution ;
41
42
The default value for an argument must be of the same data type as declared for
the argument in the Argument Data Type Statement.
You assign a default argument variable value in the same manner that you
assign a Cicode variable value, by using the equals ( = ) assignment operator. For
example:
FUNCTION
PlotProduct ( INT iPackets = 200 , STRING sName = "Packets" )
<Statement> ;
<Statement> ;
<Statement> ;
If you assign a default value for an argument, you do not have to pass a value for
that argument when you call the function, (because the function will use the
default value from the declaration.) To pass an empty argument to a function,
omit any value for the argument in the call. For example, to call the PlotProduct
function declared in the previous example, and accept the default string value of
"Packets", a Cicode function call would look like:
PlotProduct ( 500 , )
Notice that the second argument for the function was omitted from the calling
code. In this instance, the default value for the second argument ( "Packets" )
would remain unchanged, and so would be used as the second argument value
in this particular function call.
If you do call that function and pass in a value for that argument in the call, the
default value is replaced by the argument value being passed in. However, the
arguments are reinitialised every time the function is called, so each subsequent
call to the function will restore the default values originally declared in the
function.
If more than one argument is used in a function, each must also be separated by
a comma. Equally, if a function containing more than one argument is called,
each argument must be accounted for by the caller. In this case, if an argument
value is to be omitted from the call, (to utilise the default value), comma
placeholders must be used appropriately in the call to represent the proper
order of the arguments.
For more information on function calls, callers, and calling, see the section titled
Calling Functions from Commands and Expressions.
Argument Statements can be separated over several lines to aid in their
readability.
43
44
To declare the value that will be returned to the calling code, you must replace
the <ReturnValue> placeholder in the following example with an appropriate
data value to match the Return Data Type as declared in the function.
<ReturnDataType>
FUNCTION
FunctionName ( <Arguments> )
<Statement> ;
<Statement> ;
RETURN <ReturnValue> ;
The RETURN statement passes a value back to the calling procedure (either
another function, command or expression). Outside of the function, the return
value can be read by the calling statement. For example, it can be used by the
caller as a variable (in a command), or animated (in an expression).
45
46
Using Arrays
Variable Declaration Standards
Variable Naming Standards
Variable Scope Standards
Using Cicode Files
-2,147,483,648 to 2,147,483,647
-3.4E38 to 3.4E38
48
Note: If you want to specify a digital data type, use the integer type. Digital
types can either be TRUE(1) or FALSE(0), as can integer types. Cicode INT types
are 32 bit, whereas PLC INT types are only 16 bit. Global and module Cicode
STRING types are only 128 bytes.
Naming Variables
Throughout the body of the function, the variable is referred to by its name. You
can name a variable any valid name except for a reserved word, for example:
STRING
sStr;
REAL Result;
INT
x, y;
OBJECT
hObject;
x = 20, y = 50;
Global variables
A global Cicode variable can be shared across all Cicode files in the system (as
well as across include projects). They cannot be accessed on pages or databases
(e.g. Alarm.dbf).
The variable sDefaultPage could then be used in any function of any Cicode file
in the system.
Note: Use global variables with caution: if you have many such variables being
used by many functions, finding bugs in your program can become time
consuming. Use local variables wherever possible. Global Cicode STRING types
are only 128 bytes, instead of 256 bytes.
Module variables
A module Cicode variable is specific to the file in which it is declared. This
means that it can be used by any function in that file, but not by functions in
other files.
By default, Cicode variables are defined as module, therefore prefixing is not
required (though a prefix of MODULE could be added if desired). Module
variables should be declared at the start of the file. For example:
STRING sDefaultPage = "Mimic";
INT
FUNCTION
MyPageDisplay(STRING sPage)
INT Status;
Status = PageDisplay(sPage);
IF Status <> 0 THEN
PageDisplay(sDefaultPage);
END
49
50
Use module variables with caution; if you have many such variables being used
by many functions, finding bugs in your program can become time-consuming.
Use local variables wherever possible.
Local variables
A local Cicode variable is only recognised by the function within which it is
declared, and can only be used by that function. You must declare local variables
before you can use them.
Any variable defined within a function (i.e., after the function name) is a local
variable, therefore no prefix is needed. Local variables are destroyed when the
function exits.
Local variables always take precedence over global and module variables. If you
define a local variable in a function with the same name as a global or module
variable, the local variable is used; the global/module variable is unaffected by
the function. This situation should be avoided, however, as it is likely to cause
confusion.
See Also
where Tag is the name of the database variable. For example, to change the value
of the database variable "LT131" at run time, you would use the following
statement in your function:
LT131=1200; !Changes the value of LT131 to 1200
See Also
Using Arrays
Using Cicode Files
See Also
Using Arrays
52
Naming Arrays
Throughout the body of a Cicode function, a Cicode variable array is referred to
by its name, and individual elements of an array are referred to by their index.
The index of the first element of an array is 0 (i.e. a four element array has the
indices 0,1,2, and 3). You can name a variable any valid name except for a
reserved word; for example:
STRING
StrArray[5];! list
See Also
Using Arrays
Using Cicode Files
StrArray[5];
This single dimension array contains 5 elements. The compiler multiplies the
number of elements in the array by the size of each element (dependent upon
the Data Type), and allocates storage for the array in consecutive memory
locations.
Note: You cannot declare arrays local to a function. However, they can be
declared as Module (i.e. at the beginning of the Cicode file), or Global. When
referring to the array within your function, you must not exceed the size you set
when you declared the array. The example below would cause an error:
STRINGStrArray[5];
:
StrArray[10] = 100;
:
The compiler allows storage for 5 strings. By assigning a value to a 10th element,
you cause a value to be stored outside the limits of the array, and you could
overwrite another value stored in memory.
See Also
Using Arrays
Using Cicode Files
See Also
Using Arrays
Using Cicode Files
See Also
Using Arrays
Using Cicode Files
53
54
Using Arrays
Using Cicode Files
See Also
ArrayA[0][1]=2
ArrayA[1][1]=4
ArrayA[2][1]=6
ArrayA[3][1]=8.3
ArrayA[4][1]=10.178
Using Arrays
Using Cicode Files
ArrayA[0][0][1]=2
ArrayA[0][2][0]=5
ArrayA[1][0][1]=8
ArrayA[1][2][0]=11
ArrayA[2][0][1]=14
ArrayA[2][2][0]=17
ArrayA[3][0][1]=20
ArrayA[3][2][0]=23
ArrayA[0][1][0]=3
ArrayA[0][2][1]=6
ArrayA[1][1][0]=9
ArrayA[1][2][1]=12
ArrayA[2][1][0]=15
ArrayA[2][2][1]=18
ArrayA[3][1][0]=21
ArrayA[3][2][1]=24
You use arrays in your functions in the same way as other variables, but arrays
have special properties that, in many situations, reduce the amount of code you
must write.
See Also
Using Arrays
Using Cicode Files
See Also
See Also
55
56
You can convert data types without using these Cicode functions, but the result
of the format conversion might not be what you expect. If you want total control
over the conversion process, use the appropriate Cicode functions.
Note: Variables of type object cannot be converted to any other type.
When variables are automatically converted, or when the return value from a
function call is converted, specific rules apply.
See Also
58
The value of StringVar = " 5.200". (The '#' formatting characters determine the
size and number of decimal places contained in the string, i.e. a length of 10
including a decimal point and three decimal places.)
See Also
The value of IntVar is set to 50. If StringVar contains any characters other than
numeric characters, IntVar is set to 0.
See Also
The value of RealVar is set to 50.25. If StringVar contains any characters other
than numeric characters, RealVar is set to 0.
See Also
More than one string can be joined together (concatenated) using the Cicode
'plus' mathematical operator ( + ). For example:
STRING sMyStringVariable;
sMyStringVariable = "This is my text string." + "This is my second
text string.";
The two strings would be joined together and assigned to the string variable
sMyStringVariable. However, if subsequently displayed somehow, like in the
following MESSAGE example, the concatenated string would look wrong
because there is no space character positioned between the string sentences.
STRING sMyStringVariable;
sMyStringVariable = "This is my text string." + "This is my second
text string.";
MESSAGE("String Concatenation Example",sMyStringVariable,32);
To overcome this potential formatting problem, you could include an extra space
as the last character in the strings, or include the space as a third string in the
concatenation. For example:
sMyStringVariable = "This is my text string. " + "This is my
second text string. ";
or
sMyStringVariable = "This is my text string." + " " + "This is my
second text string. ";
59
60
Strings and string variables can also be concatenated as in the previous example.
Notice how the newline escape sequence ( ^n ) was assigned to the string
variable sNewLine, and how this value was concatenated between the other
strings and assigned to the string variable sMyStringVariable for display in the
MESSAGE function.
See Also
backspace
form feed
new line
horizontal tab
vertical tab
single quote
See Also
double quote
caret
carriage return
where hh is a hexadecimal number (for example, ^0x1A)
61
62
Example
Operator
Description
+
*
/
MOD
Addition
Subtraction
Multiplication
Division
Modulus (Remainder)
Note: Cicode uses the standard order of precedence, i.e. multiplication and
division are calculated before addition and subtraction. In the statement A=1+4/
2, 4 is divided by 2 before it is added to 1, and the result is 3. In the statement
A=(1+4)/2 , 1 is first added to 4 before the division, and the result is 2.5.
64
Description
Concatenate
For example:
Command
Comment
See Also
Description
BITAND
BITOR
BITXOR
AND
OR
Exclusive OR
For example
Command
Command
Command
Command
See Also
Description
=
<>
<
>
<=
Is equal to
Is not equal to
Is less than
Is greater than
Is less than or equal to
For example:
Command
Expression
Command
Expression
Command
Expression
See Also
Description
AND
OR
NOT
Logical AND
Logical OR
Logical NOT
Examples:
Command
Comment
Expression
Comment
Expression
Comment
Command
Comment
Command
Comment
Expression
Comment
See Also
65
66
See Also
When you use the IF THEN format, the statement(s) following are executed only
if the expression is TRUE, for example:
INT Counter;
IF PV12 = 10 THEN
Counter = Counter + 1;
END
In this example, the Counter increments only if the tag PV12 is equal to 10,
otherwise the value of Counter remains unchanged. You can include several
statements (including other IF statements), within an IF statement, for example:
68
In this example, the report runs when the Counter increments, i.e. when PV12 =
10, and the value of the counter exceeds 100.
You can use the IF THEN ELSE format for branching. Depending on the
outcome of the expression, one of two actions are performed, for example:
INT Counter;
IF PV12 = 10 THEN
Report("Shift");
ELSE
Counter = Counter + 1;
END
In this example, the report runs if PV12 is equal to 10 (TRUE), or the counter
increments if PV12 is anything but 10 (FALSE).
See Also
This function displays the single message "This is a String Array" on the screen
one word at a time pausing for 15 seconds between each word.
See Also
Note: Be careful when you use WHILE loops in your Cicode functions - WHILE
loops can cause excessive loading of the CPU, and therefore reduce system
performance. If you use a WHILE loop to loop forever, you should call the
Cicode function Sleep() so that CitectSCADA can schedule other tasks. The
Sleep() function increases the performance of your CitectSCADA system if you
use many WHILE loops.
See Also
Nested Loops
You can "nest" one loop inside the other. That is, a conditional statement can be
placed completely within (nested inside) a condition of another statement.
See Also
69
70
Where the TO keyword specifies an inclusive range of values. The smaller value
must be placed before TO.
- IS <relop> expression.
Use the IS keyword with relational operators (<relop>). Relational operators that
may be used are <, <=, =, <>, >, >= .
If the Expression matches any CaseExpression, the statements following that
CASE clause are executed up to the next CASE clause, or (for the last clause) up
to the END SELECT. If the Expression matches a CaseExpression in more than
one CASE clause, only the statements following the first match are executed.
The CASE ELSE clause is used to indicate the statements to be executed if no
match is found between the Expression and any of the CaseExpressions. When
there is no CASE ELSE statement and no CaseExpressions match the Expression,
execution continues at the next Cicode statement following END SELECT.
You can use multiple expressions or ranges in each CASE clause. For example,
the following line is valid:
CASE 1 To 4, 7 To 9, 11, 13, Is > MaxNumber
You can also specify ranges and multiple expressions. In the following example,
CASE matches strings that are exactly equal to "everything", strings that fall
between "nuts" and "soup" in alphabetical order, and the current value of
"TestItem":
CASE "everything","nuts" To "soup",TestItem
See Also
71
72
Handling Events
How CitectSCADA Executes
Multitasking
Foreground and background tasks
Controlling tasks
Pre-emptive multitasking
Handling Events
Cicode supports event handling. You can define a function that is called only
when a particular event occurs. Event handling reduces the overhead that is
required when event trapping is executed by using a loop. The following
example illustrates the use of the OnEvent() function:
INT
FUNCTION MouseCallback()
INT x, y;
DspGetMouse(x,y);
Prompt("Mouse at "+x:####+","+y:####);
RETURN 0;
END
OnEvent(0,MouseCallback);
The function MouseCallBack is called when the mouse is moved - you do not
need to poll the mouse to check if it has moved. CitectSCADA watches for an
event with the OnEvent() function.
Because these functions are called each time the event occurs, you should avoid
complex or time consuming statements within the function. If the function is
executing when another call is made, the function can be blocked, and some
valuable information may be lost. If you do wish to write complex event
handling functions, you should use the queue handling functions provided with
Cicode.
See Also
74
Multitasking
Multitasking is when you can run more than one task at the same time.
Windows supports this feature at the application level. For example you can run
MS-Word and MS-Excel at the same time.
CitectSCADA also supports multitasking internally; that is you can tell
CitectSCADA to do something, and before CitectSCADA has completed that
task you can tell CitectSCADA to start some other task. CitectSCADA will
perform both tasks at the same time. CitectSCADA automatically creates the
tasks, all you have to do is call the functions.
Controlling tasks
You can use the Task functions to control the execution of Cicode tasks, and use
the CitectSCADA Kernel at runtime to monitor the tasks that are executing.
Since CitectSCADA automatically creates new tasks (whenever you call a
keyboard command, etc.), schedules them, and destroys then when they are
finished, most users will not need to be concerned with them.
Sometimes it is desirable to manually 'spawn' a new task. For example, suppose
your Cicode is polling an I/O Device (an operation which must be continuous),
but a situation arises that require operator input. To display a form would
temporarily halt the polling. Instead you can spawn a new task to get the
operator input, while the original task continues polling the device.
Note: The TaskNew Cicode function is used to spawn new tasks.
See Also
75
76
Pre-emptive multitasking
Cicode supports pre-empted multitasking. If a Cicode task is running, and a
more important task is scheduled, CitectSCADA will suspend the original task,
complete the more important task and return to the original task.
Preemption is supported between Cicode threads and other internal process
performed by CitectSCADA. You can, therefore, write Cicode that runs forever
(e.g. a continuous while loop) without halting other Cicode threads or
CitectSCADA itself. For example:
INT FUNCTION MyLoopFunction()
WHILE TRUE DO
// Whatever is required in the continuous loop
Sleep(1); // Optional
END
END
In the above example, the function Sleep() is used to force preemption. The
Sleep() function is optional, however it will reduce the load on the CPU, because
the loop is suspended each second (it will not repeat at a high rate).
See Also
Bookmark and Breakpoint indicator bar - single click set and reset of
bookmarks and breakpoints.
Cicode Editor starts automatically when you double-click a Cicode file object in
Citect Explorer, or click the Cicode Editor button in Citect Explorer. See the topic
Starting the Cicode Editor.
Cicode files are stored as text files. For more information see the Introducing
Cicode and the section Using Cicode Files.
Note: Be careful not to confuse a Cicode file (*.ci) with an Include file (*.cii), as
you should not open an Include file in the Cicode Editor.
You could use any text editor to view or edit the Cicode files, however, the
Cicode Editor provides integrated views specific to Cicode. As well as the
features listed above, it includes:
Breakpoint window
Output window,
Stack window
78
Thread window
Files window
To minimize potential future problems with maintaining your Cicode files, you
should adopt a programming standard as early as possible, as discussed in the
section Using Cicode Programming Standards. Be sure to maintain structured
Cicode files, by logically grouping your Cicode functions within the files, and by
choosing helpful descriptive names.
Modular programming methods are discussed in the section Modular
Programming. Cicode functions are introduced in the section titled Using
Cicode Functions. Suggestions for debugging your Cicode is included in the
section titled Debugging Cicode.
Open the Cicode Files folder in the project list area of your project.
CitectSCADA allows you to use any text editor supported by Windows (for
example, ED for Windows, Windows Notepad, or Microsoft Word), instead of
the default Cicode Editor.
To change the default Cicode Editor:
1
Enter the editor application file name in the Cicode Editor field.
Note: The application name of the default Cicode Editor is ctcicode.exe
located in the Citect Bin folder. The application name for Notepad is
notepad.exe, located in the Microsoft Windows WINNT folder. The relative
path to the editor app must be included if the application is not stored in the
Citect Bin folder.
Click OK to save the changes and close the form, or Cancel to abort changes
without saving.
Creating functions
79
80
Saving files
Type in your new Cicode function in the blank space, or at the end of the file.
You should format the Cicode function correctly, following the documented
syntax.
If the file is new, you will be prompted by the Save as dialog. CitectSCADA
automatically suggests a name.
Click the Save button to save the file, or Cancel to abort the save.
Note: If you want to save your Cicode file under a new name, select Save as
instead of Save. The original file will remain in your project under the
original filename, until you delete it. All source files in your project directory
will be included when you compile your project.
Select a file from the list. You can use the dialog controls to open other
projects and directories.
Select the target file from the list. You can use the dialog controls to open
other projects and directories.
Click the Find Next button to begin searching, or Cancel to abort. The search
is performed down the file from the cursor. Hits are highlighted.
To compile Cicode:
1
Note: You cannot compile Cicode functions individually. When you compile
CitectSCADA, it automatically compiles the entire contents of the project.
81
82
From the Compile Errors in the File menu of the Project Editor, click the
Goto button. This launches the Cicode Editor and opens the appropriate
file at the correct line.
You can also choose View | Compile Errors, and then double-click the
compile error you want to view.
See Also:
Debugging Cicode
Choose Debug | Options, or press Ctrl + T and then select the appropriate
Window from the dialog.
Note: You can also choose View | Options, and then select the appropriate
Window from the dialog.
The Windows and Bars tab displays the current display state of the listed
Toolbars and Debug Windows within the Cicode Editor. A tick mark in the
checkbox next to the Window or Toolbar name enables the display of that
Window or Toolbar in the Cicode Editor. A grayed-out checkbox indicates that
the window is disabled (presently unable to be displayed). For example: Many
of the debug windows which display the active state of project Cicode variables
83
84
Breakpoint window
Output window
Stack window
Thread window
Files window
You can choose to view Editor windows or hide them to give you more room on
your screen.
To view/hide an Editor Window:
1
From the View menu, select the appropriate Window, or click the toggle
button you want in the View toolbar.
Breakpoint window
Displays the Breakpoint Window, which is used to list all breakpoints that are
currently set within the project. Double clicking an item in the list loads the file
File: the full name and location of the code file in which the breakpoint
exists.
Line: the line number (in the code file) where the breakpoint is located.
Output window
Displays the Output Window, which lists the output messages sent by
CitectSCADA during debugging. It states when threads start and terminate, and
if a break occurs. This window will show messages sent by the TraceMsg()
function.
The Output window shows entries in the order that they occur:
85
86
Note: You must be in debug mode to view global variable values in this window.
Stack window
Displays the Call Stack window, which lists the stack values of the current
thread. The stack consists of the functions called (including the arguments), any
variables used in the functions, and return values. This is especially useful
during debugging to trace the origin of the calling procedures.
A stack is a section of memory that is used to store temporary information. For
example, when you call a Cicode function, the variables used inside the function
exist only as long as the function runs.
To view the values of arguments and variables in a procedure, place a
breakpoint within the procedure under watch. When that breakpoint is reached,
the Stack Window will display the current call stack of the procedure containing
the breakpoint. The values of the stack are updated as the values change.
Name: The name of the Cicode thread. This is the name of the function
called to start the thread (from the TaskNew() function for example).
If you click on the Name of the Cicode thread, you will make the selected
thread the current focus of the Debugger. The Debugger will change the
display to show the source of the new thread.
Note: If the thread was not started from TaskNew(), the Name shown will be
Command.
State: The state of the Cicode thread. The states are defined as follows:
CPU_Time: The total amount of CPU time that the Cicode thread has
consumed. This tracks how much CPU time the thread has used over its
lifetime.
87
88
The 'All Projects' tab displays a tree hierarchy view of all projects and their
Cicode and CitectVBA files available within Citect Explorer.
The 'Open Project' tab displays a tree hierarchy view of the currently
selected project, and all included projects. The currently selected project will
always be the top entry.
The 'Open Files' tab lists the names of all files currently open for editing in
the Cicode Editor.
Note: Clicking any of the file names displayed in the tree will open that file in
the editor and give it the focus.
[Dynamic properties] Break on all hardware errors Stops a Cicode thread if a hardware
error occurs. A Cicode error will be generated and the thread will terminate
(without executing the rest of the function).
[Dynamic properties] Suspend all Cicode threads while stepping All Cicode threads
will be suspended while the debugger is stepping (or when the debugger
reaches a breakpoint, or the user performs a manual break). If you try to run any
Cicode thread at such a time (by pressing a button at runtime etc.), the
Command paused while in debug mode message will display in the runtime
prompt line.
This option allows better isolation of faults, when your Cicode thread interacts
with other threads. Foreground Cicode cannot be suspended and will continue
running when this option is set.
Warning! This option will prevent all new Cicode threads from running
(including keyboard and touch commands), and should be used with caution on
a running plant.
[Dynamic properties] Warning on break in foreground Cicode If a break point is 'hit' in a
foreground Cicode task, the Foreground Cicode cannot break (343) error
message is generated, and will be displayed on the Hardware Alarm page.
Disable this option to stop the alarm message from displaying.
[CitectSCADA startup options] CitectSCADA will start debugger on hardware errors
CitectSCADA will automatically start the debugger when a Cicode generated
hardware error occurs. The debugger will display the Cicode source file, and
mark the location of the error.
Warning! This option will interrupt normal runtime operation, and should only
be used during testing and commissioning of systems.
89
90
For Windows 95, select Start | Run, type WINIPCFG, and press Enter.
[Debugger options] Save breakpoints between sessions Save the location and states of
breakpoints between running sessions of the Cicode Editor and Debugger. This
means breakpoints inserted using the Cicode Editor can later be recalled when
an error occurs - even though the file (and application) has been closed.
[Compile options] Incremental compile Enables the incremental compilation of the
project.
See Also
Debugging Cicode
This dialog displays the currently selected programming language that the
editor will use to format the syntax of the file being edited in the code window. If
you open a Cicode file (with a .Ci extension), the current language formatter
changes to Cicode. If you open a CitectVBA file (with a .bas extension), the
current language formatter changes to CitectVBA.
Similarly, if you open a file with neither a Cicode nor a CitectVBA extension, say
a text file (with a .txt extension), the editor will not know which language type
you intend to use, and will not apply any formatting to the file. You can use this
dialog to select which programming language the file contains, and it will
format the file appropriately for display in the code window.
Note: The Cicode Editor can be used to edit any ASCII text based file, including
Microsoft JScript. The editor recognizes JScript files (with a .jav extension) and
will change the current language formatter to JScript. CitectSCADA does not
support JScript, and will not compile it into your project. However, the editor
can still be used separately to edit or create a JScript file or any other ASCII text
based file.
Current
Displays the currently selected programming language formatter for
appropriate syntax coloring of the file displayed in the code window.
Selection
Displays the range of possible programming languages that can be chosen as the
current language for formatting and display in the code window.
Debugging Cicode
To help you locate Cicode errors, you can switch the Cicode Editor to debug
mode to analyse running Cicode. You can toggle debugging on and off as
required, but CitectSCADA must be running for the debugger to work.
91
92
Note: If the current project is not running, CitectSCADA compiles and runs it
automatically. The bug in the bottom right-hand corner is green when
debugging.
Debugging functions
To debug a function:
1
Debugging functions
remotely
From the View menu, select any debug windows you want to use. If you are
unsure, you can use them all.
Initiate the thread by calling the function. You can do this directly from the
Cicode window in the Kernel, or by using a function, etc.
The function will break at the specified breakpoint. You can then use the
step tools to step through and trace your function.
Click the Toggle Debug button to stop debugging, or choose Debug | Stop
Debugging.
You can debug functions remotely if both computers are running identical
projects and the CitectSCADA Path is the same on both machines.
To remotely debug Cicode:
1
Click the Cicode Editor button on the computer that will be running CitectSCADA (the remote).
Click OK.
Click the Run button (you can close the Cicode Editor first), or choose File |
Run.
For Windows 95, select Start | Run, type WINIPCFG, and press Enter.
Click OK.
Using breakpoints
There are three ways for a processing thread to halt:
To debug a function, you must first be able to stop it at a particular point in the
code. You can place a breakpoint on any line in the source code functions.
Breakpoints may be inserted or removed while editing or debugging and do not
need to be saved with the file.
For a hardware error to halt a function, you must have either the Break on all
hardware errors or Break on hardware errors in active thread option set
(Debug menu - Options). When the break occurs, the default Cicode Editor will
be launched (if it is not open already), with the correct code file, function, and
break point line displayed. To launch the debugger in this case, you must have
the CitectSCADA will start debugger on hardware errors option set.
93
94
Inserting or removing
breakpoints
Position the cursor on the line where you want the breakpoint to be placed
or removed.
Click the Debug indicator bar. Alternatively, you can press F9 or choose
Debug | Insert/Remove Breakpoint.
The breakpoint appears as a large red dot at the beginning of the line.
Enabling/disabling
breakpoints
You can enable or disable breakpoints you have inserted into your Cicode.
To enable/disable a breakpoint:
1
Note: A disabled breakpoint appears as a large dark gray (disabled) dot at the
beginning of the line.
Advances the current Cicode thread by one statement. If the statement is a user
defined function, the debugger steps into it (the pointer jumps to the first line of the
source code).
Advances the current Cicode thread by one statement. If the statement is a user
defined function, the debugger steps over it (the function is not expanded).
Advances to the end of the current function and return. If there is no calling function,
the thread terminates.
Re-starts normal execution of the current Cicode thread. If there are no more breaks,
the thread terminates normally.
See Also
Formatting Expressions
Cicode Comments
Formatting Functions
Modular Programming
Defensive Programming
96
Note: Parts contained within square brackets are optional. For example, you do
not have to specify the variable scope (it defaults to local if you do not). Parts
contained within greater than ( < ) and less than ( > ) signs should be replaced
with the relevant text/value. For example, you would replace <initial value>
with an actual value. (You would not bracket your value with greater than and
less than signs.)
When declaring your variables, all parts of each should align vertically (the
scope part of each should be vertically aligned, the type part of each should be
aligned, etc.). Each part of the declaration is allotted a set amount of space. If one
part is missing, its space should be left blank. The missing part should not affect
the positioning of the next part:
ModuleintmiRecipeMax=100;
intiRecipeMax;
stringsRecipeDefault="Tasty";
See Also
iFile = 0;
STRINGsName= "";
INT
bSuccess= FALSE;
See Also
Prefix
Used for
i
h
b
r
s
boolean (TRUE/FALSE)
real type variables
string type variables
Local variable names should not be prefixed (when you declare a variable
without specifying the scope, it is considered a Local variable by default):
iTrendType, rPeriod, sFileName
See Also
97
98
For example:
INTciTrendTypePeriodic= 1;
INTciTrendTypeEvent= 2;
STRINGcsPageName= "Mimic";
Variable tags
Variable tags that have been defined in the database (with the Variable Tags
form) can be used in all functions in the Cicode files. Variable tags are
identifiable because they will not have a prefix (also, they are generally in
uppercase letters).
Labels
Labels, like variable tags, can be used in all functions in the Cicode files. They
can be either all upper case letters or mixed case. In order to differentiate them
from the variable tags and other Cicode variables they should have an _
(underscore) in front of them. For example:
_BILLING_EVENT, _UNIT_OFFLINE, _AfterHoursEvent
Warning! There are a few labels without an underscore defined in the Labels
form in the INCLUDE project. Although they do not follow the guidelines set in
this document their wide usage makes changing those labels difficult. These
labels are: TRUE, FALSE, BAD_HANDLE, XFreak, XOutsideCL, XAboveUCL,
XBelowLCL, XOutsideWL, XUpTrend, XDownTrend, XGradualUp,
XGradualDown, XErratic, XStratification, XMixture, ROutsideCL,
RAboveUCL, RBelowLCL
See Also
All but the first identifier in the WRONG case are hidden and are often
missed in a quick glance;.
See Also
Statements are placed on new lines, indented one tab stop from the level of
their surrounding block. DO NOT place more than one statement on a single
line because all but the first will be permanently lost. Although it may be
argued that some statements are logically related, this is not sufficient
justification. If they are logically related, place the statements on consecutive
lines and separate the statements by a blank line before and after. For
example:
hFile = -1; hForm = -1;// WRONG
hFile = -1;// RIGHT
hForm = -1;// RIGHT
IF statements can be used in one of the formats below. When indenting the
IF statements, a tab stop should be used. For example:
Simple IF block
IF <expression> THEN
.
.
END
99
100
IF-THEN-ELSE block
IF <expression> THEN
.
.
ELSE
.
.
END
Staggered
IF <expression> THEN
.
.
ELSE
IF <expression> THEN
.
.
ELSE
IF <expression> THEN
.
.
ELSE
.
.
END
END
END
See Also
For WHILE and FOR statements refer to the on line help or Cicode
Reference manual.
Formatting Expressions
The following conventions should be observed when formatting Cicode
functions:
When a sub-expression is enclosed in brackets, the first symbol of the subexpression should be placed hard against the opening bracket. The closing
bracket should be placed immediately after the last character for the subexpression. For example:
a = b * ( c - d );// WRONG
a = b * (c - d);// RIGHT
The round brackets which surround the arguments of a function all attract
no spaces, for example:
DisplayText( "hello" );// WRONG
DisplayText("hello");// RIGHT
See Also
Cicode Comments
Comments are designed to to aid understanding and maintenance of code. You
should place comments in the notes of the function header so as not to clutter up
the code. Small one line comments are acceptable to explain some small part of
the code which may become lost in the normal header comment.
See Also
Formatting Functions
Cicode functions have up to seven parts: Scope, Type, Keyword, Name,
Argument(s), Statement(s), Keyword.
[Scope]
The scope of the function. If you do not specify a scope, the function will be
Public by default. That is, it will be available to all Cicode files, pages, and
CitectSCADA databases (e.g. Alarm.dbf). To make a function Private (i.e. only
available within the file in which it is declared), you must prefix it with the word
PRIVATE.
[Type]
The return type of the function. This should be on a separate line.
Keyword
The keyword FUNCTION. This should be on a separate line.
101
102
Writing Functions
Using Cicode Functions
Using Cicode Programming Standards
For example:
PlotInit();
TrendClientOpen();
TrendClientInfoRead();
See Also
Naming Functions
Source file headers
Source files (the files that contain your Cicode) should have a header to provide
a basic overview of the file. This header should be formatted as follows:
//**FILE:<name of file.CI>
//**
//**DESCRIPTION:<description of basically what is in the file>
//**
//**FUNCTIONS:PUBLIC
//**<list of the PUBLIC functions contained
//**in this file>
//**
//**PRIVATE
//**<list of the PRIVATE functions contained
//**in this file>
//**
//*************** MODULE CONSTANTS***********************
<module constants>//<comments (optional)>
//**************** MODULE VARIABLES ***********************
<module variables>//<comments (optional)>
//*********************************************************
Note: Declare all module variables at the MODULE VARIABLES section at the
beginning of the file and initialize the module variables.
For example:
103
104
Function headers
Functions should have a descriptive header, formatted as follows:
//**FUNCTION :<name of function>
//**
//**DESCRIPTION :<suggests the operation, application source and
//**multi-tasking issues>
//**REVISIONDATEBYCOMMENTS
//**<revision number><date><author><comments about the change>
//**
//**ARGUMENTS:<argument description>
//**
//**RETURNED VALUE:< description of possible return values>
//**
//**NOTES:
END
Modular Programming
The best way to solve a problem is to partition the problem into smaller, more
manageable problems and to solve these smaller problems. A similar approach
should be taken when using a programming language like Cicode to complete a
task. Reducing the task to smaller tasks (or functions) has the following
advantages:
Reduced Complexity - Once the function is created and tested, the detailed
operation about how it works can be forgotten. Users need only be
concerned with calling the function as they can be assured the tested
function will yield predictable results.
105
106
Modular programming has a few rules that define how functions should be
structured - Cohesion - and how they are related to other functions - Coupling.
See Also
Defensive Programming
Using Cicode Programming Standards
Cohesion
A goal of modular programming is to create simple functions that perform a
single task, but perform that task well. This can be described as how cohesive a
function is.
Two factors that affect the level of cohesion are:
Similarity
Cohesion level
Example
1
More than 1
More than 1
Many
n/a
Similar
Dissimilar
Radically different
high
Moderate
Low
None
Sin(x)
SinAndTan(x).
SinAndLength(x)
SinAndDateAndTimeAndSQLNext(x)
For example, the function Sin(x) will perform one task - return the trigonometric
Sine value of x. This is an example of a highly cohesive function. The function
SinAndTan(x) performs two tasks - calculate the trigonometric Sine and Tan of
107
108
Shared common data. This is often referred to as global variable data. This is
an invisible form of tight coupling that, particularly in pre-emptive, multitasking environments, can be a hazardous exercise. When functions write to
the global variable data there is no guarantee as to who is writing to the
variable. Hence the value can be indeterminate. Global variables are
acceptable when they are used for read-only purposes, otherwise their use is
discouraged. Similarly, module variable data in CitectSCADA version 5.XX
should be treated the same way. The use of local function variables is
encouraged to decrease function coupling.
Defensive Programming
See Also
Never write the same code twice. If you find that two sections of code look
identical or almost identical it is worth spending the time to re-write or redesign it. This will generally cut the size of the code in question by a third or
more, which reduces complexity and therefore maintenance and debugging
time. The most effective method to achieve this is to convert the identical
code to a new function.
Do not access the module data in any function other than the member
functions.
Write the member functions whenever an array is defined. Do not try to pass
arrays between functions, make the arrays the centre piece of the object.
Handles
Random values
If an error occurs in one of these functions, your Cicode task will generate a
hardware error and be halted. You may stop your Cicode task from being halted
by using the ErrSet() function and checking for errors using IsError().
The parameter [Code]HaltOnError allows you to stop any errors in these
functions from halting your Cicode. If you set. . .
[code]
HaltOnError=0
then your Cicode will continue to run after a hardware error in these functions.
For example:
INT
FUNCTION
ExampleInit()
INTnError = 0;
nError = ExampleOpen("MyForm");
IF nError = 0 THEN
.
.
.
END
END
INT
109
110
Example of handles
INT
FUNCTION
ExampleInit()
INThFile= BAD_HANDLE;
hFile = ExampleFileOpen("MyFile.txt");
IF hFile <> BAD_HANDLE THEN
END
END
FUNCTION
ExampleFileOpen(STRING sName)
INThFile = BAD_HANDLE;
hFile = FileOpen(sName, "r+");
IF hFile = BAD_HANDLE THEN
hFile = FileOpen(sName, "r");
END
RETURN hFile;
END
INT
FUNCTION
ExampleInit()
INTnSamples= 0;
ErrSet(1);
nSamples = ExampleSamples();
IF IsError() = 0 THEN
END
ErrSet(0);
END
ErrTrap(nError);
RETURN nSamples;
END
See Also
Debugging Cicode
For example:
INT
FUNCTION
FilePrint(STRING sDeviceName, STRING sFileName)
INThFile;
INThDev;
STRINGStr1;
hDev = DevOpen(sDeviceName, 0);
IF (hDev = -1) THEN
DebugMsg("Invalid arg to FilePrint - 'DeviceName'");
RETURN 261;/* File does not exist */
END
hFile = FileOpen(sFileName, "r");
IF (hFile = -1) THEN
DebugMsg("Invalid arg to FilePrint - 'FileName'");
DevClose(hDev);
RETURN 261;/* File does not exist */
END
111
112
Assert function
Assert reports an error if the test passed by the argument fails. The
implementation of this function can be found in DEBUG.CI in the INCLUDE
project.
For example:
INT
FUNCTION
FileDisplayEx(STRING sFileName)
INThFile;
hFile = FileOpen(sFileName, "r");
ASSERT(hFile <> -1);
.
.
FileClose(hFile);
RETURN 0;
END
See Also
Debugging Cicode
Part II
Function Categories
ActiveX Functions
ActiveX functions enable you to create and interact with ActiveX objects, using
CitectSCADA as an ActiveX container.
_ObjectCallMethod
_ObjectGetProperty
_ObjectSetProperty
AnByName
CreateControlObject
CreateObject
ObjectAssociateEvents
ObjectAssociatePropertyWith
Tag
ObjectByName
ObjectHasInterface
ObjectIsValid
116
See Also
Alarm Functions
Alarm functions display alarms and their related alarm help pages, and
acknowledge, disable, and enable alarms. They provide information about
alarms and allow your operators to add comments to alarm records. You can
also access alarms at the record level (on the alarms server) for more complex
operations.
AlarmAck
AlarmAckRec
AlarmActive
AlarmClear
AlarmClearRec
AlarmComment
AlarmDelete
AlarmDisable
AlarmDisableRec
AlarmDsp
AlarmDspLast
AlarmDspNext
AlarmDspPrev
AlarmEnable
AlarmEnableRec
AlarmEventQue
AlarmFirstCatRec
AlarmFirstPriRec
AlarmFirstTagRec
AlarmGetDelay
AlarmGetDelayRec
AlarmGetDelayRec
AlarmGetFieldRec
AlarmGetInfo
AlarmGetOrderbyKey
AlarmGetThreshold
AlarmGetThresholdRec
AlarmHelp
AlarmNextCatRec
AlarmNextPriRec
AlarmNextTagRec
Acknowledges alarms.
Acknowledges alarms by record number.
Determines if any alarms are active in the user's area.
Clears acknowledged, inactive alarms from the active alarm list.
Clear an alarm by its record number.
Allows users to add comments to alarm summary entries.
Deletes alarm summary entries.
Disables alarms.
Disables alarms by record number.
Displays alarms.
Displays the most recent, unacknowledged alarms.
Displays the next page of alarms.
Displays the previous page of alarms.
Enables alarms.
Enables alarms by record number.
Opens the alarm event queue.
Searches for the first occurrence of an alarm category and type.
Searches for the first occurrence of an alarm priority and type.
Searches for the first occurrence of an alarm tag, name, and description.
Gets the delay setting for an alarm.
Gets the delay setting for an alarm via the alarm record number
Gets field information from an alarm entry displayed at an AN.
Gets alarm field data from the alarm record number.
Gets information about an alarm list displayed at an AN.
Retrieves the list of key(s) used to determine the order of the alarm list.
Gets the thresholds of analog alarms.
Gets the thresholds of analog alarms by the alarm record number.
Displays the help page for the alarm where the cursor is positioned.
Searches for the next occurrence of an alarm category and type.
Searches for the next occurrence of an alarm priority and type.
Searches for the next occurrence of an alarm tag, name, and description.
See Also
Clipboard Functions
With the Clipboard functions, you can copy data to, and paste data from, the
Windows Clipboard.
ClipCopy
ClipPaste
ClipReadLn
ClipSetMode
ClipWriteLn
See Also
Cluster Functions
ClusterGetName
ClusterSetName
See Also
117
118
Color Functions
Allow manipulation of colors (e.g. to convert CitectSCADA colors to the format
required by ActiveX objects).
CitectColourToPackedRGB
GetBlueValue
GetGreenValue
GetRedValue
MakeCitectColour
PackedRGB
PackedRGBToCitectColour
See Also
Converts a CitectSCADA colour into a packed RGB colour value that can be
used by an ActiveX object.
Returns the Blue component of a packed RGB colour.
Returns the Green component of a packed RGB colour.
Returns the Red component of a packed RGB colour.
Creates a colour from red, green and blue component parts.
Returns a packed RGB colour based on specified red, green, and blue
values.
Converts a packed RGB colour into the nearest equivalent CitectSCADA
colour.
Communication Functions
The communication functions give you direct access to the communication ports
on your computer(s). You can use these functions to communicate with external
equipment, such as low speed devices (e.g. bar code readers), serial keyboards,
and dumb terminals. You should not use these functions to communicate with
high speed PLCs, because the performance may not be adequate.
Note: The Communication functions can only be called from an I/O server.
ComClose
ComOpen
ComRead
ComReset
ComWrite
SerialKey
See Also
DDE Functions
The Cicode DDE (Dynamic Data Exchange) functions permit you to exchange
data between CitectSCADA and other Windows applications running on the
same computer in real time, continuously, and with no operator intervention.
For example, you can send your run-time data to a DDE compliant spreadsheet
or word processing application, either by posting the data to memory for DDE
access by other applications, or by writing the data directly into another
application. Conversely, you could read data from a DDE compliant application
like a spreadsheet or document directly into a CitectSCADA variable.
See Also
Device Functions
The device functions provide access to devices. They allow access to SQL,
dBASE, and ASCII files through database-like operations, and provide more
control over output to printers.
With these functions you can open and close any device, and read from and
write to any record or field in the device. You can store recipes or any other data
in a database, and then down-load or up-load the data as required to an I/O
119
120
See Also
Display Functions
Display functions control the display and processing of graphics pages and
objects. You can use these functions to display graphics pages, print them on
your printer, send them to a file, or copy them to the Windows Clipboard. You
can also display text files on screen.
DspAnFree
DspAnGetArea
DspAnGetPDos
DspAnGetPrivilege
DspAnInfo
DspAnInRgn
DspAnMove
DspAnMoveRel
DspAnNew
DspAnNewRel
DspBar
DspBmp
DspButton
DspButtonFn
DspChart
DspCol
DspDel
DspDelayRenderBegin
DspDelayRenderEnd
DspDirty
DspError
DspFile
DspFileGetInfo
DspFileGetName
DspFileScroll
DspFileSetName
DspFont
DspFontHnd
DspFullScreen
DspGetAnBottom
DspGetAnCur
DspGetAnExtent
Creates a new instance of an ActiveX object. If the object already exists for
the given Animation Point Number, then that object will be used (a new
object is not created).
Frees (removes) an AN from the current page.
Gets the area configured for an object at a specific AN (animation-point
number).
Gets the x and y coordinates of an AN (animation-point number).
Gets the privileges configured for an object at a specific AN (animation-point
number).
Gets information on the state of the animation at an AN.
Checks if an AN is within a specified region.
Moves an AN.
Moves an AN relative to its current position.
Creates an AN.
Creates an AN relative to another AN.
Displays a bar graph at an AN.
Displays a bitmap at a specified AN.
Displays a button at an AN and puts a key into the key command line (when
the button is selected).
Displays a button at an AN and calls a function when the button is selected.
Displays a chart at an AN.
Displays a colour at an AN.
Deletes all objects at an AN.
Delays screen updating until DspDelayRenderEnd() is called.
Ends the screen update delay set by DspDelayRenderBegin().
Forces an update to an AN.
Displays an error message at the prompt AN.
Defines the screen attributes for displaying a text file.
Gets the attributes of a file to screen display.
Gets the name of the file being displayed in the display "window".
Scrolls a file (displayed in the display "window") by a number of characters.
Sets the name of the file to display in the display "window".
Creates a font.
Gets a font handle.
Enables or disables the full screen mode of the active window.
Gets the bottom extent of the object at the specified AN.
Gets the current AN.
Gets the extent of the object at a specified AN.
121
122
See Also
DLL Functions
The DLL (Dynamic Link Library) functions allow you to call any DLL, including
the Windows standard functions, any third-party library, or your own library.
With the DLL functions, you can write functions in 'C', Pascal, or any other
language that supports DLLs, and then call those functions from CitectSCADA.
DLLCall
DLLClose
DLLOpen
See Also
Error Functions
The error functions trap and process errors. You can use these functions to check
the status of any other function.
ErrCom
ErrDrv
ErrGetHw
ErrHelp
ErrInfo
ErrLog
ErrMsg
ErrSet
ErrSetHw
ErrSetLevel
ErrTrap
123
124
See Also
Event Functions
The event functions trap and process asynchronous events.
CallEvent
ChainEvent
GetEvent
OnEvent
SetEvent
See Also
File Functions
The file functions provide access to standard ASCII files. You can open or create
files and then read and write data in free format. Use these functions when you
require more complex file operations than are possible with the device
functions; e.g., importing and exporting data to and from other programs (that
support ASCII files).
You can build complex I/O functionality by combining these functions with the
format functions.
FileClose
FileCopy
FileDelete
FileEOF
FileExist
FileFind
FileGetTime
FileMakePath
FileOpen
FilePrint
FileRead
FileReadBlock
FileReadLn
FileRename
FileRichTextPrint
FileSeek
FileSetTime
FileSize
FileSplitPath
Closes a file.
Copies a file or group of files.
Deletes a file.
Checks for the end of a file.
Checks if a file exists.
Finds a file that matches a specified search criteria.
Gets the time on a file.
Creates a file path string from individual components.
Opens or creates an ASCII file.
Prints a file on a device.
Reads characters from a file.
Reads a block of characters from a file.
Reads a line from a file.
Renames a file.
Prints a rich text file.
Seeks a position in a file.
Sets the time on a file.
Gets the size of a file.
Splits a file path into individual string components.
See Also
Form Functions
Form functions create and display data entry forms. Use them to display large
amounts of data or request data from the operator; for example, to display, load,
and/or edit a database of recipes.
FormActive
FormAddList
FormButton
FormCheckBox
FormComboBox
FormCurr
FormDestroy
FormEdit
FormField
FormGetCurrInst
FormGetData
FormGetInst
FormGetText
FormGoto
FormGroupBox
FormInput
FormListAddText
FormListBox
FormListDeleteText
FormListSelectText
FormNew
FormNumPad
FormOpenFile
FormPassword
FormPosition
FormPrompt
FormRadioButton
FormRead
FormSaveAsFile
FormSelectPrinter
FormSetData
125
126
See Also
Format Functions
Format functions convert data into formatted strings. You can convert many
different items of data into single, formatted strings that can then be displayed,
printed, or written to a file. The format functions also convert (formatted) data
back into individual elements; e.g., strings that are read from files or other
devices.
FmtClose
FmtFieldHnd
FmtGetField
FmtGetFieldHnd
FmtOpen
FmtSetField
FmtSetFieldHnd
FmtToStr
See Also
FTP Functions
FTP functions are used to manage your FTP communications and files (used
when running your project over the Internet). These functions can only be used
on the Internet Display Client.
FTPClose
FTPFileCopy
FTPFileFind
FTPOpen
See Also
FuzzyTech Functions
The CitectSCADA FuzzyTech functions support fuzzy logic control and provide
an interface to the FuzzyTech functions provided by INFORM Software
Corporation. To use these functions you must purchase the development
environment from INFORM - the makers of FuzzyTech.
FuzzyClose
FuzzyGetCodeValue
See Also
Group Functions
Group functions manipulate groups of areas, alarm categories, and any other
data that can be accessed as a group. Use these functions to create a group
dynamically to use for various purposes; for example, to allow operators to
change their areas, or to view alarms by category, and so on.
GrpClose
GrpDelete
GrpFirst
GrpIn
GrpInsert
GrpMath
GrpName
GrpNext
GrpOpen
GrpToStr
See Also
Closes a group.
Deletes items from a group.
Gets the first item in a group.
Tests if an item is in a group.
Inserts items into a group.
Performs mathematical operations on groups.
Gets the name of a group from a group handle.
Gets the next item in a group.
Opens a group.
Converts a group into a string
127
128
See Also
Keyboard Functions
Keyboard functions control the processing of keyboard entries, including the
movement of the keyboard cursor and manipulation of keyboard commands.
KeyAllowCursor
KeyBs
KeyDown
KeyGet
KeyGetCursor
KeyLeft
KeyMove
KeyPeek
KeyPut
KeyPutStr
KeyReplay
KeyReplayAll
KeyRight
KeySetCursor
KeySetSeq
KeyUp
SendKeys
See Also
Allows the command cursor to move to any AN or only to ANs that have
commands defined.
Deletes the last character from the key command line.
Moves the command cursor down.
Gets the raw key code from the key command line.
Gets the AN where the cursor is positioned.
Moves the command cursor left.
Moves the command cursor in the required direction.
Gets a key from the key command line without removing the key.
Puts a raw key code into the key command line.
Puts a string into the key command line.
Replays the last key sequence.
Replays and executes the last key sequence.
Moves the command cursor right.
Moves the command cursor to a specified AN.
Adds a keyboard sequence at runtime.
Moves the command cursor up.
Sends a keystroke (or string of keystrokes) to a window.
Mail Functions
The mail facility enables you to send data (e.g. a report) between CitectSCADA
users (or any other computer). CitectSCADA can send mail automatically,
triggered by an event such as a report or an alarm. It can also read mail, so any
user on the system can send mail to CitectSCADA (for example, a batch recipe).
You can use the mail facility to send information from CitectSCADA to
Managers, Supervisors or anyone on a LAN or WAN whether they are running
CitectSCADA or not. You can use it to send mail directly to these people
whenever an event occurs (for example, you can mail reports directly to the QA
department when they are scheduled, or send mail to the maintenance
department when equipment is due for service).
The mail system uses the MAPI standard interface, so you can use any mail
system that supports this standard. The mail system allows data transfer across
See Also
Math/Trigonometry Functions
The following functions allow you to perform mathematical calculations in your
Cicode files:
Abs
ArcCos
ArcSin
ArcTan
Cos
DegToRad
Exp
Fact
HighByte
HighWord
Ln
Log
LowByte
LowWord
Max
Min
Pi
Pow
RadToDeg
Rand
Round
Sign
Sin
Sqrt
Tan
See Also
129
130
Miscellaneous Functions
The following are miscellaneous functions.
AccControl
AreaCheck
Assert
Beep
CitectInfo
CodeTrace
DebugBreak
DebugMsg
DebugMsgSet
DelayShutdown
DumpKernel
EngToGeneric
Exec
GetArea
GetEnv
InfoForm
InfoFormAn
Input
IntToReal
KerCmd
LanguageFileTranslate
Message
ParameterGet
ParameterPut
ProjectRestartGet
ProjectRestartSet
ProjectSet
Prompt
Pulse
ServerInfo
SetArea
SetLanguage
Shutdown
ShutdownForm
ShutdownMode
SwitchConfig
TestRandomWave
See Also
Page Functions
Page functions display graphics pages, files, and the standard alarm, trend, and
menu pages.
PageAlarm
PageDisabled
PageDisplay
PageFile
PageFileInfo
PageGetInt
PageGetStr
PageGoto
PageHardware
PageInfo
PageLast
PageMenu
PageNext
PagePeekLast
PagePopLast
PagePopUp
PagePrev
PagePushLast
PageRichTextFile
PageSelect
PageSetInt
PageSetStr
PageSummary
PageTrend
See Also
131
132
Plot Functions
With the plot functions, you can plot system data on the screen or on your
system printer(s).
PlotClose
PlotDraw
PlotFile
PlotGetMarker
PlotGrid
PlotInfo
PlotLine
PlotMarker
PlotOpen
PlotScaleMarker
PlotSetMarker
PlotText
PlotXYLine
See Also
Report Functions
With the report functions, you can run reports on the report server, change their
scheduling, or get their status.
RepGetControl
Report
RepSetControl
See Also
Security Functions
The security functions allow you to control logins, logouts, and general security,
and to add, delete, and modify user records during run time. By giving selected
users access to these functions, you can provide them with supervisory control
of the system.
FullName
GetPriv
Login
LoginForm
Logout
LogoutIdle
See Also
SPC Functions
SPC (Statistical Process Control) functions allow you to alter the properties and
parameters that affect the SPC calculations. By using the SPC functions you can
also gain direct access to the SPC data and alarms.
SPCAlarms
SPCClientInfo
SPCGetHistogramTable
SPCGetSubgroupTable
SPCPlot
SPCProcessXRSGet
SPCProcessXRSSet
SPCSetLimit
SPCSpecLimitGet
SPCSpecLimitSet
SPCSubgroupSizeGet
SPCSubgroupSizeSet
See Also
SQL Functions
SQL functions allow you to define, manipulate, and control data in SQL
databases and other relational databases. By using the SQL functions (or the
133
134
See Also
Loads and executes a DTS package which initiates data transfer between
OLE DB data sources.
Appends a text string to the SQL buffer.
Starts a database transaction.
Commits a transaction to the database.
Makes a connection to a database system for execution of SQL statements.
Closes a database connection.
Terminates an SQL query.
Returns an error message from the SQL system.
Executes an SQL query on a database.
Gets information about the fields or columns selected in an SQL query.
Gets field or column data from a database record.
Gets information about a database connection.
Gets the next database record from a SQL query.
Gets the number of fields or columns that were returned by the last SQL
statement.
Gets the number of records that were modified in the last insert, update, or
delete SQL statement.
Rolls back (or cancels) the last database transaction.
Sets a statement string in the SQL buffer.
Turns off the debug trace.
Turns on the debug trace.
String Functions
String functions allow you to manipulate strings in various ways. You can
extract characters or substrings from a string, convert strings into other data
types, format strings, search for strings, and perform other operations.
CharToStr
HexToStr
IntToStr
PathToStr
RealToStr
StrClean
StrFill
StrFormat
StrGetChar
StrLeft
See Also
AssChainWinFree
AssInfo
135
136
AssTag
AssTitle
AssVarTags
AssWin
See Also
Associates up to eight variable tags with a Super Genie and displays the
Super Genie in the current window.
Associates up to eight variable tags with a Super Genie and displays the
Super Genie in a popup window.
Gets scale information about the associations of the current Super Genie
(i.e. scale information about a variable tag that has been substituted into the
Super Genie).
Associates a variable tag with the current Super Genie. The association will
be created for the current Super Genie only, and will only come into effect
after you re-display the Super Genie.
Sets the runtime window title to the tag name of the first variable substituted
into the Super Genie.
Associates up to eight variable tags with a Super Genie. This association is
only made for the next Super Genie you display (either in the current window
or in a new window). You can use this function repeatedly to associate more
than 8 variable tags to a Super Genie.
Associates up to eight variable tags with a Super Genie, and displays the
Super Genie in a new window.
See Also
Task Functions
Task functions support advanced multi-tasking operations in Cicode, handling
queues, semaphores, messages, and other process functions. The task functions
control the transfer of data between different Cicode tasks and across the
network to different computers (by remote procedure calls).
CodeSetMode
EnterCriticalSection
Halt
See Also
Time/Date Functions
Time/date functions manipulate time and date variables. CitectSCADA stores
time/date-related variables as a single integer. This integer represents the
number of seconds since 01/01/1970. It is in GMT, but it has an offset that
updates it to local time (determined by the timezone the application is in). The
Time/date functions convert this integer into time and date variables.
137
138
See Also
Trend Functions
You can control a trend's operation by using the trend functions. CitectSCADA
has standard trend pages, so you would not normally use these low-level
functions unless you want to define your own trend displays. You can control
the movement of the trend cursor, trend scaling, and the definition of trend
attributes (such as the trend starting time and sampling period). You can also
create, and subsequently delete trends.
TrnAddHistory
TrnClientInfo
TrnComparePlot
TrnDelete
TrnDelHistory
TrnEcho
TrnEventGetTable
TrnGetPen
TrnGetPenFocus
TrnGetPenNo
TrnGetPeriod
TrnGetScale
TrnGetScaleStr
TrnGetSpan
TrnGetTable
TrnGetTime
TrnGetUnits
TrnInfo
Stores event trend data and time data (including milliseconds) for a specified
trend tag.
Sets trend data from a table, for a specified trend tag.
Sets event trend data and time data (including milliseconds) for a specified
trend tag.
Exports trend data to the clipboard.
Exports trend data to a file in CSV (comma separated values) format.
Exports trend data to a file in dBASE III format.
Exports trend data to applications via DDE.
Flushes the trend to disk.
Gets the event number of a trend at an offset for a pen.
Gets the trend time at an offset for a pen.
Gets the trend value at an offset for a pen.
Gets the event number of a trend at the trend cursor.
Gets the time (in milliseconds from the previous midnight) at a trend cursor
for a specified pen.
Gets the position of the trend cursor.
Gets the time/date at the trend cursor.
Gets the current trend cursor value of a pen.
Gets the current trend cursor value of a pen as a formatted string.
Gets the default engineering zero and full scales of a trend tag.
Gets the display mode of a trend.
Gets the event number of a trend at a percentage along the trend.
Gets the format of a pen.
Returns the internally stored value for <GATED>.
Returns the internally stored value for <TRN_NO_VALUES>.
Gets the display mode of trends (historical or real-time).
Gets the time (in milliseconds from the previous midnight) of the trend
(plotted by a specified pen) at a percentage along the trend, using the time
and date of the right-most sample displayed.
Gets the trend tag of a pen.
Gets the number of the pen currently in focus.
Gets the pen number of a pen name.
Gets the display period of a trend.
Gets the scale of a pen.
Gets the scale of a pen as a formatted string.
Gets the span time of a trend.
Stores trend data in an array.
Gets the time/date of a pen.
Gets the data units of a trend pen.
Gets the configured values of a trend tag.
139
140
The following trend functions are used on all standard trend templates. Use
these functions only if you create your own trend templates. (These functions are
written in Cicode and can be found in the include project.)
TrendDspCursorScale
TrendDspCursorTag
TrendDspCursorTime
TrendDspCursorValue
TrendGetAn
TrendPopUp
TrendRun
TrendSetDate
TrendSetScale
TrendSetSpan
TrendSetTime
TrendSetTimebase
TrendWin
TrendZoom
See Also
Window Functions
Window functions control the display of windows. You can open, move, size,
activate, and de-activate windows. You can also specify titles for your windows.
WinCopy
WinFile
WinFree
WinGetFocus
WinGetWndHnd
WinGoto
WinMode
WinMove
WinNew
WinNewAt
WinNext
WinNumber
WinPos
WinPrev
WinPrint
WinPrintFile
WinSelect
WinSize
WinTitle
WndFind
WndGetFileProfile
WndGetProfile
WndHelp
WndInfo
WndPutFileProfile
WndPutProfile
WndShow
WndViewer
See Also
141
142
Part III
Functions Reference
Calls a specific method for an ActiveX object. (See the documentation for your
ActiveX object for details on methods and properties.)
Note: The parameter list passed to the control can only have Cicode variables or
variable tags; it cannot use values returned directly from a function because an
ActiveX control may modify parameters passed to it.
For example:
//Calculate a value and pass to ActiveX control
_ObjectCallMethod(hControl, "DoSomething" CalcValue());
is not allowed because the return value of a function cannot be modified. The
following should be used instead:
INT nMyValue;
//Calculate Value
nMyValue = CalcValue();
//Pass Value to ActiveX control
_ObjectCallMethod(hControl, "DoSomething" nMyValue);
Syntax
Return Value
Related Functions
Example
See Also
The return value from the method - if successful, otherwise an error is returned.
ObjectByName, DspAnCreateControlObject, CreateObject,
CreateControlObject
See CreateControlObject.
ActiveX Functions
146
_ObjectGetProperty
Description
Syntax
Return Value
Related Functions
Example
See Also
_ObjectSetProperty
Description
Syntax
Return Value
Related Functions
Example
See Also
Abs
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
AccControl
Description
Syntax
Controls accumulators, e.g. motor run hours. You can reset the values of Run
Time, Totalizer Inc, and No. of Starts (defined in the Accumulator database), reread these values from the I/O device, or flush pending writes of these values to
the I/O device.
AccControl(sName, nMode)
sName: . . . . . . . . . . The name of the accumulator or a mask for the names of
accumulators. You can use the following wildcards:
147
148
Miscellaneous Functions
AlarmAck
Description
Acknowledges alarms. You can acknowledge the alarm where the cursor is
positioned, one or more alarm lists on the active page, a whole category of
alarms, or alarms of a particular priority.
You would normally call this function from a keyboard command. No action is
taken if the specified alarms have already been acknowledged.
Syntax
Example
System Keyboard
Key Sequence
Command
Comment
LeftButton
AlarmAck(0, 0)
Acknowledge the alarm where the cursor is positioned
System Keyboard
Key Sequence
Command
Comment
ShiftLeftButton
AlarmAck(1, -1)
Acknowledge a page of alarms
System Keyboard
Key Sequence
Command
Comment
System Keyboard
Key Sequence
Command
Comment
See Also
Alarm Functions
149
150
AlarmAckRec
Description
Syntax
To store this value, use data type Int in Cicode or Long for
variable tags (Long needs 4 bytes).
Return Value
Related Functions
Example
Alarm Functions
AlarmActive
Description
Syntax
Determines if any alarms are active in the user's area. Call this function from the
Page Strings database, to display an alarm message at a specified AN on a
graphics page. You can specify the type of alarms, for example, active hardware
alarms or disabled non-hardware alarms.
AlarmActive(Type)
Type: . . . . . . . . . . . . The type of alarms to check:
Non-hardware alarms
0 - Active alarms
1 - Unacknowledged alarms, ON and OFF
3 - Disabled alarms
Hardware alarms
5 - Active alarms
6 - Unacknowledged alarms, ON and OFF
Return Value
The number of active alarms for Hardware alarms (modes 5 and 6).
Example
Strings
AN
Expression
True Text
True Text
Comment
See Also
Alarm Functions
9
AlarmActive(5)
"Hardware Alarms Active"
"No Active Hardware Alarms"
Display the alarm status at AN 9
151
152
AlarmClear
Description
Clears an acknowledged (and off) alarm from the active alarm list. You can clear
the alarm where the cursor is positioned, one or more alarm lists on the active
page, a whole category of alarms, or alarms of a particular priority.
If you set the [Alarm]AckHold parameter to 1, alarms that go off and have been
acknowledged are not removed from the active list until this function is called.
Syntax
AlarmClear(Mode, Value)
Mode: . . . . . . . . . . . The type of clear:
0 - Clear a single alarm where the cursor is positioned:
Clear
AlarmClear(0, 0)
Clear the alarm where the cursor is positioned
System Keyboard
Key Sequence
Command
Comment
ClearAll
AlarmClear(1, -1)
Clear a page of alarms
System Keyboard
Key Sequence
Command
Comment
System Keyboard
Key Sequence
Command
Comment
CtrlClear
AlarmClear(2, 0)
Clear all categories of inactive alarms
System Keyboard
Key Sequence
Command
Comment
See Also
Alarm Functions
AlarmClearRec
Description
Syntax
Clears an alarm by its record number on both the Primary and Standby Alarms
Servers. You can call this function only on an Alarms Server. However, a client
can call this function remotely by using the MsgRPC() function.
AlarmClearRec(Record)
Record: . . . . . . . . . . The alarm record number, returned from any of the
following alarm functions:
153
154
To store this value, use data type Int in Cicode or Long for
variable tags (Long needs 4 bytes).
Return Value
Related Functions
See Also
AlarmComment
Description
Syntax
AlarmComment(sComment)
sComment: . . . . . . . The comment to add to the alarm summary entry. Comments
have a maximum of 128 characters.
Return Value
Related Functions
Example
System Keyboard
Key Sequence
Command
Comment
See Also
Alarm Functions
AlarmDelete
Description
Deletes alarm summary entries that are currently displayed. You can delete the
alarm where the cursor is positioned, one or more alarm lists on the active page,
a whole category of alarms, or alarms of a particular priority.
You would normally call this function from a keyboard command.
Syntax
AlarmDelete(Mode, Value)
Mode: . . . . . . . . . . . The type of deletion:
0 - Delete a single alarm where the cursor is positioned.
155
156
DelSum
AlarmDelete(0, 0)
Delete the alarm summary entry where the cursor is positioned
System Keyboard
Key Sequence
Command
Comment
ShiftDelSum
AlarmDelete(1, -1)
Delete a page of alarm summary entries
System Keyboard
Key Sequence
Command
Comment
System Keyboard
Key Sequence
Command
Comment
See Also
Alarm Functions
AlarmDisable
Description
Disables alarms. You can disable the alarm where the cursor is positioned, one or
more alarm lists on the active page, a whole category of alarms, or alarms of a
particular priority.
You would normally call this function from a keyboard command. No action is
taken if the alarms are already disabled. Use the AlarmEnable() function to reenable an alarm.
After you disable an alarm, it does not display on the alarm page, alarm
summary page, or alarm log. If you set the [Alarm]DisplayDisable parameter to
1, logging of disabled alarms continues, but the disabled alarms are not
displayed on the alarm display or alarm summary pages.
Syntax
AlarmDisable(Mode, Value)
Mode: . . . . . . . . . . . The type of disable:
0 - Disable a single alarm where the cursor is positioned.
Example
System Keyboard
Key Sequence
Command
Comment
Disable
AlarmDisable(0, 0)
Disable the alarm where the cursor is positioned
System Keyboard
Key Sequence
Command
Comment
System Keyboard
ShiftDisable
AlarmDisable(1, -1)
Disable a page of alarms
157
158
System Keyboard
Key Sequence
Command
Comment
See Also
Alarm Functions
AlarmDisableRec
Description
Syntax
Disables alarms by record number on both the Primary and Standby Alarms
Servers. You can call this function only on an Alarms Server. However, a client
can call this function remotely by using the MsgRPC() function.
AlarmDisableRec(Record)
Record: . . . . . . . . . . The alarm record number, returned from any of the
following alarm functions:
To store this value, use data type Int in Cicode or Long for
variable tags (Long needs 4 bytes).
Return Value
Related Functions
See Also
Alarm Functions
AlarmDsp
Description
Syntax
159
160
Example
Advanced Animation
Command
Comment
See Also
AlarmDsp(20,15,3)
Display 15 disabled alarms at AN 20
Alarm Functions
AlarmDspLast
Description
Displays the most recent unacknowledged alarms, at a specified AN. Use this
function to display the last alarms on all (or selected) pages. You can specify the
Return Value
Related Functions
161
162
AlarmDspLast(11)
Display the last alarm at AN 11
Advanced Animation
Command
Comment
See Also
AlarmDspLast(21,3)
Display the last 3 alarms at AN 21
Alarm Functions
AlarmDspNext
Description
Syntax
Displays the next page of alarms. This function pages down (scrolls) the alarms
displayed by the AlarmDsp() function. You would normally call this function
from a keyboard command.
AlarmDspNext(AN)
AN. . . . . . . . . . . . . . The AN where the alarm list is displayed, or:
-1 - Scroll all alarm lists displayed on the page.
0 - Scroll the alarm list where the cursor is positioned.
Note: AN alarm page can contain more than one alarm list.
Return Value
Related Functions
Example
System Keyboard
Key Sequence
Command
Comment
See Also
Alarm Functions
NextAlarm
AlarmDspNext(20)
Display the next page of alarms (from the alarm list) at AN20
AlarmDspPrev
Description
Syntax
Displays the previous page of alarms. This function pages up (scrolls) the alarms
displayed by the AlarmDsp() function. You would normally call this function
from a keyboard command.
AlarmDspNext(AN)
AN: . . . . . . . . . . . . . The AN where the alarm list is displayed, or:
-1 - Scroll all alarm lists displayed on the page.
0 - Scroll the alarm list where the cursor is positioned.
Note: AN alarm page can contain more than one alarm list.
Return Value
Related Functions
Example
System Keyboard
Key Sequence
Command
Comment
See Also
PrevAlarm
AlarmDspPrev(20)
Display the previous page of alarms (from the
alarm list) at AN20
Alarm Functions
AlarmEnable
Description
Enables an alarm on the active alarm list. You can enable the alarm where the
cursor is positioned, one or more alarm lists on the active page, a whole category
of alarms, or alarms of a particular priority.
No action is taken if the alarms are already enabled. You would normally call
this function from a keyboard command.
Syntax
AlarmEnable(Mode, Value)
Mode: . . . . . . . . . . . The type of enable:
0 - Enable a single alarm where the cursor is positioned.
163
164
Example
System Keyboard
Key Sequence
Command
Comment
Enable
AlarmEnable(0, 0)
Enable the alarm where the cursor is positioned
System Keyboard
Key Sequence
Command
Comment
System Keyboard
ShiftEnable
AlarmEnable(1, -1)
Enable a page of alarms
System Keyboard
Key Sequence
Command
Comment
See Also
Alarm Functions
AlarmEnableRec
Description
Syntax
Enables alarms by record number on both the Primary and Standby Alarms
Servers. You can call this function only on an Alarms Server. However, a client
can call this function remotely by using the MsgRPC() function.
AlarmEnableRec(Record)
Record: . . . . . . . . . . The alarm record number, returned from any of the
following alarm functions:
To store this value, use data type Int in Cicode or Long for
variable tags (Long needs 4 bytes).
Return Value
Related Functions
Example
165
166
Alarm Functions
AlarmEventQue
Description
Opens the alarm event queue. The Alarms Server writes events into this queue
as they are processed. These events include all activated, reset, acknowledged,
enabled and disabled alarms. To read events from this queue, use the QueRead()
or QuePeek() functions. The data put into the queue is the alarm record
identifier (into the Type field) and the alarm event format (into the Str field).
The function puts all state changes into the queue and CitectSCADA does not
use this queue for anything.
To use this function, you must enable the alarm event queue with the
[Alarm]EventQue parameter. This parameter will tell the Alarms Server to start
placing events into the queue. The [Alarm]EventFmt parameter defines the
format of the data placed into the string field. You can enable the EventQue
parameter without setting the event format to prevent the Alarms Server from
placing a formatted string into the queue. Enabling this feature can cause
increase CPU loading and reduce performance of the Alarms Server; only use
this feature if really necessary.
The maximum length of each queue is controlled by the [Code]Queue
parameter. You may need to adjust this parameter so as not to miss alarm
events. (When the queue is full, the Alarms Server will discard events.)
Syntax
Return Value
Related Functions
Example
See Also
AlarmEventQue()
The handle of the alarm event queue, or -1 if the queue cannot be opened.
QueRead, QuePeek
hQue = AlarmEventQue()
WHILE TRUE DO
QueRead(hQue, nRecord, sAlarmFmt, 1);
/* do what ever with the alarm event */
....
Sleep(0);
END
Alarm Functions
AlarmFirstCatRec
Description
Searches for the first occurrence of an alarm category and type. You can search
all areas, the current area only, or specify an area to limit the search. You can call
this function only on an Alarms Server. However, a client can call this function
remotely by using the MsgRPC() function.
This function returns an alarm record identifier that you can use in other alarm
functions, for example, to acknowledge, disable, or enable the alarm, or to get
field data on that alarm. To get the alarm record identifier for an alarm on a
Display Client, use the AlarmDspGet() function.
Syntax
Return Value
Related Functions
Example
See AlarmAckRec
See Also
Alarm Functions
167
168
AlarmFirstPriRec
Description
Searches for the first occurrence of an alarm priority and type. You can search all
areas, the current area only, or specify an area to limit the search. You can call
this function only on an Alarms Server. However, a client can call this function
remotely by using the MsgRPC() function.
This function returns an alarm record identifier that you can use in other alarm
functions, for example, to acknowledge, disable, or enable the alarm, or to get
field data on that alarm. To get the alarm record identifier for an alarm on a
Display Client, use the AlarmDspGet() function.
Syntax
Return Value
Related Functions
Example
See Also
Alarm Functions
AlarmFirstTagRec
Description
Searches for the first occurrence of an alarm tag, name, and description. You can
only call this function on an Alarms Server. However, a client can call this
function remotely by using the MsgRPC() function.
This function returns an alarm record identifier that you can use in other alarm
functions, for example, to acknowledge, disable, or enable the alarm, or to get
field data on that alarm.
Syntax
Return Value
Related Functions
Example
See Also
169
170
AlarmGetDelay
Description
Syntax
Gets the delay setting for the alarm the cursor is currently positioned over.
AlarmGetDelay(Type, Value)
Type: . . . . . . . . . . . . The type of delay:
0 - Delay (digital alarm/advancedalarm)
1 - High high delay (analog alarm)
2 - High delay (analog alarm)
3 - Low delay (analog alarm)
4 - Low low delay (analog alarm)
5 - Deviation delay (analog alarm)
Value: . . . . . . . . . . . The new value for the delay. Enter a blank value " " to
remove the delay setting.
Return Value
Related Functions
See Also
Alarm Functions
AlarmGetDelayRec
Description
Syntax
Gets the delay setting for an alarm via the alarm record number. You can only
call this function for local alarns, or on the redundant server (if one has been
configured). However, a client can call this function remotely by using the
MsgRPC() function.
AlarmGetDelayRec(Record, Type)
Record: . . . . . . . . . . The alarm record number, returned from any of the
following alarm functions:
Related Functions
See Also
AlarmGetDsp
Description
Gets field data from the alarm record that is displayed at the specified AN. You
can use this function for both Alarm Pages and Alarm Summaries (an Alarm
Page or Alarm Summary must be displayed before this function can be used).
You can call this function on an Alarms Server or a Display Client to get the
contents of any field in the alarm record at that AN.
You can return the record number of the alarm record for use in other alarm
functions, for example, to acknowledge, disable, or enable an alarm (on an
Alarms Server).
The AlarmGetDsp() function does not support hardware alarms.
Syntax
AlarmGetDsp(AN, sField)
AN: . . . . . . . . . . . . . The AN where the alarm entry is displayed.
171
172
Alarm category
Alarm description
Alarm help page
Alarm name
Alarm tag
The time that the alarm changed state (hh:mm:ss)
The alarm record number
Operator comments attached to the Alarm Log entry (if any)
Return Value
Related Functions
Example
See Also
Alarm Functions
AlarmGetFieldRec
Description
Gets the contents of the specified field in the specified alarm record. This
function can only be called on an Alarms Server except in the following
situations:
To store this value, use data type Int in Cicode or Long for
variable tags (Long needs 4 bytes).
sField: . . . . . . . . . . . The name of the field from which the data is extracted. You
can specify any of the fields in any of the alarms databases
(Digital Alarms, Analog Alarms, etc.).
Category Alarm category
Desc
Alarm description
173
174
Example
See Also
Alarm Functions
AlarmGetInfo
Description
Gets data on the alarm list displayed at a specified AN. Use this function to
display the current alarm list information on an alarm page. If only one alarm
list has been configured on an alarm page, modes 2 and 3 of this function return
the current alarm page information.
Note that you can not retrieve the order by key setting for an alarm list using this
function, as it can only returns numeric values. To retrieve this information, use
the function AlarmGetOrderbyKey
Syntax
AlarmGetInfo(AN, Type)
AN: . . . . . . . . . . . . . The AN where the alarm list (with the required information)
is displayed. Set the AN to 0 (zero) to get information on the
alarm list where the cursor is positioned.
Type: . . . . . . . . . . . . The type of data:
0 - Alarm page number. The vertical offset (in pages) from
the AN where the alarm list commenced. The alarm
list must have scrolled off the first page for this type to
return a non-zero value.
1 - Alarm list offset. The vertical offset (in lines) from the AN
where the alarm list commenced. You must have
scrolled off the first page of alarms for this type to
return a non zero value.
2 - Category of alarms displayed on the alarm list. You can
use a group number to display a group of categories.
This type should not be used if more than one alarm
list is configured for the page.
3 - Type of alarms displayed on the alarm list. See
AlarmDsp() for a list of these types. This type should
not be used if more than one alarm list is configured
for the page.
7 - Priority of alarms displayed on the alarm list. The return
value may be a group number if the alarm list contains
alarms of more than one priority.
175
176
See Also
Alarm Functions
AlarmGetOrderbyKey
Description
Syntax
Retrieves the list of key(s) that are used to determine the order of the alarm list.
These keys can be set by the AlarmSetInfo() function.
AlarmGetOrderbyKey(AN)
AN: . . . . . . . . . . . . . The AN where the alarm list (with the required information)
is displayed.
Return Value
Example
See Also
Alarm Functions
AlarmGetThreshold
Description
Syntax
Gets the threshold of the analog alarm where the cursor is positioned.
AlarmGetThreshold(Type)
Type: . . . . . . . . . . . . The type of threshold:
AlarmGetThresholdRec
Description
Syntax
Gets the threshold of analog alarms by the alarm record number. You can call
this function only on an Alarms Server for alarms on that server, or on the
redundant server (if a redundant server is configured). However, a client can
call this function remotely by using the MsgRPC() function.
AlarmGetThresholdRec(Record, Type)
Record: . . . . . . . . . . The alarm record number, returned from any of the
following alarm functions:
177
178
AlarmHelp
Description
Return Value
Related Functions
Displays the alarm help page (associated with the alarm) where the cursor is
positioned. You can assign a help page to each alarm when you define it (using
the Digital Alarms or the Analog Alarms database, depending on the type of
alarm). You must also define the help page in the Pages database.
0 (zero) if successful, otherwise an error is returned.
PageAlarm
Example
System Keyboard
Key Sequence
Command
Comment
See Also
Alarm Functions
AlmHelp
AlarmHelp()
Display the alarm help page
AlarmNextCatRec
Description
Searches for the next occurrence of an alarm category and type, commencing
with the specified alarm record identifier (returned from the previous search
through the AlarmFirstCatRec() function). You can search all areas, the current
area only, or specify an area to limit the search. You can call this function only on
an Alarms Server. However, a client can call this function remotely by using the
MsgRPC() function.
This function returns an alarm record identifier that you can use in other alarm
functions, for example, to acknowledge, disable, or enable the alarm, or to get
field data on that alarm. To get the alarm record identifier for an alarm on a
Display Client, use the AlarmDspGet() function.
Syntax
To store this value, use data type Int in Cicode or Long for
variable tags (Long needs 4 bytes).
Category: . . . . . . . . The alarm category or group number to match. Set Category
to 0 (zero) to match all alarm categories.
Type: . . . . . . . . . . . . The type of alarms to find:
Non-hardware alarms
0 - All active alarms, i.e. Types 1 and 2.
1 - All unacknowledged alarms, ON and OFF.
2 - All acknowledged ON alarms.
3 - All disabled alarms.
179
180
Example
See Also
AlarmNextPriRec
Description
Searches for the next occurrence of an alarm of a specified priority and type,
commencing with the specified alarm record identifier (returned from the
previous search through the AlarmFirstPriRec() function). You can search all
areas, the current area only, or specify an area to limit the search. You can call
this function only on an Alarms Server. However, a client can call this function
remotely by using the MsgRPC() function.
This function returns an alarm record identifier that you can use in other alarm
functions, for example, to acknowledge, disable, or enable the alarm, or to get
field data on that alarm. To get the alarm record identifier for an alarm on a
Display Client, use the AlarmDspGet() function.
Syntax
To store this value, use data type Int in Cicode or Long for
variable tags (Long needs 4 bytes).
Priority: . . . . . . . . . The alarm Priority or group handle of a group of alarm
priorities. Set Priority to 0 (zero) to match all alarm priorities.
Type: . . . . . . . . . . . . The type of alarms to find:
Non-hardware alarms
0 - All active alarms, i.e. Types 1 and 2.
1 - All unacknowledged alarms, ON and OFF.
2 - All acknowledged ON alarms.
3 - All disabled alarms.
4 - All configured alarms, i.e. Types 0 to 3, plus
acknowledged OFF alarms.
If you do not specify a Type, the default is 0.
Area: . . . . . . . . . . . . The area in which to search for alarms. Set Area to -1 to
search all areas. If you do not specify an area, only alarms in
the current area on the Alarms Server are searched.
Return Value
Related Functions
Example
See Also
AlarmNextTagRec
Description
Searches for the next occurrence of an alarm tag, name, and description, starting
with the alarm record identifier (returned from the previous search through the
181
182
To store this value, use data type Int in Cicode or Long for
variable tags (Long needs 4 bytes).
Tag: . . . . . . . . . . . . . The alarm tag to be matched. Specify an empty string (" ") to
match all alarm tags.
Name: . . . . . . . . . . . The alarm name to be matched. Specify an empty string (" ")
to match all alarm names.
Description: . . . . . . The alarm description to be matched. Specify an empty
string (" ") to match all alarm descriptions.
Return Value
Related Functions
Example
See Also
AlarmNotifyVarChange
Description
Syntax
Return Value
Example
See Also
AlarmSetDelay
Description
Syntax
Changes the delay setting for an alarm (i.e. Delay, High High Delay, Deviation
Delay, etc.). This function acts on the alarm that the cursor is positioned over.
Use this function during runtime to change the delay values that were specified
in the alarms database. Delay changes made using this process are permanent
(i.e. they are saved to the project).
AlarmSetDelay(Type, Value)
Type: . . . . . . . . . . . . The type of delay:
183
184
AlarmSetDelayRec
Description
Syntax
Changes the delay setting for an alarm (i.e. Delay, High High Delay, Deviation
Delay, etc.) by the alarm record number. You can only call this function on an
alarms server for local alarms, or on a redundant server if one has been
configured. However, a client can call this function remotely by using the
MsgPRC() function.
AlarmSetDelayRec(Record, Type, Value)
Record: . . . . . . . . . . The alarm record number, returned from any of the
following alarm functions:
AlarmSetInfo
Description
Syntax
Changes the display parameters for the alarm list displayed at a specified AN.
AlarmSetInfo(AN, Type, Value)
AN: . . . . . . . . . . . . . The AN where the alarm list originally commenced. (AN
alarm page can contain more than one alarm list). You can
also specify:
-1 - Change the display parameters of all alarm lists
displayed on the page.
0 - Change the display parameters of the alarm list where the
cursor is positioned.
Type: . . . . . . . . . . . . The type of data:
0 - Alarm page number. The vertical offset (in pages) from
the AN where the alarm list commenced.
1 - Alarm list offset. The vertical offset (in lines) from the AN
where the alarm list commenced.
2 - Category of alarms displayed on the alarm list. To specify
all categories use a value of 0.
You can use a group handle to display a group of
categories. (A group can be defined using Groups from the Project Editor System menu - or by using the
185
186
The Keyname argument specifies the name of the pre-defined order-by key to be
used. The valid options are a subset of the alarm display fields: Tag, Name,
Category, Priority, Area, Priv, Time, State.
The SortDirection argument is optional, and indicates whether the sort will be
ascending or descending. Valid options are: 0 Descending (default), 1
Ascending.
187
188
Return Value
Related Functions
Example
hGrp=GrpOpen("MyGrp",1); StrToGrp(hGrp,"1..10,20,25");
GrpClose(hGrp)
*/
AlarmSetInfo(20, 2, hGrp);
See Also
Alarm Functions
AlarmSetQuery
Description
Write the Cicode function that will be used as the query function.
Note: You can also use AlarmSetQuery() to remove filtering from an alarm list.
AlarmSetQuery( -1, "", "" ) stops the query function filtering the display of
alarms.
Syntax
189
190
The types of the arguments listed in AlarmSetQuery() should match the types of
the arguments defined in the query function.
Return Value
AlarmGetFieldRec, AlarmSetInfo
!Sets MyQueryDate() as the query function and provides the
arguments 23, 23/12/1999, and 23.45
AlarmSetQuery(0, "MyQueryDate", "23, ^"23/12/1999^", 23.45");
!Removes filtering by the current query function from all alarm
lists on the page
AlarmSetQuery(-1, "", "");
See Also
Alarm Functions
AlarmSetThreshold
Description
Syntax
Changes the thresholds (i.e. High High, Low etc.) of analog alarms. This
function acts on the analog alarm where the cursor is positioned. Use this
function to change (at run time) the threshold values that were specified in the
Analog Alarms database. Threshold changes made using this function are
permanent (i.e. they are saved to the project). The display format currently
specified for the record (in the Analog Alarms form) will be applied to these
values.
AlarmSetThreshold(Type, Value)
Type: . . . . . . . . . . . . The type of threshold:
0 - High high
1 - High
2 - Low
3 - Low low
4 - Deadband
5 - Deviation
6 - Rate of change
Value: . . . . . . . . . . . The new value of the threshold. Enter a blank value "" to
remove the threshold.
Return Value
Related Functions
Example
System Keyboard
191
192
System Keyboard
Key Sequence
Command
Comment
System Keyboard
Key Sequence
Command
Comment
System Keyboard
Key Sequence
Command
Comment
See Also
Alarm Functions
AlarmSetThresholdRec
Description
Changes the threshold (i.e. High High, Low etc.) of analog alarms by the alarm
record number. You can call this function only on an Alarms Server for alarms
on that server, or on the redundant server (if a redundant server is configured).
However, a client can call this function remotely by using the MsgRPC()
function.
Threshold changes made using this function are permanent (i.e. they are saved
to the project). The display format currently specified for the record (in the
Analog Alarms form) will be applied to these values.
Syntax
To store this value, use data type Int in Cicode or Long for
variable tags (Long needs 4 bytes).
Type: . . . . . . . . . . . . The type of threshold:
0 - High high
1 - High
2 - Low
3 - Low low
4 - Deadband
5 - Deviation
6 - Rate of change
Value: . . . . . . . . . . . The new value of the threshold. Enter a blank value "" to
remove the threshold.
Return Value
Related Functions
See Also
AlarmSplit
Description
Syntax
Return Value
Related Functions
193
194
See Also
Split
AlarmSplit()
Duplicates an alarm summary entry
Alarm Functions
AlarmSumAppend
Description
Appends a new blank record to the alarm summary. Use this function to add
new alarm summary entries, either for actual alarms or as special user summary
entries.
If you specify a valid alarm tag in the sTag field, the summary entry is linked to
the actual alarm. If you specify an asterisk '*' as the first letter of the tag, the
summary entry becomes a user event.
User events are not attached to alarm records, so their status will never change.
You must manually change the status of the user event, by calling the
AlarmSumSet() function with the index returned by AlarmSumAppend(). As
user events are not attached to alarms, they don't have the alarm fields - so the
AlarmSumGet() function will not return any field data.
You can use user events to keep a record of logins, or control operations that you
need to display in the alarm summary etc. To set the {ONTIME} {OFFTIME} etc.
data, use the AlarmSumSet() function.
Syntax
AlarmSumAppend(sTag)
sTag: . . . . . . . . . . . . The alarm tag to append. Use an asterisk '*' as the first letter
to append a user event to the alarm summary. Note that if
you using this 'user event mode' the AlarmSumAppend
function returns the alarm summary index - not the error
code.
Return Value
Related Functions
Example
The index of the alarm summary entry, or -1 if the record could not be
appended.
AlarmSumSet
! Append alarm to summary display
AlarmSumAppend("CV101");
! Append user event
See Also
Alarm Functions
AlarmSumCommit
Description
Commits the alarm summary record to the alarm summary device. Alarm
summaries are normally written to the alarm summary device just before they
are deleted from the summary queue. The length of time that alarm summary
entries remain in the alarm summary queue is controlled by
[Alarm]SummaryTimeout parameter
This function allows you to commit the alarm summary records now, rather
than when they are deleted from the queue.
Syntax
AlarmSumCommit(Index)
Index: . . . . . . . . . . . The alarm summary index (returned from the
AlarmSumFirst(), AlarmSumNext(), AlarmSumLast(),
AlarmSumPrev(), AlarmSumAppend(), or AlarmSumFind()
function).
Return Value
Related Functions
Example
195
196
Alarm Functions
AlarmSumDelete
Description
Deletes an alarm summary entry. You identify the alarm summary entry by the
Index, returned by one of the alarm summary search functions.
By embedding this function in a loop, you can delete a series of alarm summary
entries. To start deleting from the oldest entry, call the AlarmSumFirst() function
to get the index, and then call AlarmSumNext() in a loop. To delete back from
the most recent entry, call AlarmSumLast() and then AlarmSumPrev() in a loop.
You can also get the Index from the AlarmSumFind() function, which finds an
alarm summary entry by its alarm record identifier and time of activation.
You can call this function only on an Alarms Server and only for alarms on that
server.
Syntax
AlarmSumDelete(Index)
Index: . . . . . . . . . . . The alarm summary index (returned from the
AlarmSumFirst(), AlarmSumNext(), AlarmSumLast(),
AlarmSumPrev(), AlarmSumAppend(), or AlarmSumFind()
function).
Return Value
Related Functions
Example
See Also
Alarm Functions
AlarmSumFind
Description
Finds the alarm summary index for an alarm that you specify by the alarm
record identifier and alarm activation time (OnTime). You can use this index in
the AlarmSumGet() function to get field data from an alarm record, in the
AlarmSumSet() function to change the existing data in that record, or in the
AlarmSumDelete() function to delete the record.
To work with a series of alarm summary records, call this function to get the
index, and then call either AlarmSumNext() to move forwards in the summary,
or AlarmSumPrev() to move backwards in the summary.
You can call this function only on an Alarms Server. However, a client can call
this function remotely by using the MsgRPC() function.
Syntax
AlarmSumFind(Record, OnTime)
Record: . . . . . . . . . . The alarm record number, returned from any of the
following alarm functions:
To store this value, use data type Int in Cicode or Long for
variable tags (Long needs 4 bytes).
OnTime: . . . . . . . . . The ON time of the alarm associated with the Record, that is,
the time that the alarm was activated.
197
198
will NOT yield the correct result. The correct formulation for
this calculation is:
OnTime = StrToTime(AlarmSumGet(iIndex, "OnTime"))
+ TimeMidnight(TimeCurrent());
Return Value
Related Functions
Example
/* This function sets the summary comment from the alarm record
number and the ontime of the summary event. */
FUNCTION
SumSetComment(INT AN, STRING sComment)
INT nRecord;
INT iOnTime;
INT Index;
iOnTime=StrToDate(AlarmGetDsp(AN,"OnDate"))+StrToTime(AlarmGetDsp
(AN,"OnTime"));
nrecord=StrToInt(AlarmGetDsp(AN,"RecNo"));
Index = AlarmSumFind(nRecord, iOnTime);
IF Index<>-1 THEN
AlarmSumSet(Index,"Comment", sComment);
END
END
See Also
Alarm Functions
AlarmSumFirst
Description
Gets the index of the oldest alarm summary entry. You can use this index in the
AlarmSumGet() function to get field data from an alarm record, in the
AlarmSumSet() function to change the existing data in that record, or in the
AlarmSumDelete() function to delete the record.
Related Functions
Example
AlarmSumFirst()
The index of the oldest alarm summary entry, or -1 if no alarm summary entry is
found.
AlarmSumGet, AlarmSumSet, AlarmSumDelete, AlarmSumNext,
AlarmSumLast, AlarmSumPrev
/* This function finds all alarm summary entries
specified tag and sets the "OffTime" to the time
alarm entry is not acknowledged or set to the off
summary "OffTime" field is all that is affected.
FUNCTION
SumSetTime(STRING sTag, INT Time)
INT Index;
STRING Name;
Index=AlarmSumFirst();
WHILE Index<>-1 DO
Name=AlarmSumGet(Index,"Tag");
IF Name=sTag THEN
AlarmSumSet(Index,"OffTime",Time);
END
Index=AlarmSumNext(Index);
END
END
See Also
Alarm Functions
AlarmSumGet
Description
Gets field data from an alarm summary entry. The data is returned as a string.
You identify the alarm summary entry by the Index, returned by one of the alarm
summary search functions.
By embedding this function in a loop, you can get data from a series of alarm
summary entries. To start from the oldest entry, call the AlarmSumFirst()
function to get the index, and then call AlarmSumNext() in a loop. To work back
from the most recent entry, call AlarmSumLast() and then AlarmSumPrev() in a
loop.
199
200
AlarmSumGet(Index, sField)
Index: . . . . . . . . . . . The alarm summary index (returned from the
AlarmSumFirst(), AlarmSumNext(), AlarmSumLast(),
AlarmSumPrev(), AlarmSumAppend(), or AlarmSumFind()
function).
sField: . . . . . . . . . . . The name of the field from which to extract the data:
Tag
AckDate
AckTime
Category
Comment
DeltaTime
Desc
Help
Name
OffDate
OffTime
OnDate
OnTime
State
Return Value
Related Functions
Example
See Also
Alarm tag
Alarm acknowledged date
Alarm acknowledged time
Alarm category
Alarm comment
Alarm active time
Alarm description
Help page
Alarm name
Alarm OFF date
Alarm OFF time
Alarm ON date
Alarm ON time
Alarm state
AlarmSumLast
Description
Gets the index of the most recent alarm summary entry. You can use this index
in the AlarmSumGet() function to get field data from an alarm record, in the
AlarmSumSet() function to change the existing data in that record, or in the
AlarmSumDelete() function to delete the record.
Related Functions
Example
AlarmSumLast()
The index of the most recent alarm summary entry, or -1 if no alarm summary
entry is found.
AlarmSumGet, AlarmSumSet, AlarmSumDelete, AlarmSumPrev,
AlarmSumFirst, AlarmSumNext
/* This function finds all alarm summary entries
specified tag and sets the "OffTime" to the time
alarm entry is not acknowledged or set to the off
summary "OffTime" field is all that is affected.
FUNCTION
SumSetTime(STRING sTag, INT Time)
INT Index;
STRING Name;
Index=AlarmSumLast();
WHILE Index<>-1 DO
Name=AlarmSumGet(Index,"Tag");
IF Name=sTag THEN
AlarmSumSet(Index,"OffTime",Time);
END
Index=AlarmSumPrev(Index);
END
END
See Also
Alarm Functions
AlarmSumNext
Description
Gets the index of the next alarm summary entry, that is, the entry that occurred
later than the entry specified by Index. You can use this index in the
AlarmSumGet() function to get field data from an alarm record, in the
AlarmSumSet() function to change the existing data in that record, or in the
AlarmSumDelete() function to delete the record.
You can use this function to work with a series of alarm summary records. Call
the AlarmSumFirst() or AlarmSumFind() function to get the index, and then call
AlarmSumNext() within a loop, to move forwards in the alarm summary.
201
202
AlarmSumNext(Index)
Index: . . . . . . . . . . . The alarm summary index (returned from the
AlarmSumFirst(), AlarmSumNext(), AlarmSumLast(),
AlarmSumPrev(), AlarmSumAppend(), or AlarmSumFind()
function).
Return Value
The index of the next alarm summary entry or -1 if no more alarm summary
entries are found.
Related Functions
Example
See Also
See AlarmSumFirst
Alarm Functions
AlarmSumPrev
Description
Gets the index of the previous alarm summary entry, that is, the entry that
occurred before the entry specified by Index. You can use this index in the
AlarmSumGet() function to get field data from an alarm record, in the
AlarmSumSet() function to change the existing data in that record, or in the
AlarmSumDelete() function to delete the record.
You can use this function to work with a series of alarm summary records. Call
the AlarmSumLast() or AlarmSumFind() function to get the index, and then call
AlarmSumPrev() within a loop, to move backwards in the alarm summary.
You can call this function only on an Alarms Server.
Syntax
AlarmSumPrev(Index)
Index: . . . . . . . . . . . The alarm summary index (returned from the
AlarmSumFirst(), AlarmSumNext(), AlarmSumLast(),
AlarmSumPrev(), AlarmSumAppend(), or AlarmSumFind()
function).
Return Value
Example
See Also
AlarmSumSet
Description
Sets field information in an alarm summary entry. You identify the alarm
summary entry by the Index, returned by one of the alarm summary search
functions.
By embedding this function in a loop, you can change field data in a series of
alarm summary entries. To start from the oldest entry, call the AlarmSumFirst()
function to get the index, and then call AlarmSumNext() in a loop. To work back
from the most recent entry, call AlarmSumLast() and then AlarmSumPrev() in a
loop.
You can also get the Index from the AlarmSumFind() function, which finds an
alarm summary entry by its alarm record identifier and time of activation.
You can call this function only on an Alarms Server.
Syntax
203
204
See AlarmSumFirst
Alarm Functions
AlarmSumSplit
Description
Duplicates the alarm summary entry identified by Index. You can use this
function to add another comment to an alarm summary entry.
You can call this function only on an Alarms Server and only for alarms on that
server. To duplicate an alarm summary entry on a Display Client, use the
AlarmSplit() function - the entry at the cursor position is duplicated.
Syntax
AlarmSumSplit(Index)
Index: . . . . . . . . . . . The alarm summary index (returned from the
AlarmSumFirst(), AlarmSumNext(), AlarmSumLast(),
AlarmSumPrev(), AlarmSumAppend(), or AlarmSumFind()
function).
Return Value
Related Functions
Example
Alarm Functions
AlarmSumType
Description
Syntax
Retrieves a value that indicates a specified alarms type, ie. whether its a digital
alarm, an analog alarm, hardware alarm, etc.
AlarmSumType(Index)
Index: . . . . . . . . . . . The alarm summary index (returned from the
AlarmSumFirst(), AlarmSumNext(), AlarmSumLast(),
AlarmSumPrev(), AlarmSumAppend(), or AlarmSumFind()
function).
Return Value
Related Functions
See Also
0 = digital alarm
1 = analog alarm
2 = advanced alarm
3 = Multi-Digital alarm
5 = user-generated event
7 = hardware alarm
AnByName
Description
Syntax
205
206
Related Functions
See Also
AreaCheck
Description
Syntax
Return Value
Related Functions
Example
See Also
TRUE (1) if the user has access to the Area or FALSE (0) if not.
GetArea, GetPriv
IsArea = AreaCheck(5);
Miscellaneous Functions
ArcCos
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
ArcSin
Description
ArcSin(Number)
Number: . . . . . . . . . The sine of the angle.
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
ArcTan
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
Ass
Description
Associates a variable tag with a Super Genie. This association is only made for
the next Super Genie you display (either in the current window or in a new
window). You cannot create an association for a Super Genie that is already
displayed. You must call this function once for every Super Genie substitution
string in the Super Genie.
This function provides the lowest level of support for associating Super Genie
variables with physical tags. The higher level functions (listed below) are
simpler to use.
Syntax
207
208
Example
See Also
AssChain
Description
Chains the associations from the current Super Genie to a new Super Genie. Use
this function to display a new Super Genie when you already have one
displayed. The new Super Genie will inherit all the associations of the first Super
Genie.
This function provides the lowest level of support for chaining associations from
one Super Genie to another. You should call the higher level functions
AssChainPage(), AssChainWin(), and AssChainPopUp() - these functions are
simpler to use.
Syntax
Example
See Also
AssChainPage
Description
Syntax
Chains the associations from the current Super Genie to a new Super Genie, and
displays the new Super Genie (in the current window). Use this function to
display a new Super Genie when you already have one displayed. The new
Super Genie will inherit all the associations of the first Super Genie.
AssChainPage(sPage)
sPage: . . . . . . . . . . . The page name of the Super Genie. If you prefixed your
Super Genie page name with an exclamation mark (!),
remember to include it here.
Return Value
Related Functions
Example
209
210
AssChainPopUp
Description
Chains the associations from the current Super Genie to a new Super Genie, and
displays the new Super Genie in a new popup window. Use this function to
display a new Super Genie in a new popup window when a Super Genie is
already displayed. The new Super Genie will inherit all the associations of the
first.
Note: This function prevents the Super Genie from being opened more than
once (at the same time). However, the same Super Genie with different
associations can be opened.
Syntax
AssChainPopUp(sPage)
sPage . . . . . . . . . . . . The page name of the Super Genie. If you prefixed your
Super Genie page name with an exclamation mark (!),
remember to include it here.
Return Value
Related Functions
Example
See Also
AssChainWin
Description
Syntax
Chains the associations from the current Super Genie to a new Super Genie, and
displays the new Super Genie in a new window. The new window will be of the
same type as the current window. Use this function to display a new Super
Genie in a new window when a Super Genie is already displayed. The new
Super Genie will inherit all the associations of the first.
AssChainWin(sPage, X, Y, Mode)
sPage: . . . . . . . . . . . The page name of the Super Genie. If you prefixed your
Super Genie page name with an exclamation mark (!),
remember to include it here.
64
- Always on top.
211
212
Example
See Also
AssChainWinFree
Description
Saves the first 8 tag associations on an existing Super Genie, closes it, then
assigns the 8 tags to a new window. This allows a Super Genie popup window
to call another popup window, and close the parent popup.
This function is effectively the same as the AssChainWin() function, but frees the
current Super Genie.
Syntax
AssChainWinFree(sPage, X, Y, Mode)
sPage: . . . . . . . . . . . The page name of the Super Genie. If you prefixed your
Super Genie page name with an exclamation mark (!),
remember to include it here.
X - the x pixel coordinate of the top-left corner of the
window.
Y - the y pixel coordinate of the top-left corner of the
window.
Mode: . . . . . . . . . . . The mode of the window:
0 - Normal page.
1 - Page child window. The window is closed when a new
page is displayed, e.g. when the PageDisplay() or
PageGoto() function is called. The parent is the current
active window.
64
- Always on top.
213
214
// Close the current genie window and display a new genie using
the current associations
AssChainWinFree("!GeniePopup", 200, 300, 1 + 8);
See Also
Assert
Description
Verifies that the specified expression is TRUE. If then expression is FALSE, the
current task will be halted. This is useful for ensuring that sensitive code is not
executed in the event of an error.
This function can be used in a debug mode, where the failed assertion will be
logged to the Kernel and SysLog.DAT, with the time, date, Cicode file name, and
line number. Additionally the operator will be prompted with a dialog. The
debug mode can be set by using the [Code]DebugMessage parameter or
DebugMsgSet() function.
Note: If you have the "Citect will start debugger on hardware errors" option set
in the Cicode Editor, the Debugger will start with the position before the Halt()
instruction. You must 'step over' this command if you want to continue
debugging the function that called the Assert().
Syntax
Assert(bCondition)
bCondition: . . . . . . . The boolean expression. This expression must evaluate to
TRUE (1) or FALSE (0).
Return Value
Related Functions
Example
None. However, if the assertion fails (the condition is FALSE), error 347 is
generated.
Halt, DebugMsg, DebugMsgSet, CodeTrace, TraceMsg, ErrLog
INT
FUNCTION
FileDisplayEx(STRING sFileName);
INT hFile;
hFile = FileOpen(sFileName, "r");
Assert(hFile <> -1);
.
.
.
FileClose(hFile);
RETURN 0;
END
Miscellaneous Functions
AssInfo
Description
Gets association information about the current Super Genie (i.e. information
about a variable tag that has been substituted into the Super Genie). You can
only call this function on a Super Genie after all the associations are completed.
Use this function to display association information as part of the Super Genie.
For example, if you have a Super Genie that is a loop controller, you could
display the name of the loop at the top of the loop controller box. Each time the
Super Genie is used with different associations (specifically a different tag name
association) the correct loop name will be displayed.
Syntax
AssInfo(nArg, nType)
nArg: . . . . . . . . . . . When you associate variable tags with super Genies, the
Super Genie substitution strings are replaced by variable
tags. The nArg argument allows you to get information
about one of those variable tags. All you need to know is
which substitution string it replaced when the association
was performed.
Enter the argument number (substitution string number) of
the relevant substitution string. For example, if you want
information about the variable that replaced substitution
string
?INT 3?
set nArg to 3.
nType: . . . . . . . . . . . The type of information to get:
0 - Tag name of the association
1 - Engineering units
2 - Raw zero scale
3 - Raw full scale
4 - Engineering zero scale
5 - Engineering full scale
6 - Width of the format
7 - Number of decimal places of format.
Return Value
215
216
Example
See Also
AssPage
Description
Associates up to eight variable tags with a Super Genie and displays the Super
Genie in the current window. The first variable tag (sTag1) replaces Super Genie
substitution string 1. The second variable tag (sTag2) replaces substitution string
2, and so on.
This function has the same effect as calling Ass() or AssTag() eight times, and
then calling the PageDisplay() function. The AssPage() function provides a quick
way of associating eight Super Genie variables and displaying the Super Genie at the same time.
If you want to associate more than eight tags with the Super Genie, you must
call the AssVarTags(), AssTag(), or Ass() function to create the associations
before you call this function.
Syntax
AssPage(sPage, sTag1..8)
sPage: . . . . . . . . . . . The page name of the Super Genie. If you prefixed your
Super Genie page name with an exclamation mark (!),
remember to include it here.
sTag1..sTag8: . . . . . The first eight physical tags to be associated with the Super
Genie. For any given Super Genie, the variable tags will
replace the Super Genie substitution strings as follows:
Variable tag...
sTag1
sTag2
sTag3
sTag4
sTag5
sTag6
sTag7
sTag8
1
2
3
4
5
6
7
8
Related Functions
Example
// Associate 3 tags with the Super Genie then display the Super
Genie
AssPage("!MyGenie", "PV123", "OP123", "SP123");
See Also
AssPopUp
Description
Associates up to eight variable tags with a Super Genie and displays the Super
Genie in a popup window. The first variable tag (sTag1) replaces Super Genie
substitution string 1. The second variable tag (sTag2) replaces substitution string
2, and so on.
This function has the same effect as calling the Ass() function or the AssTag()
function eight times, and then calling the WinNewAt() function to create a
window at the position of the mouse. The AssPopUp() function is a quick way of
associating eight Super Genie variables and displaying the Super Genie in a new
window at the same time.
If you want to associate more than eight tags with the Super Genie, you must
call the AssVarTags(), AssTag(), or Ass() function to create the associations
before you call this function.
Note: This function prevents the Super Genie from being opened more than
once (at the same time). However, the same Super Genie with different
associations can be opened.
Syntax
AssPopUp(sPage, sTag1..8)
217
218
sTag1
sTag2
sTag3
sTag4
sTag5
sTag6
sTag7
sTag8
1
2
3
4
5
6
7
8
Because there is a strict correlation between the variable tag numbers and the
substitution string numbers, it is important to know how your Super Genie
substitutions are numbered. For example, if your Super Genie has three unique
substitution strings, numbered 1, 3, & 4, you must enter a blank ("") for sTag2.
The variable tags that you specify here must be the same data type as that
specified by the relevant Super Genie substitution strings. For example, only a
digital tag could replace the substitution string ?DIGITAL 4?. If the substitution
string does not specify a type (eg. ?5?), you can use any type except STRING.
Return Value
Related Functions
Example
See Also
AssScaleStr
Description
Gets scale information about the associations of the current Super Genie (i.e.
scale information about a variable tag that has been substituted into the Super
Genie). You can only call this function on a Super Genie after all the associations
are completed.
set nArg to 3.
Percent: . . . . . . . . . . The percentage of full scale of the returned value.
EngUnits: . . . . . . . . Determines if the value is returned with engineering units:
0 - Do not return the value with engineering units
1 - Return the value with engineering units
Return Value
Related Functions
Example
See Also
219
220
AssTag
Description
Syntax
Associates a variable tag with the a Super Genie. The association will only be
created for the next Super Genie you display in the current window, and will
only come into effect after you re-display the Super Genie. You must call this
function once for every substitution string in the current Super Genie. You
cannot use this function to create associations for variables that will display in
new windows.
AssTag(nArg, sTag)
nArg: . . . . . . . . . . . The argument number (substitution string number) of the
Super Genie string to be replaced by sTag. For example, to
replace ?INT 3? with sTag, set nArg to 3.
sTag: . . . . . . . . . . . . The variable tag that will replace the Super Genie
substitution string. The tag must be the same data type as
that specified by the Super Genie substitution string. For
example, only a digital tag could replace the substitution
string ?DIGITAL 4?. If the substitution string does not
specify a type (eg. ?5?), you can use any type except STRING.
Return Value
Related Functions
Example
See Also
AssTitle
Description
Syntax
Sets the runtime window title to the tag name of the first variable substituted
into the Super Genie.
AssTitle(Mask, Prefix, Suffix)
Mask: . . . . . . . . . . . The number of characters to mask (hide) from the right of the
title string (optional).
Prefix: . . . . . . . . . . . A string to add to the beginning of the title string (optional).
AssVarTags
Description
Associates up to eight variable tags with a Super Genie. This association is only
made for the next Super Genie you display (either in the current window or in a
new window). This function has an offset that allows you to specify which
substitution string the first variable tag will replace. This means that if you have
a Super Genie with more than 8 substitution strings, you can use this function
repeatedly (while increasing the offset), until you have associated all the
necessary variable tags.
This function has the same effect as calling the Ass() function or the AssTag()
function eight times. The AssVarTags() function is a quick way of associating up
to eight Super Genie variables at the same time.
Syntax
221
222
Because there is a strict correlation between the variable tag numbers and the
substitution string numbers, it is important to know how your Super Genie
substitutions are numbered. For example, if your Super Genie has three unique
substitution strings, numbered 1, 3, & 4, you must enter a blank ("") for sTag2.
Return Value
No value is returned.
Related Functions
Example
See Also
AssWin
Description
Associates up to eight variable tags with a Super Genie, and displays the Super
Genie in a new window. This function has the same effect as calling the Ass() or
AssTag() function eight times, and then calling the WinNewAt() function. The
AssWin() function is a quick way of associating eight Super Genie variables and
creating a new window - at the same time.
If you want to associate more than eight tags with the Super Genie you must call
the AssVarTags(), AssTag(), or Ass() function to create the associations before
you call this function.
Syntax
64
- Always on top.
223
224
sTag1
sTag2
sTag3
sTag4
sTag5
sTag6
sTag7
sTag8
1
2
3
4
5
6
7
8
Because there is a strict correlation between the variable tag numbers and the
substitution string numbers, it is important to know how your Super Genie
substitutions are numbered. For example, if your Super Genie has three unique
substitution strings, numbered 1, 3, & 4, you must enter a blank ("") for sTag2.
The variable tags that you specify here must be the same data type as that
specified by the relevant Super Genie substitution strings. For example, only a
digital tag could replace the substitution string ?DIGITAL 4?. If the substitution
string does not specify a type (eg. ?5?), you can use any type except STRING.
Return Value
Related Functions
Example
See Also
Beep
Description
Beeps the internal speaker or sound card (installed in the computer). If you use
the internal speaker on your computer, the function does not return until the
sound has completed. If you use a sound card, the function returns immediately
and the sound plays in the background.
Beep(nSound)
nSound: . . . . . . . . . The type of sound:
-1
Return Value
Related Functions
Example
- Standard beep
- Question waveform
- Exclamation waveform
- Asterisk waveform
See Also
Miscellaneous Functions
CallEvent
Description
Simulates an event, triggering any OnEvent() function that has the same Type
argument specified.
CitectSCADA starts running the function immediately, without reading any
data from the I/O Devices. Any I/O Device variable that you use will contain
either 0 (zero) or the last value read.
Syntax
CallEvent(Window, Type)
Window: . . . . . . . . . The number of the window, returned from the WinNew(),
WinNewAt(), or WinNumber() function.
Type: . . . . . . . . . . . . The type of event:
0
1 - A key has been pressed. When the user presses a key, the
callback function is called after CitectSCADA checks
225
226
227
228
Related Functions
Example
See Also
0 (zero) if successful, otherwise an error is set. To view the error, use the
IsError() function.
OnEvent, GetEvent, WinNew, WinNewAt, WinNumber, IsError
! Call Event Type 1 - key has been pressed in the current window.
Number=WinNumber();
CallEvent(Number,1);
Event Functions
CitectInfo
Description
Syntax
229
230
231
232
See Also
Miscellaneous Functions
ChainEvent
Description
Syntax
Calls an event function using the function handle. This creates a chain of event
handlers from a single event. Use the GetEvent() function to get the function
number of the current event handler.
ChainEvent(hFn)
hFn: . . . . . . . . . . . . The function handle, as returned from the GetEvent()
function.
Return Value
Related Functions
Example
See Also
CharToStr
Description
Syntax
Return Value
Related Functions
Example
See Also
String Functions
233
234
CitectColourToPackedR
GB
Description
Syntax
Converts a CitectSCADA color value into a packed RGB color value that can be
understood by an ActiveX object.
CitectColourToPackedRGB(nCitectColour)
nCitectColour: . . . . The CitectSCADA color value to be converted into a packed
RGB color. CitectSCADA colors are defined in the labels
database, or calculated by the function MakeCitectColour
Return Value
Related Functions
See Also
ClipCopy
Description
Syntax
Copies a string to the Windows clipboard. When the string is in the clipboard,
you can paste it to any Windows program.
ClipCopy(sText)
sText: . . . . . . . . . . . The string to copy to the clipboard.
Return Value
Related Functions
Example
See Also
Clipboard Functions
ClipPaste
Description
Syntax
Return Value
ClipReadLn
/* Get string from clipboard into sText. */
sText = ClipPaste();
See Also
Clipboard Functions
ClipReadLn
Description
Syntax
Return Value
Related Functions
Example
Reads a single line of text from the Windows clipboard. With this function, you
can read a block of text from the clipboard - line by line. Call the function once to
read each line of text from the clipboard. When the end of the clipboard is
reached, an empty string is returned.
ClipReadLn()
One line of text from the clipboard (as a string). If the clipboard is empty, an
empty string is returned.
ClipPaste
/* Get first line of text from clipboard. */
sText = ClipReadLn();
WHILE StrLength(sText) > 0 DO
! Do something with text
...
! Read next line of clipboard
sText = ClipReadLn();
END
See Also
Clipboard Functions
ClipSetMode
Description
Syntax
235
236
See Also
Clipboard Functions
ClipWriteLn
Description
Syntax
Writes a line of text to the Windows clipboard. With this function, you can write
any amount of text to the clipboard. Call this function once for each line of text.
To terminate the block of text, call this function and pass an empty string.
ClipWriteLn(sText)
sText: . . . . . . . . . . . The line of text to write to the clipboard, or an empty string
("") to end the write operation.
Return Value
Related Functions
Example
See Also
Clipboard Functions
ClusterGetName
Description
Syntax
Returns the names of the primary and standby cluster servers to which
CitectSCADA is currently connected (sPrimary and sStandby, as set using the
ClusterSetName function).
ClusterGetName(sPrimary, sStandby, nMode)
sPrimary: . . . . . . . . The variable containing the name of the clusters primary
server (i.e. that which was set as sPrimary using the
ClusterSetName() function).
See Also
Cluster Functions
ClusterSetName
Description
Syntax
237
238
See Also
Cluster Functions
CodeSetMode
Description
Syntax
Sets various execution modes for Cicode tasks in the current thread. Using this
function, you can specify whether to:
CodeSetMode(Type, Value)
Type: . . . . . . . . . . . . Type of mode:
0 - Write to a local image of an I/O Device. If you set Value to
1, this mode is enabled, and Cicode writes its local
memory image of the I/O Device whenever you write
239
240
Task Functions
CodeTrace
Description
Traces Cicode into the Kernel and the SYSLOG.DAT file. Use this function for
finding bugs in your Cicode. It will trace all functions called, the arguments to
those functions, and their return values. It will also trace any errors, writes to the
I/O Devices, and task state changes.
Warning! Use this function only during system development; it can cause
excessive loading on the CPU.
Syntax
CodeTrace(hTask, nMode)
hTask: . . . . . . . . . . . The Cicode task handle as returned from TaskHnd() function
or any of the following special values:
0 - Foreground Cicode.
-2 - The next created task.
-3 - All new created tasks.
See Also
Miscellaneous Functions
ComClose
Description
Closes a communication port. Any Cicode tasks that are waiting for a read or
write operation to complete (or that are retrying to read or write) return with a
range error. CitectSCADA automatically closes all communication ports at
shutdown.
This function can only be called from an I/O Server.
Syntax
ComClose(hPort)
hPort: . . . . . . . . . . . The communication port handle, returned from the
ComOpen() function. This handle identifies the table where
all data on the associated communication port is stored.
241
242
Related Functions
Example
See Also
0 if the port is successfully closed, or an error if the port is already closed or if the
port number is invalid.
ComOpen, ComRead, ComWrite
See ComOpen
Communication Functions
ComOpen
Description
Opens a communication port for access. The board and port must both be
defined in the database (using the Boards and Ports forms from the
Communication menu).
If you try to open the same COM port twice with ComOpen(), the second open
will fail and return -1. Do not open COM ports twice, and always check the
return value from ComOpen().
The communication system should be used for low speed communications only.
You should not use the communication functions to communicate with high
speed PLCs - the performance may not be adequate. If you need high speed
communication (for communicating with PLCs, etc.), you should write a
protocol driver. Refer to the CitectSCADA "Driver Development Kit".
This function can only be called from an I/O Server.
Syntax
ComOpen(sPort, iMode)
sPort: . . . . . . . . . . . The port name as specified in the Ports database.
iMode: . . . . . . . . . . . The mode of the open:
0 - Take control of the port from CitectSCADA. In this nonshared mode, you have complete access to the port CitectSCADA cannot use the port. Communication
will be restored when the port is closed.
1 - Share the port with CitectSCADA. In this mode, you can
write to the port, and CitectSCADA can also use it.
Note that ComRead will be unreliable if the
communication port is opened as shared.
Return Value
243
244
See Also
Communication Functions
ComRead
Description
Reads characters from a communication port. The characters are read from the
communication port into a string buffer. If no characters have arrived after the
specified timeout, the function returns with a timeout error. If the timeout is 0,
the function gets any characters that have arrived from the last call, and returns
immediately.
You use the iLength variable to specify the length of the buffer, or the maximum
number of characters to read when ComRead() is called. When ComRead()
returns, iLength is set to the actual number of characters read. Because iLength
is modified by this function, you must reset it before each call.
You should not treat the string buffer as a normal string - it has no string
terminator. Use the StrGetChar() function to extract characters from the buffer.
Do not call ComRead() while another ComRead() is still pending on the same
port, because it can produce unexpected results.
This function is a blocking function. It blocks the calling Cicode task until the
operation is complete. This function can only be called from an I/O Server.
Syntax
Return Value
Related Functions
Example
See Also
ComReset
Description
Syntax
Resets the communication port. This function can only be called from an I/O
Server.
ComReset(hPort)
hPort: . . . . . . . . . . . The communication port handle, returned from the
ComOpen() function. This handle identifies the table where
all data on the associated communication port is stored.
Return Value
Related Functions
Example
See Also
ComWrite
Description
Writes characters to a communication port. The characters are written from the
string buffer to the port. If the characters have not been transmitted after the
specified timeout, the function returns with a timeout error. If the timeout is 0,
the function returns immediately and the characters are transmitted in the
background.
245
246
Return Value
Related Functions
Example
See Also
Cos
Description
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
CreateControlObject
Description
Syntax
"MSCAL.Calendar.7" - Program ID
"{8E27C92B-1264-101C-8A2F-040224009C02}" - GUID
sName: . . . . . . . . . . The name for the object in the form of "AN" followed by its
AN number, eg. "AN35". This name is used to access the
object.
x1 - The x coordinate of the objects top left hand corner as it
will appear in your CitectSCADA window.
y1 - The y coordinate of the objects top left hand corner as it
will appear in your CitectSCADA window.
247
248
See Also
ActiveX Functions
CreateObject
Description
Creates a new instance of an ActiveX object. If you use this function to create an
ActiveX object, it will have no visual component (only the automation
component will be created).
If you assign an object created with the CreateObject() function to a local
variable, that object will remain in existence until the variable it is assigned to
goes out of scope. This means that such an object will only be released when the
Cicode function that created it ends.
If you assign an object created with the CreateObject() function to a module or
global scope variable, then that object will remain in existence until the variable
249
250
CreateObject(sClass)
sClass: . . . . . . . . . . . The class of the object. You can use the objects human
readable name, its program ID, or its GUID. If the class does
not exist, the function will fail.
For example:
Return Value
Related Functions
Example
"MSCAL.Calendar.7" - Program ID
"{8E27C92B-1264-101C-8A2F-040224009C02}" - GUID
See Also
ActiveX Functions
Date
Description
Syntax
Date(Format)
Format: . . . . . . . . . . The format required:
2 - Short date format, dd/mm/yy
3 - Long date format, day month year
9 - Extended date format, dd/mm/yyyy
If omitted, the default Format is 2. All of these formats follow the Regional
Settings found in the Windows Control Panel.
Return Value
Related Functions
Example
251
252
See Also
Time/Date Functions
DateAdd
Description
Syntax
Adds time (in seconds) to a time/date value. The return value is in time/date
variable format. Use this function for time and date calculations.
DateAdd(Time, AddTime)
Time: . . . . . . . . . . . . The time/date to which the AddTime will be added.
AddTime: . . . . . . . . The time to add, in seconds.
Return Value
Related Functions
Example
See Also
Time/Date Functions
DateDay
Description
DateDay(Time)
Time: . . . . . . . . . . . . The time/date variable.
Return Value
Related Functions
Example
See Also
Time/Date Functions
DateInfo
Description
Syntax
"0" - MMDDYY
"1" - DDMMYY
"2" - YYMMDD.
253
254
Current date order ("0" for MMDDYY, "1" for DDMMYY, "2" for YYMMDD;
See Also
TimeInfo
! If the current system date is the fourth of December 2002;
TwelfthMonth=DateInfo(9,12);
! Sets TwelfthMonth to "December".
Time/Date Functions
DateMonth
Description
Syntax
DateMonth(Time)
Time: . . . . . . . . . . . . The time/date variable.
Return Value
Related Functions
Example
See Also
Time/Date Functions
DateSub
Description
Syntax
Subtracts time (in seconds) from a time/date value. The return value is in time/
date variable format. Use this function for time and date calculations.
DateSub(Time, SubTime)
Time: . . . . . . . . . . . . The time/date from which the SubTime will be subtracted.
SubTime: . . . . . . . . The time to subtract, in seconds.
Return Value
Related Functions
Example
See Also
Time/Date Functions
255
256
DateWeekDay
Description
Syntax
DateWeekDay(Time)
Time: . . . . . . . . . . . . The time/date variable.
Return Value
Related Functions
Example
See Also
Date, TimeCurrent
! If the current system date is Sunday, 3rd November 1991;
Variable=DateWeekDay(TimeCurrent());
! Sets Variable to 1.
Time/Date Functions
DateYear
Description
Syntax
DateYear(Time, Mode)
Time: . . . . . . . . . . . . The time/date variable.
Mode: . . . . . . . . . . . The format required:
0 - Short year, yy. If you use this mode during the year 2000,
0 (zero) will be returned.
1 - Long year, yyyy
If omitted, the default Mode is 0.
Note: In the year 2000, 0 (zero) will be returned if mode 0 (zero) is used.
Return Value
Related Functions
Example
Date
! If the current system date is 3rd November 1991;
Variable=DateYear(TimeCurrent(),0);
! Sets Variable to 91.
! If the current system date is 18th October 2000;
Variable=DateYear(TimeCurrent(),0);
! Sets Variable to 0.
Variable=DateYear(TimeCurrent(),1);
! Sets Variable to 1991.
See Also
Time/Date Functions
DDEExec
Description
257
258
DDEExec(sApplication, sCommand)
sApplication: . . . . . Application name (.EXE filename), e.g. "WinWord".
sCommand: . . . . . . . The command that the application will execute.
Return Value
Related Functions
Example
See Also
DDE Functions
DDEhExecute
Description
Syntax
DDEhExecute(Handle, sCommand)
Handle: . . . . . . . . . . The integer handle that identifies the DDE conversation,
returned from the DDEhInitiate function.
sCommand: . . . . . . . The command that the application will execute.
Return Value
Example
See Also
DDE Functions
DDEhGetLastError
Description
Syntax
Gets the latest error code issued from Windows for the conversation identified
by the handle.
DDEhGetLastError(Handle)
Handle: . . . . . . . . . . The integer handle that identifies the DDE conversation,
returned from the DDEhInitiate function.
Return Value
The error code last issued from Windows DDEML (for that conversation):
DMLERR_ADVACKTIMEOUT
DMLERR_BUSY
DMLERR_DATAACKTIMEOUT
DMLERR_DLL_NOT_INITIALIZED
DMLERR_DLL_USAGE
DMLERR_EXECACKTIMEOUT
DMLERR_INVALIDPARAMETER
DMLERR_LOW_MEMORY
DMLERR_MEMORY_ERROR
DMLERR_NOTPROCESSED
DMLERR_NO_CONV_ESTABLISHED
DMLERR_POKEACKTIMEOUT
DMLERR_POSTMSG_FAILED
DMLERR_REENTRANCY
DMLERR_SERVER_DIED
DMLERR_SYS_ERROR
DMLERR_UNADVACKTIMEOUT
DMLERR_UNFOUND_QUEUE_ID
Related Functions
Example
See Also
0x4000
0x4001
0x4002
0x4003
0x4004
0x4005
0x4006
0x4007
0x4008
0x4009
0x400a
0x400b
0x400c
0x400d
0x400e
0x400f
0x4010
0x4011
DDE Functions
259
260
DDEhInitiate
Description
Syntax
Return Value
Related Functions
Example
AN integer handle for the conversation between CitectSCADA and the other
application, or -1 if the conversation is not started successfully. The handle is
used by the other DDEh... functions, to identify the conversation.
DDEhExecute, DDEhRequest, DDEhPoke, DDEhTerminate,
DDEhGetLastError
! Read from Excel spreadsheet
STRING FUNCTION GetExcelData();
INT hChannel;
STRING sData;
hChannel = DDEhInitiate("EXCEL", "DATA.XLS");
IF hChannel > -1 THEN
sData = DDEhRequest(hChannel, "R1C1");
DDEhTerminate(hChannel);
hChannel = -1;
END;
RETURN sData;
END
! Write to Excel spreadsheet
FUNCTION SetExcelData(STRING sData);
INT hChannel;
hChannel = DDEhInitiate("EXCEL", "DATA.XLS");
IF hChannel > -1 THEN
DDEhPoke(hChannel, "R1C1", sData);
DDEhTerminate(hChannel);
hChannel = -1;
END;
END
! Execute Excel Macro
FUNCTION DoExcelMacro();
INT hChannel;
hChannel = DDEhInitiate("EXCEL", "DATA.XLS");
IF hChannel > -1 THEN
DDEhExecute(hChannel, "[RUN(^"TestMacro^")]");
See Also
DDE Functions
DDEhPoke
Description
Syntax
Return Value
Related Functions
Example
See Also
DDE Functions
DDEhReadLn
Description
Reads a line of text from a DDE Conversion, e.g. from an Excel spreadsheet. You
must first start a conversation with the DDEhInitiate function, and use the
handle returned by that function to identify the conversation. This function
allows you to read a large amount of data via DDE. You should keep calling the
function until an empty string is returned.
261
262
DDEhReadLn(Handle, sTopic)
Handle: . . . . . . . . . . The integer handle that identifies the DDE conversation,
returned from the DDEhInitiate function.
sTopic: . . . . . . . . . . . A unique topic name for the item; for example, the variable
name, field name, or spreadsheet cell position.
Return Value
A line of data, or an empty string when all data has been read.
DDEhSetMode, DDEhWriteLn, DDEhInitiate, DDEhExecute,
DDEhRequest, DDEhTerminate, DDEhGetLastError
Example
See Also
See DDEhWriteLn
DDE Functions
DDEhRequest
Description
Syntax
DDEhRequest(Handle, sItem)
Handle: . . . . . . . . . . The integer handle that identifies the DDE conversation,
returned from the DDEhInitiate function.
sItem: . . . . . . . . . . . A unique name for the item; for example, the variable name,
field name, or spreadsheet cell position.
Return Value
Related Functions
Example
See Also
DDEhSetMode
Description
Syntax
Set the mode of the DDE conversation. The default mode of a DDE conversation
is to use TEXT data format - a simple string of data. This function allows you to
set the mode to CSV (Comma Separated Values). Some Windows applications
support this mode of data as it helps them to separate the data. For example,
when you send CSV format to Excel, each value will be placed into a unique cell.
If you use TEXT mode all the data will be placed into the same cell.
DDEhSetMode(Handle, sMode)
Handle . . . . . . . . . . . The integer handle that identifies the DDE conversation,
returned from the DDEhInitiate function.
sMode . . . . . . . . . . . The mode of the DDE conversation:
1 - Text (default)
2 - CSV
Return Value
Related Functions
Example
See Also
DDEhTerminate
Description
Closes the conversation identified by the handle, and frees the resources
associated with that conversation. After you call this function, the handle is no
longer valid and must not be used.
With Network DDE, you might need to terminate and re-initiate a conversation.
For example, if you delete rows on an MS Access sheet, the deleted rows display
as #DELETED until you terminate and re-initiate the conversation.
Syntax
DDEhTerminate(Handle)
Handle: . . . . . . . . . . The integer handle that identifies the DDE conversation,
returned from the DDEhInitiate function.
Return Value
263
264
Example
See Also
DDEhWriteLn
Description
Syntax
Writes a line of text to the DDE conversation. With this function, you can write
any amount of text to the DDE conversation. Call this function once for each line
of text. To terminate the block of text, call this function and pass an empty string.
DDEhWriteLn(Handle, sTopic, sData)
Handle: . . . . . . . . . . The integer handle that identifies the DDE conversation,
returned from the DDEhInitiate function.
sTopic: . . . . . . . . . . . A unique name for the topic the data will be written to; for
example, the spreadsheet cell position. The topic is only used
when you complete the write by passing an empty string for
data.
sData: . . . . . . . . . . . The line of data to write. To terminate the data and make
CitectSCADA send the data, set the data to an empty string.
Return Value
Related Functions
Example
See Also
DDE Functions
DDEPost
Description
Makes a CitectSCADA variable value available for DDE linking (i.e. posts a DDE
link so that it can be read by other DDE compliant applications running on the
same computer). This sets-up CitectSCADA to behave as a DDE Server for this
DDE channel.
After a value is posted, other Windows applications running on the same
computer can read the value by using their own DDE Client functions. If the
value of the posted variable changes, any linked applications are informed of the
new value.
To link to this value from any DDE Client applications running on the same
computer, they must appropriately use the DDE Client syntax with:
The name used for the first parameter sItem in this DDEPost() function as
the <DDE data item name>.
Unlike the DDERead() and DDEWrite() Cicode functions which are static, the
DDEPost() function can be used to create a dynamic DDE link, providing the
DDE Client applications appropriately set their side of the DDE channel to be
automatically updated.
Syntax
DDEPost(sItem, sValue)
sItem: . . . . . . . . . . . A unique name for the item; for example, the variable name,
field name, or spreadsheet cell position.
sValue: . . . . . . . . . . The value of the item.
Return Value
Related Functions
Example
265
266
See Also
DDE Functions
DDERead
Description
Syntax
Return Value
Related Functions
Example
The value (from the external application) as a string, or an empty string if the
function fails.
DDEExec, DDEPost, DDEWrite
/* Read the value from R1C1 (Row1,Column1) of an Excel spreadsheet
named "Sheet1". */
DDERead("Excel","Sheet1","R1C1");
/* Read the value from the Item1 bookmark of the Word document
named "Recipes.doc". */
See Also
DDE Functions
DDEWrite
Description
Syntax
Return Value
Related Functions
Example
The value that is sent to the other application, or an empty string if the function
fails.
DDEExec, DDEPost, DDERead
/* Write the value of a CitectSCADA variable named TAGONE to R1C1
(Row1,Column1) of an Excel spreadsheet named "Sheet1". The value
is in string format. */
DDEWrite("Excel","Sheet1","R1C1",TAGONE);
See Also
DDE Functions
DebugBreak
Description
Syntax
Causes a breakpoint exception error to occur (error number 342). This allows
programmers to trap invalid states in their Cicode. If the Cicode Editor is not
running, and the Citect will start debugger on hardware errors option is set
(Debug menu - Options), the Debugger will be started. When the debugger
starts, the correct Cicode file, function, and line will be displayed.
DebugBreak()
267
268
See Also
None.
DspKernel, KerCmd, DumpKernel, TraceMsg
!Check to see that rSpan is greater than zero else cause a break.
If rSpan equals 0 it would cause a Divide by Zero hardware error
anyway.
IF rSpan > 0 THEN
rCalcRate = iAmount/rSpan;
ELSE
DebugBreak();
END
Miscellaneous Functions
DebugMsg
Description
Syntax
Provides in-line debug messages of user Cicode, to the Kernel, Debugger Debug
window, and the SysLog.DAT file. This function can be enabled or disabled with
the [Code]DebugMessage parameter or DebugMsgSet() function at runtime.
DebugMsg(sMessage)
sMessage: . . . . . . . . The debugging message to log. Be sure to enclose this
message in double quotes (" ").
Return Value
Related Functions
Example
None.
Assert, DebugMsgSet, CodeTrace, TraceMsg, ErrLog
INT
FUNCTION
FileDisplayEx(STRING sFileName);
INT hFile;
hFile = FileOpen(sFileName, "r");
DebugMsg("When opening file " + sFileName + ", the handle was: "
+ IntToStr(hFile));
.
.
.
FileClose(hFile);
RETURN 0;
END
See Also
Miscellaneous Functions
DebugMsgSet
Description
Syntax
Return Value
Related Functions
Example
Buttons
Text
Command
Comment
See Also
Debug Enable
DebugMsgSet(1)
Enable debug logging
Miscellaneous Functions
DelayShutdown
Description
Syntax
Return Value
Related Functions
Example
No return value.
CtOpen, CtClose, CtCicode
DelayShutdown(10 000)
!Terminates CitectSCADA's operation after 10 seconds
269
270
Miscellaneous Functions
DegToRad
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
DevAppend
Description
Appends a blank record to the end of a device. After the record is appended, you
can use the DevSetField() function to add data to fields in the record.
You must first call the DevOpen() function to get the device handle (hDev).
Syntax
DevAppend(hDev)
hDev: . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
Return Value
Related Functions
Example
Device Functions
DevClose
Description
Syntax
Closes a device. Any data in the buffer is flushed to the device before it is closed.
After a device is closed, its device handle becomes invalid and cannot be used.
DevClose(hDev)
hDev: . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
Return Value
Related Functions
Example
DevClose(hDev);
See Also
Device Functions
DevControl
Description
Syntax
Controls a dBASE or SQL device. You can pack a dBASE device to physically
remove deleted records, or re-index a dBASE device to regenerate the keys. You
can issue queries to an SQL device, or get the error status of the last SQL query.
DevControl(hDev, Type, sData)
hDev: . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
Type: . . . . . . . . . . . . The type of command:
0
271
272
Device Functions
DevCurr
Description
Gets the current device handle. You can only call this function in a report, to get
the handle of the device where the report is logging. You can then use the other
device functions (e.g. DevPrint()) to access that logging device. (To get the
handle of a device other than a logging device, you must use the DevOpen()
function.)
If the report is logging to a group of devices, this function will return the group
handle. However, not all device functions support group handles, e.g. you
cannot read from a group of devices.
Syntax
Return Value
Related Functions
Example
See Also
DevCurr()
The current device handle or group handle. If no device is configured, -1 is
returned.
DevOpen, DevPrint
! Get the report device number.
hDev=DevCurr();
Device Functions
DevDelete
Description
Syntax
Deletes the current record in a dBASE database device. The record is not
physically deleted, but is marked for deletion. You can physically delete the
record by packing the database with the DevControl() function.
DevDelete(hDev)
Device Functions
DevDisable
Description
Disables (and re-enables) a device from all access, and discards any data written
to the device. When a device is disabled, it cannot be opened, and data cannot be
read from the device. Use this function to disable logging to a database or
printer.
The State argument is a toggle. A State of 1 disables the device(s), but you can
then re-enable the device(s) by repeating the function with State = 0.
Syntax
DevDisable(sName, State)
sName: . . . . . . . . . . The device name, or
Return Value
Related Functions
Example
See Also
Device Functions
273
274
DevEOF
Description
Syntax
Gets the status of the end of file (EOF) flag for a device. When you use the
DevPrev(), DevNext(), or DevSeek() function, the start or end of the device will
eventually be reached, and the EOF flag will be set. Use this function to test the
EOF flag.
DevEOF(hDev)
hDev: . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
Return Value
Related Functions
Example
See Also
Device Functions
DevFind
Description
Syntax
Searches a device for a record that contains specified data in a specified field.
The search starts at the current record and continues forward until the matched
data is found or the end of the database is reached. If the file has a keyed index,
an indexed search is used.
DevFind(hDev, sFind, sField)
hDev: . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
sFind: . . . . . . . . . . . The data to find in sField, as a string.
For SQL devices: The DevFind() function can distinguish
between numbers, strings, and dates, so you do not need to
enclose the data in quote marks. Dates and times must be in
the correct format:
Date: YYYY-MM-DD
Time: HH:MM:SS
See Also
Device Functions
DevFirst
Description
Syntax
Return Value
Related Functions
Example
See Also
The first indexed record (if the device is an indexed database), otherwise the first
record in the device.
DevOpen, DevClose
! Find the first record.
FirstRec = DevFirst(hDev);
Device Functions
275
276
DevFlush
Description
Syntax
Return Value
Related Functions
Example
See Also
Device Functions
DevGetField
Description
Syntax
Return Value
Related Functions
Example
The field data (as a string). If the field is not found an empty string is returned.
DevOpen, DevSetField
INT
FUNCTION
GetRecipe(STRING sName)
INT hDev;
hDev = DevOpen("Recipe", 0);
IF hDev >= 0 THEN
DevSeek(hDev, 1);
See Also
Device Functions
DevHistory
Description
Renames a device file and any subsequent history files. The current device is
closed and renamed as the first history file. For example, the device file
'Templog.txt' is renamed as 'Templog.001'. If a history file 'Templog.001' already
exists, it is renamed as 'Templog.002', and so on. The next time data is written to
the device, a new device file is created.
Note that if the device file has not been created (i.e. data has not been written to
the device), only existing history files are renamed. Use this function for direct
control of the device history process.
Syntax
DevHistory(hDev)
hDev: . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
Return Value
Related Functions
DevOpen, DevControl
Example
See Also
Device Functions
277
278
DevInfo
Description
Syntax
Related Functions
Example
See Also
Device Functions
DevModify
Description
Modifies the attributes of a device. The device must be closed before you can
modify a device.
This function allows you to dynamically change the file name or other attributes
of a device at run time. You can use a single device to access many files. For
example, you can create a device called Temp with a file name of TEMP.DBF.
Using this function you could dynamically change the file name to access any
dBASE file.
This function is useful in conjunction with the FormOpenFile() or
FormSaveAsFile() functions. (These functions allow the operator to select file
names easily.)
When using this function, you should be careful that no other Cicode function is
already using the same device. Always check the return value of this function
before opening the device or you will destroy the data in the device to which it is
already attached. Use a semaphore to protect your Cicode.
Syntax
279
280
existing filename.
Type: . . . . . . . . . . . . A new device type:
Device Type
Device
ASCII_DEV
PRINTER_DEV
dBASE_DEV
SQL_DEV
ASCII file
Printer
dBASE file
SQL database
Example
See Also
Device Functions
DevNext
Description
Syntax
Gets the next record in a device. If the end of the database is reached, the EOF
flag is set and an error code is returned.
DevNext(hDev)
hDev . . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
Return Value
0 if the next record is read, or an error if the end of the database is reached.
See Also
DevEOF, DevPrev
Status=0;
I = 0;
hDev = DevOpen("Log", 0);
WHILE Status = 0 DO
DspText(20 + I, 0, DevGetField(hDev,"Tag"));
I = I + 1;
Status = DevNext(hDev);
END
DevClose(hDev);
Device Functions
DevOpen
Description
Opens a device and returns the device handle. The device must be defined in the
CitectSCADA database. If the device cannot be opened, and user error checking
is not enabled, the current Cicode task is halted.
You can use this function to return the handle of a device that is already open.
The DevOpen() function does not physically open another device - it returns the
same device handle as when the device was opened. The mode of the second
open call is ignored. To re-open an open device in a different mode, you must
first close the device and then re-open it in the new mode.
When using an ODBC driver to connect to an SQL server or database, experience
has shown that connecting only once (not closing the device) yields the best
performance. ODBC connection is slow and if used on demand may affect your
system's performance. Also some ODBC drivers leak memory on each
connection and may crash your computer after a number of re-connects.
Note: If you are opening a database device in indexed mode (nMode=2), an
index file will automatically be created by CitectSCADA if one does not already
exsist. If you feel a device index has become corrupt, delete the existing index
file and a new one will be created the next time the DevOpen function is run.
Syntax
DevOpen(Name, nMode)
Name: . . . . . . . . . . . The name of the device.
nMode: . . . . . . . . . . The mode of the open:
0 - Open the device in shared mode - the default mode when
opening a device.
1 - Open the device in exclusive mode. In this mode only one
user can have the device open. The open will fail if
281
282
Related Functions
Example
The device handle. If the device cannot be opened, -1 is returned. The device
handle identifies the table where all data on the associated device is stored.
DevClose
INT
FUNCTION
PrintRecipe(STRING sCategory)
STRING sRecipe;
INT hRecipe, hPrinter;
ErrSet(1); ! enable user error checking
hRecipe = DevOpen("Recipe", 0);
IF hRecipe = -1 THEN
DspError("Cannot open recipe");
RETURN FALSE;
END
hPrinter = DevOpen("Printer1", 0);
IF hPrinter = -1 THEN
DspError("Cannot open printer");
RETURN FALSE;
END
ErrSet(0); ! disable user error checking
WHILE NOT DevEof(hRecipe) DO
sRecipe = DevReadLn(hRecipe);
DevWriteLn(hPrinter, sRecipe);
END
DevClose(hRecipe);
See Also
Device Functions
DevPrev
Description
Syntax
Gets the previous record in a device. If the start of the database is reached, the
EOF flag is set and an error code is returned.
DevPrev(hDev)
hDev: . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
Return Value
Related Functions
Example
See Also
Device Functions
DevPrint
Description
Syntax
Prints free-format data to groups of devices. Using this function, you can write
data to many devices at the same time. You would normally use this function in
a report.
DevPrint(hGrp, sData, NewLine)
hGrp: . . . . . . . . . . . The device handle, or the group handle for a group of
devices.
283
284
See Also
Device Functions
DevRead
Description
Syntax
Reads characters from a device. If the device is record-based, the current field is
read. If the device is free-format, the specified number of characters is read. If
the number of characters specified is greater than the number of characters
remaining in the device, only the remaining characters are read.
DevRead(hDev, Length)
hDev: . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
Length: . . . . . . . . . . The number of characters to read.
Return Value
Related Functions
Example
See Also
The data (in string format). If the end of the device is found, an empty string is
returned.
DevOpen, DevReadLn, DevFind
! Read 20 characters from a device.
Str=DevRead(hDev,20);
Device Functions
DevReadLn
Description
Syntax
Reads data from the current record of a device until the end of the line, or end of
the record. If the device is record-based, the record number is incremented. The
carriage return and newline characters are not returned.
DevReadLn(hDev)
hDev: . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
Return Value
Related Functions
Example
See Also
The data (in string format). If the end of the device is found, an empty string is
returned and the EOF flag is set.
DevOpen, DevRead, DevEOF, DevFind
Str=DevReadLn(hDev);
Device Functions
DevRecNo
Description
Syntax
Gets the current record number of a device. If the device is record-based, the
record number ranges from 1 to the maximum size of the file. If the device is
free-format, the record number ranges from 0 to the maximum byte size -1.
DevRecNo(hDev)
hDev: . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
Return Value
Related Functions
Example
See Also
The record number. If an error occurs getting the record number, -1 is returned.
DevOpen, DevSeek
! Get the current record number.
Rec=DevRecNo(hDev);
Device Functions
285
286
DevSeek
Description
Syntax
Moves the device pointer to a specified position in the device. If the device is a
database, and it is opened in indexed mode, DevSeek will seek to the record
number - not through the index. To locate the first record in an indexed device,
call the DevFirst() function.
DevSeek(hDev, Offset)
hDev: . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
Offset: . . . . . . . . . . . The offset in the device. If the device is a database device, the
offset is the record number. If the device is a binary device,
the offset is in bytes (from 0 to the maximum file size -1).
Return Value
Related Functions
Example
See Also
Device Functions
DevSetField
Description
Syntax
Return Value
See Also
Device Functions
DevSize
Description
Syntax
Return Value
Related Functions
Example
See Also
If the device is a database device, the number of records is returned. If the device
is a binary device, the number of bytes in the file is returned. If an error occurs, 1 is returned.
DevRecNo, DevSeek
INT NoRec;
NoRec=DevSize(hDev);
! Seek to the last record.
DevSeek(hDev,NoRec);
Device Functions
DevWrite
Description
Writes a string to a device. If the device is free-format, the data is written to the
device as specified. If the device is record-based, the data is written to the
current field, and the field pointer is moved to the next field.
DevWrite(hDev, sData)
287
288
For SQL devices: The DevWrite() function can distinguish between numbers,
strings, and dates, so you do not need to enclose the data in quote marks. Dates
and times must be in the correct format:
See Also
Date: YYYY-MM-DD
Time: HH:MM:SS
Device Functions
DevWriteLn
Description
Syntax
Writes a string to a device. If the device is free-format, the data is written to the
device, followed by a newline character. If the device is record-based, a new
record is appended to the device and the data is written to this record. The
record pointer is then moved to the next record.
DevWriteLn(hDev, sData)
hDev: . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
sData: . . . . . . . . . . . The data to write, as a string.
Return Value
Related Functions
Example
See Also
Device Functions
DevZap
Description
Syntax
Zaps a device. If a database device is zapped, all records are deleted. If an ASCII
file is zapped, the file is truncated to 0 (zero) length. Use this function when you
want to delete all records in a database or file without deleting the actual file.
DevZap(hDev)
hDev: . . . . . . . . . . . The device handle, returned from the DevOpen() function.
The device handle identifies the table where all data on the
associated device is stored.
Return Value
Related Functions
Example
See Also
Device Functions
DLLCall
Description
Syntax
DLLCall(hFunction, sArgs)
hFunction: . . . . . . . The DLL function handle, returned from DLLOpen().
sArgs: . . . . . . . . . . . The string of arguments to pass to the DLL function. The
argument string contains all the arguments for the function,
separated by commas (,). Enclose string arguments in quote
marks "", and use the string escape character (^) to put a
289
290
Example
See DLLOpen
See Also
DLL Functions
DLLClose
Description
Syntax
Closes the link to a DLL function, and frees the memory allocated for that
function link. When the link is closed, you cannot call the function.
CitectSCADA automatically closes all function links at shutdown.
DLLClose(hFunction)
hFunction: . . . . . . . The DLL function handle, returned from DLLOpen().
Return Value
Related Functions
Example
See DLLOpen
See Also
DLL Functions
DLLOpen
Description
Opens a link to a DLL function, by loading the specified DLL library into
memory and attaching it to the named function. After you open the function
link, you can call the function with the DLLCall() function. You pass the function
number returned from the DLLOpen() function as an argument in the DLLCall()
function.
The best method of interfacing with a DLL function is to write a Cicode function
file. This file contains the DLLOpen() function to initialize the functions, and one
Cicode function for each DLL function, as an interface. In this way, you can hide
the DLL interface in this file. Any other Cicode function will call the Cicode
interface, and the call to the DLL remains transparent.
Note that DLL's must be on the path. The file extension is not required.
Return Value
Related Functions
Example
The DLL function handle, or -1 if the library or function could not be found or
loaded.
DLLCall, DLLClose
/* This function is called when CitectSCADA starts up, to
initialize all the DLLs that are called */
INT hAnsiUpper;
INT hGlobalAlloc;
FUNCTION
InitMyDLLs()
! Open DLL to AnsiUpper
hAnsiUpper = DLLOpen("USER.DLL", "AnsiUpper", "CC");
hGlobalAlloc = DLLOpen("Kernel", "GlobalAlloc", "IIJ");
END
291
292
See Also
DLL Functions
DriverInfo
Description
Syntax
Provides information about the driver for a specified I/O Device. Select the
device using the IODevice argument, and the information to be returned using
the Type argument.
DriverInfo(IODevice, Type)
IODevice: . . . . . . . . The number or name of the I/O Device. If you call this
function from an I/O server, you can use the I/O Device
name. If you call this function from a client, you may use
either the I/O Device number or name. To specify all I/O
Devices, use "*" (asterisk) or -1.
Type: . . . . . . . . . . . . The type of information returned about the driver. Specify
one of the following:
0 - Driver Name
1 - Driver Title
2 - Block constant
The driver information as a string. It is important to note that this function does
not currently return an error if it is used incorrectly.
Example
See Also
DspAnCreateControlOb
ject
Description
Creates a new instance of an ActiveX object. If the object already exists for the
given Animation Point Number, then that object will be used, i.e. a new object
will not be created, the existing object will merely be refreshed.
AN object created using this function remains in existence until the page is
closed or the associated Cicode Object is deleted.
Syntax
293
294
"MSCAL.Calendar.7" - Program ID
"{8E27C92B-1264-101C-8A2F-040224009C02}" - GUID
sEventClass: . . . . . . The string you would like to use as the event class for the
object.
Width: . . . . . . . . . . . The width of the ActiveX object.
Height: . . . . . . . . . . The height of the ActiveX object.
Return Value
Related Functions
Example
See Also
DspAnFree
Description
Note: This function is only used for V3.xx and V4.xx animations, and will be
superseded in future releases.
Frees (removes) an AN from the current page. If an animation exists at the
animation number, it is deleted before the AN is freed. Use this function to free
existing ANs or ANs created with the DspAnNew() function. Note that the ANs
are only freed in memory - the change is not permanent.
Syntax
DspAnFree(AN)
AN: . . . . . . . . . . . . . The animation-point number.
Return Value
Related Functions
Example
See Also
Display Functions
DspAnGetArea
Description
DspAnGetArea(AN)
AN: . . . . . . . . . . . . . The animation-point number.
Return Value
Related Functions
Example
See Also
Display Functions
DspAnGetPDos
Description
Syntax
Gets the x and y coordinates of an AN, in pixels, relative to the top-left corner of
the window.
DspAnGetPos(AN, X, Y)
AN: . . . . . . . . . . . . . The animation-point number.
X, Y: . . . . . . . . . . . . The variables used to store the x and y pixel coordinates of
the AN, returned from this function.
Return Value
Related Functions
Example
See Also
Display Functions
295
296
DspAnGetPrivilege
Description
Syntax
DspAnGetPrivilege(AN)
AN: . . . . . . . . . . . . . The animation-point number.
Return Value
Related Functions
Example
See Also
Display Functions
DspAnInfo
Description
Note: This function is only used for V3.xx and V4.xx animations, and has been
superseded by future releases.
Gets information on an AN - the type or state of the animation that is currently
displayed.
Syntax
DspAnInfo(AN, Type)
AN: . . . . . . . . . . . . . The animation-point number.
Type: . . . . . . . . . . . . The type of information:
0 - The type of animation currently displayed at the AN. The
following is returned:
0 - No animation is displayed.
1 - Color is displayed.
2 - A bar graph is displayed.
3 - Text is displayed.
4 - A symbol is displayed.
See Also
Display Functions
DspAnInRgn
Description
Syntax
Return Value
Example
See Also
Display Functions
297
298
DspAnMove
Description
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded by future releases.
Moves an AN to a new position. Any animation at this AN is also moved.
Syntax
DspAnMove(AN, X, Y)
AN: . . . . . . . . . . . . . The animation-point number.
X: . . . . . . . . . . . . . . The x pixel coordinates of the new position.
Y: . . . . . . . . . . . . . . The y pixel coordinates of the new position.
Return Value
Related Functions
Example
See Also
Display Functions
DspAnMoveRel
Description
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded by future releases.
Moves an AN relative to its current position. Any animation at this AN is also
moved.
Syntax
DspAnMoveRel(AN, X, Y)
AN: . . . . . . . . . . . . . The animation-point number.
X: . . . . . . . . . . . . . . The number of pixels to move the AN in the x plane.
Y: . . . . . . . . . . . . . . The number of pixels to move the AN in the y plane.
Return Value
Related Functions
Example
See Also
Display Functions
DspAnNew
Description
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Creates an AN at the specified x and y coordinates.
Syntax
DspAnNew(X, Y)
X: . . . . . . . . . . . . . . The x pixel coordinate where the new AN is created.
Y: . . . . . . . . . . . . . . The y pixel coordinate where the new AN is created.
Return Value
Related Functions
Example
See Also
Display Functions
DspAnNewRel
Description
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Creates an AN at a distance of x,y pixels from a specified AN.
Syntax
DspAnNewRel(AN, X, Y)
AN: . . . . . . . . . . . . . The AN used as a reference for the new AN.
X: . . . . . . . . . . . . . . The distance in the x plane (in pixels) from the reference AN
to the new AN.
Y: . . . . . . . . . . . . . . The distance in the y plane (in pixels) from the reference AN
to the new AN.
Return Value
Related Functions
299
300
AN=DspAnNewRel(20,100,200);
/* Creates an AN at 100x and 200y pixels from AN20 */
Display Functions
DspBar
Description
Displays a bar graph (on a graphics page) at a specified AN. To scale a tag into
the correct range, use the EngToGeneric() function.
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Syntax
Return Value
Related Functions
Example
See Also
Display Functions
DspBmp
Description
Displays a bitmap at a specified AN. This function allows you to display any
bitmap file at run time. (You can get a new bitmap file from operator input or
from the plant, and display it dynamically.)
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Syntax
Return Value
Related Functions
Example
See Also
Display Functions
DspButton
Description
Displays a button at a specified AN. When the button is selected, the key
definition is put into the key command line. The font, width, height, and down
and repeat keys of the button are optional. If you do not specify a width and
height, the button adjusts to the size of the button Name.
301
302
Return Value
Related Functions
Example
See Also
Display Functions
DspButtonFn
Description
Displays a button at a specified AN. When the button is selected, a user function
is called. If the width and height are 0 (zero), then the button adjusts to the size
of the button Name.
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Syntax
303
304
See Also
Display Functions
DspChart
Description
Displays a chart at an AN. Charts are trend lines with markers on them. Values
are plotted on the chart pens. You must specify Value1, but Value2 to Value8 are
optional.
If more values (than the configured pens) are specified, the additional values are
ignored. If fewer values (than the configured pens) are specified, the pens that
have no values are not displayed.
You should use this function only if you want to control the display of charts
directly.
Syntax
See Also
Display Functions
DspCol
Description
Note: With the release of Version 6, color floods are no longer supported. Calls
to this function are ignored.
Displays a color at a specified AN. The color is flooded from the AN until it
finds a boundary.
Syntax
DspCol(AN, Colour)
AN: . . . . . . . . . . . . . The animation-point number.
Colour: . . . . . . . . . . The color to display at the AN.
Return Value
Related Functions
Example
See Also
Display Functions
DspDel
Description
Syntax
DspDel(AN)
305
306
Display Functions
DspDelayRenderBegin
Description
Syntax
Related Functions
Example
DspDelayRenderBegin()
DspDelayRenderEnd
/* Begin delay so the following code can be executed before the
images are re-drawn. */
DspDelayRenderBegin();
DspBMP(50, "Image1.bmp", 0) ! Display the bitmap "Image1.bmp"
at AN 50
DspBMP(100, "Image2.bmp", 0) ! Display the bitmap "Image2.bmp"
at AN 100
DspBMP(150, "Image3.bmp", 0) ! Display the bitmap "Image3.bmp"
See Also
Display Functions
DspDelayRenderEnd
Description
Syntax
Return Value
Related Functions
Example
DspDelayRenderEnd()
No value is returned.
DspDelayRenderBegin
/* Begin delay so the following code can be executed before the
images are re-drawn. */
DspDelayRenderBegin();
DspBMP(50, "Image1.bmp", 0) ! Display the bitmap "Image1.bmp"
at AN 50
DspBMP(100, "Image2.bmp", 0) ! Display the bitmap "Image2.bmp"
at AN 100
DspBMP(150, "Image3.bmp", 0) ! Display the bitmap "Image3.bmp"
at AN 150
DspBMP(200, "Image4.bmp", 0) ! Display the bitmap "Image4.bmp"
307
308
See Also
Display Functions
DspDirty
Description
Forces Citect to update an AN. Normally, Citect updates the animation on the
AN only if the data has changed. This function tells Citect to update the AN the
next time it animates the AN - even if the data has not changed.
Use this function when you have complex animations that overlap. If two or
more animations overlap, you should use the DspDel() or DspDirty() function
on their ANs, and then display them in the same order (when they need to be
updated).
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Syntax
DspDirty(AN)
AN: . . . . . . . . . . . . . The animation-point number.
Return Value
Related Functions
Example
See Also
Display Functions
DspError
Description
Syntax
Display Functions
DspFile
Description
Defines the screen attributes for displaying a text file. This function defines a
"window" where the file will be displayed. You should call this function before
any file-to-screen function.
You must define sequential ANs for each line of text in the display. The file is
displayed starting at the specified AN, then the next (highest) AN, and so on.
You should not use proportionally-spaced fonts, because the columns of text
might not be aligned.
You would normally call this function as the entry function for a graphics page.
Use the DspFileSetName() function to specify the file to be displayed. This
function is a low level animation function - it controls exactly how the file is to
display. If you just want to display a file, use the PageFile() function.
Syntax
Return Value
Related Functions
Example
309
310
See Also
Display Functions
DspFileGetInfo
Description
Syntax
Gets the attributes of a file-to-screen display (used for displaying text files).
DspFileGetInfo(AN, Type)
AN: . . . . . . . . . . . . . The AN where the file display window will be located. This
AN must be the same as the AN specified with the DspFile()
function.
Type: . . . . . . . . . . . . The type of data required:
0 - The width of the file display window, in characters.
1 - The maximum number of lines that can display in one
page of the file display window.
2 - The file-to-screen row offset number.
3 - The file-to-screen column offset number.
4 - The number of lines in the displayed file.
Return Value
Related Functions
Example
See Also
Display Functions
DspFileGetName
Description
Syntax
Gets the name of the file being displayed in the display "window". You can use
this function to display the file name on the screen.
DspFileGetName(AN)
Related Functions
Example
See Also
Display Functions
DspFileScroll
Description
Syntax
Return Value
Related Functions
Example
Page Keyboard
Key Sequence
Command
Comment
See Also
Display Functions
PgUp
DspFileScroll(20,3,10)
Scroll up 10 lines
311
312
DspFileSetName
Description
Syntax
Sets the name of the file to display in the display "window". You should call the
DspFile() function first (as the entry function for a graphics page) to define the
attributes of the display. You can then use the DspFileSetName() function (as a
keyboard command) to display a user-specified file. When you call this function,
the specified file name is read from disk and displayed on the screen.
DspFileSetName(AN, sName)
AN: . . . . . . . . . . . . . The animation-point number.
sName: . . . . . . . . . . The name of the file to display.
Return Value
Related Functions
Example
Pages
Page Name
Entry Command
Comment
FilePage
DspFile(20,0,20,80)
Defines a file to screen display to commence at
AN20
Page Keyboard
Key Sequence
Command
Comment
######## Enter
DspFileSetName(20, Arg1)
Displays a specified file on the page
DspFile(20,0,20,80);
/* Defines the file-to-screen display to commence at AN20 using
the default font, with a window size of 20 lines x 80 columns. */
DspFileSetName(20,"C:\AUTOEXEC.BAT");
! Displays file C:\AUTOEXEC.BAT.
See Also
Display Functions
DspFont
Description
Creates a font and returns a font handle. If the requested font already exists, its
font handle is returned. You can use this font handle in the functions that
display text, buttons, and text files.
If the exact font size does not exist, the closest font size is used.
Return Value
Related Functions
Example
The font handle as an integer. If the font cannot be created, -1 is returned. The
font handle identifies the table where all data on the associated font is stored.
DspFontHnd, DspText, DspButton, DspButtonFn, DspFile
Font=DspFont("Helv",-12,"White","Red");
DspText(20,Font,"Text in Helv Font");
/* Displays "Text in Helv Font" in 12-point Helvetica font in
white on red at AN20. */
Font=DspFont("Helv",24,"White","Red","White");
DspText(20,Font,"Text in Helv Font");
313
314
See Also
Display Functions
DspFontHnd
Description
Gets the font handle of a font that is defined in the Fonts database. You can use
this font handle in the functions that display text, buttons, and text files.
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Syntax
DspFontHnd(Name)
Name: . . . . . . . . . . . The font name in the fonts database.
Return Value
Related Functions
The font handle as an integer. If the font cannot be found, -1 is returned. The font
handle identifies the table where all data on the associated font is stored.
DspFont, DspText, DspButton, DspButtonFn, DspFile
Example
Fonts
Font Name
BigFont
Font Type
Pixel Size
Foreground Color
Background Color
Comment
Helv
24
Blue
-1
Defines a font
hBigFont=DspFontHnd("BigFont");
DspText(20,hBigFont,"Text in Big Font");
/* Displays "Text in Big Font" in 24-point Helvetica font in blue
on an unchanged background at AN20. */
See Also
Display Functions
DspFullScreen
Description
Disables or enables the full screen mode of the currently active window. This
function does not resize the window when it is called; it merely sets the mode
flag. The next time the window is displayed, its size (on screen) changes to
reflect the setting of the flag. This function overrides the [Animator]FullScreen
parameter setting.
If [Page]DynamicSizing is turned on, a page in full screen state takes up the
entire display area (assuming this does not affect its aspect ratio), and it cannot
be resized. Also, a full screen page will display without a title bar unless Title
Bar is checked in Page Properties (or was checked when the page was created).
Resizing pages can result in degraded picture quality. If this is unacceptable, you
should re-design the page using the desired resolution.
If [Page]DynamicSizing is turned off, full screen will have the same limitations
as it had in versions of Citect prior to V5.10. In other words, for a page to be
displayed in full screen, the size of the page must be the same size as the display
(or bigger). If the page is smaller than the display, the title bar will still display
even if full screen mode is enabled. Check the size of the graphic pages in
CtDraw Tools|Page Attributes Dialog to make sure that it is the same as the
display resolution. For example 640x480 for VGA, 600x800 for SVGA and
1024x768 for XGA.
Syntax
DspFullScreen(Mode)
Mode: . . . . . . . . . . . Full screen mode:
0 - Disable full screen mode.
1 - Enable full screen mode.
Return Value
Related Functions
Example
See Also
Display Functions
315
316
DspGetAnBottom
Description
Syntax
Return Value
Related Functions
Example
See Also
The y coordinate of the bottom extent of the object at the AN. If no object exists
at the AN, -1 is returned.
DspGetAnBottom, DspGetAnWidth, DspGetAnHeight,
DspGetAnLeft, DspGetAnRight, DspGetAnTop, DspGetAnNext,
DspGetAnExtent
nBottom = DspGetAnBottom(30);
Display Functions
DspGetAnCur
Description
Gets the number of the current graphics AN. You should only call this function
from the database, by using one of the Page forms (for example, the Page
Number, Page String, and Page Trend forms). This function is useful for writing
general functions and macros that apply to graphics pages.
You cannot call this function from the Button or Keyboard forms.
Syntax
Return Value
DspGetAnCur()
The AN associated with the current record in the associated Page database. If
this function is called outside the page animation system then -1 will be
returned.
Example
Numbers
AN
Expression
Comment
20
MyFunc(PV_10)
Display the value of PV_10 at AN20
See Also
Display Functions
DspGetAnExtent
Description
Syntax
Gets the extent of the object (the enclosing boundary) at the specified AN.
DspGetAnExtent(AN, Top, Left, Bottom, Right)
AN: . . . . . . . . . . . . . The AN at which the object is positioned.
Top: . . . . . . . . . . . . . A buffer that contains the top-most extent of the object.
Left: . . . . . . . . . . . . . A buffer that contains the left-most extent of the object.
Bottom: . . . . . . . . . . A buffer that contains the bottom-most extent of the object.
Right: . . . . . . . . . . . A buffer that contains the right-most extent of the object.
Return Value
Related Functions
Example
See Also
0 (zero) if successful, otherwise an error is returned. The Top, Left, Bottom, and
Right arguments contain the extents of the object, in pixels.
DspGetAnWidth, DspGetAnHeight, DspGetAnLeft, DspGetAnRight,
DspGetAnBottom, DspGetAnTop
// Get extents at AN 25.
DspGetAnExtent(25, Top, Left, Bottom, Right);
Display Functions
DspGetAnFirst
Description
Syntax
Gets the first AN on the current page, based on the order in which the ANs were
stored by Graphics Builder.
DspGetAnFirst()
317
318
DspGetAnFromPoint
Description
Gets the AN of the object at a specified set of screen coordinates. If the X and Y
co-ordinates given are within the extents of an object, then the AN number of the
object will be returned.
For example, if there is a button at coordinates (300, 140), and it is 100 wide, 50
high, this function would return the AN if it uses X between 300 & 400 and Y
between 140 and 190, such as DspGetAnFromPoint(325,180).
Hint: If you are using groups and the specified coordinates point to an object
that is part of a group, the AN of the object is returned, not the AN of the group.
Syntax
DspGetAnFromPoint(X, Y, PrevAN)
X . . . . . . . . . . . . . . . The x coordinate of the screen point.
Y . . . . . . . . . . . . . . . The y coordinate of the screen point.
PrevAN . . . . . . . . . . Retrieves the previous AN (in z-order) in situations where a
number of objects overlap at the specified point. The default
of 0 (zero) specifies no previous AN. A non-zero value
should only ever be passed if it is the result of a previous call
to DspGetAnFromPoint.
Return Value
Example
See Also
Display Functions
DspGetAnHeight
Description
Syntax
Return Value
Related Functions
Example
See Also
The height of the object (in pixels). If no object exists at the AN, -1 is returned.
DspGetAnWidth, DspGetAnLeft, DspGetAnRight, DspGetAnBottom,
DspGetAnTop
nHeight = DspGetAnHeight(30);
Display Functions
DspGetAnLeft
Description
Syntax
Return Value
Related Functions
The x coordinate of the left extent of the object at the AN. If no object exists at the
AN, -1 is returned.
DspGetAnWidth, DspGetAnHeight, DspGetAnRight,
DspGetAnBottom, DspGetAnTop, DspGetAnExtent
319
320
nLeft = DspGetAnLeft(30);
Display Functions
DspGetAnNext
Description
Syntax
Returns the AN that follows the specified AN, based on the order in which the
ANs were stored on a page by Graphics Builder.
DspGetAnNext(AN)
AN. . . . . . . . . . . . . . The animation-point number.
Return Value
The value for the next AN. If -1 is returned, it means the specified AN is invalid
or it is the last AN on the page.
Related Functions
DspGetAnFirst
See Also
Display Functions
DspGetAnRight
Description
Syntax
Return Value
Related Functions
Example
See Also
The x coordinate of the right extent of the object at the AN. If no object exists at
the AN, -1 is returned.
DspGetAnWidth, DspGetAnHeight, DspGetAnLeft,
DspGetAnBottom, DspGetAnTop, DspGetAnExtent
nRight = DspGetAnRight(30);
Display Functions
DspGetAnTop
Description
Syntax
The y coordinate of the top extent of the object at the AN. If no object exists at the
AN, -1 is returned.
Related Functions
Example
See Also
nTop = DspGetAnTop(30);
Display Functions
DspGetAnWidth
Description
Syntax
Return Value
Related Functions
Example
See Also
The width of the object (in pixels). If no object exists at the AN, -1 is returned.
DspGetAnHeight, DspGetAnLeft, DspGetAnRight,
DspGetAnBottom, DspGetAnTop, DspGetAnExtent
nWidth = DspGetAnWidth(30);
Display Functions
DspGetEnv
Description
Syntax
Return Value
Example
321
322
Display Functions
DspGetMouse
Description
Syntax
Gets the x and y coordinates of the mouse position, relative to the top left corner
of the window.
DspGetMouse(X, Y)
X . . . . . . . . . . . . . . . The variables used to store the x pixel coordinate of the
mouse position, returned from this function.
Y . . . . . . . . . . . . . . . The variables used to store the y pixel coordinate of the
mouse position, returned from this function.
Return Value
Related Functions
Example
See Also
Display Functions
DspGetNearestAn
Description
Syntax
DspGetNearestAn(X, Y)
X . . . . . . . . . . . . . . . The x coordinate (in pixels).
Y . . . . . . . . . . . . . . . The y coordinate (in pixels).
Return Value
Related Functions
See Also
DspGetMouse(X,Y);
! Gets mouse position.
AN=DspGetNearestAn(X,Y);
! Gets AN nearest to the mouse.
Prompt("Mouse At AN"+AN:###);
! Displays AN nearest to the mouse.
Display Functions
DspGetParentAn
Description
Syntax
Gets the parent animation number (if any), for the specified animation number.
AN animation point will have a parent animation point if it corresponds to an
object in a group.
DspGetParentAn(AN)
AN: . . . . . . . . . . . . . The animation-point number.
Return Value
Related Functions
Example
See Also
Display Functions
DspGetSlider
Description
Gets the current position (value) of a slider at an AN. You can call this function
in the slider event to find the new position of the slider.
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Syntax
DspGetSlider(AN)
AN: . . . . . . . . . . . . . The animation-point number.
Return Value
Related Functions
The value of the slider from 0 to 32000. If no animation exists at the AN, -1 is
returned.
DspSetSlider
323
324
Display Functions
DspGetTip
Description
Syntax
Return Value
Related Functions
Example
See Also
The tool tip text (as a string). If no user tip is available, an empty string is
returned.
DspSetTip, DspTipMode
!Display the tool tip text on AN19
DspText(19, 0, DspGetTip(KeyGetCursor(), 1));
Display Functions
DspGrayButton
Description
Grays and disables a button. If the button is a symbol, the symbol is overwritten
with a gray mask. (When a button is grayed, it cannot be selected.) If the
Disabled field in the Buttons database is blank, the button is always enabled
unless you use this function. If the Disabled field in the Buttons database
contains an expression, this function will not override the expression.
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Syntax
DspGrayButton(hAn, nMode)
hAn: . . . . . . . . . . . . The AN where the button is located.
Display Functions
DspInfo
Description
Extracts individual pieces of object information from an AN. Each AN can have
multiple expressions associated with it, and each expression can have multiple
variables associated with it. You use an index to refer to each individual
expressions or variables. Typically, you would query the number of expressions,
then the number of variables in a given expression, then the details of a given
variable tag.
Note: You must first create a handle to the information block using
DspInfoNew().
Syntax
325
326
Return Value
Related Functions
Example
The object information (as a string). A blank string is returned if you specify a
non-existant expression or variable.
DspInfoNew, DspInfoField, DspInfoDestroy
INT hInfo;
INT iRawValue;
INT iEngineeringValue;
INT iNumberOfExpressions;
INT iNumberOfTags;
INT iExpressionIndex;
INT iTagIndex;
STRING sObjectType;
STRING sExpressionText;
STRING sExpressionResult;
STRING sExpressionContext;
STRING sTagName;
hInfo
= DspInfoNew(AN);
See Also
Display Functions
DspInfoDestroy
Description
Syntax
DspInfoDestroy(hInfo)
hInfo: . . . . . . . . . . . The object information block handle, as returned by
DspInfoNew(). This handle identifies the table (or block)
where all object data is stored.
Return Value
Related Functions
Example
327
328
Display Functions
DspInfoField
Description
Syntax
Obtains static and real-time data from a variable tag. You get static data from the
Variable Tags database. Two additional fields, "Raw_Value" and "Eng_Value",
return dynamic real-time data for the variable tag. To get this real-time data, you
must first call the DspInfoNew() function to get the information block handle
hInfo.
DspInfoField(hInfo, sTag, sField)
hInfo: . . . . . . . . . . . The object information block handle, as returned by
DspInfoNew(). This handle identifies the table (or block)
where all data on the object is stored. Set this handle to 0
(zero) if you do not require real-time data.
sTag: . . . . . . . . . . . . The name of the variable tag.
sField: . . . . . . . . . . . The name of the field from which to extract the data:
Field: . . . . . . . . . . . . Description
Name: . . . . . . . . . . . Variable Tag Name
Type: . . . . . . . . . . . . Data Type
Unit: . . . . . . . . . . . . I/O Device Name
Addr: . . . . . . . . . . . Address
Raw_Zero: . . . . . . . Raw Zero Scale
Raw_Full: . . . . . . . . Raw Full Scale
Raw_Value: . . . . . . . Un-scaled raw value - Dynamic
Eng_Zero: . . . . . . . . Engineering Zero Scale
Eng_Full: . . . . . . . . Engineering Full Scale
Eng_Value: . . . . . . . Scaled engineering value - Dynamic
Eng_Units: . . . . . . . Engineering Units
Format: . . . . . . . . . . Display Format
Comment: . . . . . . . . Variable tag comment
Return Value
Related Functions
! Get the I/O Device that Variable Tag "PV123" belongs to.
IODev=DspInfoField(0,"PV123","Unit");
! Get the real-time engineering value of a tag.
hInfo=DspInfoNew(20);
sTag=DspInfo(hInfo,3,0);
EngValue=DspInfoField(hInfo,sTag,"Eng_Value");
See Also
Display Functions
DspInfoNew
Description
Creates an object information block. Use this function with the associated lowlevel animation information functions to get and process object information on
an AN.
Note: When you have finished with the object information block, you must
destroy it with the DspInfoDestroy() function, or a fatal error could occur.
If you need simple animation help, use the InfoForm() or the InfoFormAn()
functions.
Syntax
DspInfoNew(hAn)
hAn: . . . . . . . . . . . . The AN for which object information is provided.
Return Value
Related Functions
Example
329
330
See Also
Display Functions
DspInfoValid
Description
Syntax
Return Value
Related Functions
Example
See Also
Display Functions
DspIsButtonGray
Description
Syntax
DspIsButtonGray(hAn)
hAn: . . . . . . . . . . . . The AN for which object information is provided.
Return Value
Related Functions
Example
See Also
Display Functions
DspKernel
Description
Displays the Kernel window. You should restrict the use of this function because
once you are in the Kernel, you can execute any Cicode function with no
privilege restrictions. You therefore have total control of Citect (and
subsequently your plant and equipment). Note that you can also open the
Kernel by setting the Citect [Debug]Menu parameter to 1 and, when your
system is running, selecting Kernel from the control-menu box.
Note the following:
Syntax
You should be experienced with Citect and Cicode before attempting to use
the Kernel as these facilities are powerful, and if used incorrectly, can corrupt your system.
You should only use the Kernel for diagnostics and debugging purposes,
and not for normal Citect operation.
You should restrict access to the Kernel, because once you are in the Kernel,
you can execute any Cicode function with no privilege restrictions. You
therefore have total control of Citect (and subsequently your plant and
equipment).
DspKernel(iMode)
iMode: . . . . . . . . . . . The display mode of Kernel:
1 - Display the Kernel. If the Kernel is already displayed and
iMode=1, the keyboard focus is changed to the Kernel.
0 - Hide the Kernel
Return Value
Related Functions
331
332
DspKernel(1);
!Display the Citect Kernel window
Display Functions
DspMarkerMove
Description
Syntax
Return Value
Related Functions
Example
See Also
DspMarkerNew
Description
Creates a new trend marker. A trend marker is used to show cursor values or
limits on a trend. You can use up to 10 markers on a single trend or chart.
If you add markers to a trend or chart that Citect is animating, you must repaint
them using the trend paint event (OnEvent(Window,22)). (Otherwise Citect will
delete any markers displayed when the trend is updated.)
Syntax
Related Functions
Example
See Also
Display Functions
DspMCI
Description
333
334
DspMCI(sCommand)
sCommand: . . . . . . . The MCI command. See the Microsoft Windows Multimedia
Programmer's Guide for details.
Return Value
Related Functions
Example
See Also
Display Functions
DspPlaySound
Description
Plays a waveform (sound). Wave form sound files *.WAV are provided with
Windows and by third-party developers, or you can record them yourself to
play long (and complex) sound sequences.
If you have a sound card, this function will return immediately and the sound
will play in the background. If you do not have a sound card, this function will
not return until the sound has finished playing - Citect will stop running, so you
should not use this function unless you have a sound card.
This function searches the [Sounds] section of the WIN.INI file for an entry with
the specified name, and plays the associated waveform. If the name does not
match an entry in the WIN.INI file, a waveform filename is assumed. The
function will then search the following directories for the waveform file
(directories are listed in search order):
1
DspPlaySound(sSoundname, nMode)
sSoundname: . . . . . The waveform to be played. Predefined sounds (in the
WIN.INI file) are:
Return Value
Related Functions
Example
See Also
SystemAsterisk
SystemExclamation
SystemQuestion
SystemDefault
SystemHand
SystemExit
SystemStart
Display Functions
DspPopupMenu
Description
Syntax
335
336
The selected menu item as an integer. This comprises the menu number (return
value div 100), and the position of the item in the menu (return value mod 100).
For example, a return value of 201 indicates that the first item in Menu 2 was
selected, and a return value of 3 indicates that the third item in Menu 0 was
selected.
Example 2
See Also
Display Functions
DspRichText
Description
Syntax
Creates a Rich Text object of the given dimensions at the animation point hAn.
This object can then be used to display an RTF file (like an RTF report) called
using the DspRichTextLoad function.
DspRichText(hAn, iHeight, iWidth, iMode)
hAn: . . . . . . . . . . . . The AN at which the rich text object will display when the
DspRichText command is run.
337
338
Related Functions
DspRichTextLoad, PageRichTextFile
Example
See Also
Display Functions
DspRichTextEdit
Description
Syntax
Enables editing of the contents of the rich text object at hAn if nEdit = TRUE, and
disables editing if nEdit = FALSE.
DspRichTextEdit(hAn, bEdit)
See Also
Display Functions
DspRichTextEnable
Description
Syntax
Enables the rich text object at hAn if nEnable = TRUE, and disables the object if
nEnable = FALSE. When the object is disabled, its contents cannot be selected or
copied etc.
DspRichTextEnable(hAn, bEnable)
hAn: . . . . . . . . . . . . The reference AN for the rich text object.
bEnable: . . . . . . . . . The value of this argument determines whether the rich text
object at hAn will be enabled or disabled. Enter TRUE to
enable the object (i.e. you can select and copy the contents of
the RTF object, but you cant make changes). Enter FALSE to
disable the object (i.e. make it display only).
Return Value
Related Functions
Example
See Also
Display Functions
339
340
DspRichTextGetInfo
Description
Syntax
Retrieves size information about the rich text object at animation point hAn.
DspRichTextGetInfo(hAn, iType)
hAn: . . . . . . . . . . . . The reference AN for the rich text object.
iType: . . . . . . . . . . . The following size information (in pixels) can be returned
about the specified rich text object:
0 - Height
1 - Width
Return Value
Related Functions
Example
See Also
Display Functions
DspRichTextLoad
Description
Syntax
Loads a copy of the file Filename into the rich text object) at animation point hAn.
(The rich text object may have been created using either the DspRichTextLoad
function or the PageRichTextFile function.)
DspRichTextLoad(hAn, sFilename)
hAn: . . . . . . . . . . . . The animation point at which a copy of the rich text file (e.g.
an RTF report) will display. This AN must match that of a
rich text object (created using either the DspRichText
function, or the PageRichTextFile function), or the copy of
the file will not be loaded into anything, and will not display.
sFilename: . . . . . . . . The name of the file to be copied and loaded into the rich text
object at the specified animation point. The filename must be
entered in quotation marks "".
If you are loading a copy of an RTF report, the report already have been run and
saved to a file. Remember that the filename for the saved report comes from the
See Also
Display Functions
DspRichTextPgScroll
Description
Syntax
Scrolls the contents of the rich text object displayed at hAn, by one page length in
the direction given in direction.
DspRichTextPgScroll(hAn, iDirection)
hAn: . . . . . . . . . . . . The reference AN for the rich text object.
iDirection: . . . . . . . The direction in which you want to scroll each time this
function is run. You can choose from the following:
1 - Left
2 - Right
3 - Up
341
342
See Also
Display Functions
DspRichTextPrint
Description
Syntax
Prints the contents of the rich text object at animation point hAn, to the port
PortName.
DspRichTextPrint(hAn, sPortName)
hAn: . . . . . . . . . . . . The reference AN for the rich text object.
sPortName: . . . . . . . The name of the printer port to which the contents of the rich
text object will be printed. This name must be enclosed
within quotation marks "". For example "LPT1", to print to
the local printer, or "\\Pserver\canon1" using UNC to print
to a network printer.
Return Value
Related Functions
Example
See Also
Display Functions
DspRichTextSave
Description
Syntax
Saves the contents of the rich text object at animation point hAn, to the file
Filename.
DspRichTextSave(hAn,sFilename)
hAn: . . . . . . . . . . . . The reference AN for the rich text object.
sFilename: . . . . . . . . The name under which the contents of the rich text object
will be saved. This name must be enclosed within quotation
marks "", and must include the destination path. For example
"[Data]\saved.rtf".
Return Value
Related Functions
Example
See Also
Display Functions
DspRichTextScroll
Description
Syntax
Scrolls the contents of the rich text object displayed at hAn, in the direction given
in direction, by the number of lines/units given in amount. Remember that the
height of a line varies according to the font used, therefore if you need to scroll
absolute distances, it might be advisable to use the DspRichTextPgScroll
function.
DspRichTextScroll(hAn, iDirection, iAmount)
hAn: . . . . . . . . . . . . The reference AN for the rich text object.
iDirection: . . . . . . . The direction in which you want to scroll each time this
function is run. You can choose from the following:
1 - Left
2 - Right
3 - Up
343
344
See Also
Display Functions
DspRubEnd
Description
Syntax
Ends the rubber band selection, and returns the coordinates of the rubber band
selection. The meaning of the cx and cy values depend on the nMode you specify
in the DspRubStart() function.
DspRubEnd(x,y, cx, cy)
x,y: . . . . . . . . . . . . . The x and y coordinates of the start position.
cx,cy: . . . . . . . . . . . . The x and y coordinates of the end position.
Return Value
Related Functions
Example
See Also
See DspRubStart
Display Functions
DspRubMove
Description
Moves the rubber band selection to the new position. You must first call the
DspRubStart() function to start the rubber band selection, and DspRubEnd()
function to form the rubber band selection.
DspRubMove(x,y)
x,y: . . . . . . . . . . . . . The x and y coordinates of the current position.
Return Value
Related Functions
Example
See Also
DspRubSetClip
Description
Sets the clipping region for the rubber band display. If you enable the clipping
region, the rubber band will not move outside of the clip region. This allows you
to restrict the rubber band to within some constrained region. (For example, to
prevent an operator from dragging the rubber band outside of the trend display
when zooming the trend.)
You must call this function (to enable the clipping region) before you can start
the rubber band selection (with the DspRubStart() function).
Syntax
DspRubSetClip(x1,y1,x2,y2)
x1,y1,x2,y2: . . . . . . The x and y coordinates of the clipping region.
Return Value
Related Functions
Example
See Also
Display Functions
345
346
DspRubStart
Description
Starts the rubber band selection. Call this function when the left mouse button is
pressed - the rubber band is displayed at the starting position. Call the
DspRubEnd() function to end the selection, when the mouse button is released.
The DspRubMove() function moves the selection to the new position.
This function is used by the trend templates for the trend zoom function. Use the
rubber band functions whenever you want the operator to select a region on the
screen or display a dynamic rectangle on the screen.
You can only display one rubber band per page. If you display a second rubber
band, the first rubber band is erased. To move a rubber band with the mouse,
use the OnEvent() function to get notification of the mouse movement, and then
the DspRubMove() function. Because these are generic rubber-band display
functions, you can get input from the keyboard, Cicode variables, the I/O
Device, and the mouse.
Syntax
DspRubStart(x,y, nMode)
x,y: . . . . . . . . . . . . . The x and y coordinates of the current position.
nMode: . . . . . . . . . . The mode of the rubber banding operation:
0 - cx,cy as absolute pixel positions
1 - cx,cy in pixels relative to x,y
2 - (x,y) always top left to (cx,cy)
4 - the clipping region.
Return Value
Related Functions
Example
See Also
Display Functions
DspSetSlider
Description
Sets the current position of a slider at the specified AN. You can use this function
to move a slider, and adjust the value of the variable associated with the slider.
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Syntax
DspSetSlider(AN, nPos)
AN: . . . . . . . . . . . . . The animation-point number.
nPos: . . . . . . . . . . . . The position of the slider from 0 to 32000 where 0 is the zero
position of the slider and 32000 if full position of the slider.
Return Value
Related Functions
Example
See Also
Display Functions
DspSetTip
Description
Sets tool tip text associated with an AN. Any existing text associated with the
AN will be replaced with the new text.
347
348
DspSetTip(AN, sText)
AN: . . . . . . . . . . . . . The animation-point number.
sText: . . . . . . . . . . . The tool tip text to set for the AN.
Return Value
Related Functions
Example
See Also
Display Functions
DspSetTooltipFont
Description
Syntax
B to specify Bold
I to specify Italics
U to specify Underline
No return value.
DspGetTip, DspTipMode
!Set the tool tip font to Bold, Italic, Times New Roman, with a
point size of 12
DspSetTooltipFont("Times New Roman", 12, "BI");
See Also
Display Functions
DspStatus
Description
Syntax
Determines whether the object at the specified AN will be grayed (hatch pattern)
in the event of a communication failure.
DspStatus(AN, nMode)
AN: . . . . . . . . . . . . . The animation-point number.
nMode: . . . . . . . . . . 0 - Switch off the error status
1 - Gray the object (with a hatch pattern)
Return Value
Example
See Also
Display Functions
DspStr
Description
Syntax
Return Value
Related Functions
349
350
See Also
Display Functions
DspSym
Description
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Displays a symbol at a specified AN. If the symbol number is 0, any existing
symbol (at the AN) is erased.
Syntax
Return Value
Related Functions
! Erase the existing symbol and then display the centrifuge symbol
(from the pumps library) at AN25.
DspSym(25,"Pumps.Centrifuge");
! Erase the existing symbol and then display Citect Version 1.xx
symbol 2 at AN25.
DspSym(25,2);
! Do not erase the existing symbol, just display the tank symbol
(from the global library) at AN26.
DspSym(26,"Centrifuge",1);
See Also
Display Functions
DspSymAnm
Description
Animates a series of symbols at an AN. Sym1 displays first, then Sym2, Sym3 . . .
Sym8 and then Sym1 displays again, etc. When the next symbol in the sequence
is displayed, the current symbol is not erased, but is overwritten to provide a
smoother animation. The symbols should all be the same size.
The frequency of changing the symbols is determined by the [Page]AnmDelay
parameter.
You only need to call this function once to keep the animation going. To stop the
animation call the DspDel() function, or call this function again with different
symbols (to change the animation).
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Syntax
Return Value
351
352
DspSym
DspSymAnm(25,"Pumps.Centrifuge","Pumps.Floatation");
! Alternately displays the centrifuge symbol and the flotation
symbol(from the pumps library) at AN25.
DspSymAnm(25,4,7);
! Alternately displays Citect Version1.xx symbols 4 and 7 at AN25.
See Also
Display Functions
DspSymAnmEx
Description
Animates a series of symbols at an AN. Sym1 displays first, then Sym2, Sym3 . . .
Sym9 and then Sym1 displays again, etc. When the next symbol in the sequence
is displayed, the current symbol is not erased, but is overwritten to provide a
smoother animation. The symbols should all be the same size.
The frequency of changing the symbols is determined by the [Page]AnmDelay
parameter.
You only need to call this function once to keep the animation going. To stop the
animation call this function again with a different Mode.
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Syntax
See Also
Display Functions
DspSymAtSize
Description
Displays a symbol at the specified scale and offset from the AN position.
By calling this function continuously, you can move symbols around the screen
and change their size and shape, to simulate trippers, elevators, and so on. You
353
354
See Also
Display Functions
DspText
Description
Displays text at an AN. This function does the same operation as DspStr(),
however it uses a font number rather than a font name.
Note: This function is only used for V3.xx and V4.xx animations, and was
superseded in later releases.
Syntax
Return Value
Related Functions
Example
355
356
See Also
Display Functions
DspTipMode
Description
Syntax
Switches the display of tool tips on or off. This function overrides the setting in
the [Page]TipHelp parameter.
DspTipMode(nMode)
nMode: . . . . . . . . . . The display mode:
0 - Off
1 - On
2 - Toggle the tool tip mode
3 - Do not change the mode, just return the current value
Return Value
Related Functions
Example
DspTipMode(1);
See Also
Display Functions
DspTrend
Description
Displays a trend at an AN. Values are plotted on the trend pens. You must
specify Value1, but Value2 to Value8 are optional. If more values (than configured
pens) are specified, the additional values are ignored. If fewer values (than
configured pens) are specified, the pens that have no values are not displayed.
DspTrend() is optimized so that it will not display the trend until a full set of
samples has been collected. For example, if you have defined 100 samples for
your trend, the trend will not display until value 100 is entered.
You should use this function only if you want to control the display of trends
directly. If you use the standard Trends (defined in the Trends database) this
function is called automatically.
Syntax
357
358
See Also
Display Functions
DspTrendInfo
Description
Syntax
0 = line
1 = bar
359
360
Related Functions
Example
The trend information (as an integer). If Pen Color (Types 11 - 18) is requested
from a bar trend, the return value is -1.
DspTrend
! get the number of samples for the main_loop trend (from the
trends library).
nSamples = DspTrendInfo("Trends.Main_Loop", 1);
! get the number of samples for trend 3 (Citect Version 1.xx).
nSamples = DspTrendInfo(3, 1);
See Also
Display Functions
DumpKernel
Description
Syntax
See Also
Miscellaneous Functions
EngToGeneric
Description
Syntax
Gets a variable in the CitectSCADA generic scale format. CitectSCADA uses this
scale to display trends. It calls this function automatically for trends defined in
the project, however, you must call this function to display a trend by using
Cicode,.
EngToGeneric(Value, EngLow, EngHigh)
Value: . . . . . . . . . . . The value to convert to the CitectSCADA generic scale
format.
EngLow: . . . . . . . . . The engineering units zero scale.
EngHigh: . . . . . . . . The engineering units full scale.
Return Value
Related Functions
Example
See Also
Miscellaneous Functions
EnterCriticalSection
Description
Requests permission for the current thread to have access to a critical section. If
the critical section is already being accessed by another thread (using the
EnterCriticalSection() function), the current thread will be granted access when
the other thread relinquishes ownership using the LeaveCriticalSection()
function.
Once a thread has ownership of a critical section, it can access the same section
repeatedly (using the EnterCriticalSection() function each time). Remember,
however, that LeaveCriticalSection() must be called once for each
EnterCriticalSection() used.
Syntax
EnterCriticalSection(sName)
sName: . . . . . . . . . . The name of the critical section. The name must be entered in
quotation marks.
Return Value
361
362
LeaveCriticalSection
/* Request access to critical section, execute code and relinquish
ownership of critical section. */
FUNCTION
MyCriticalFunction()
EnterCriticalSection("MyCritical");
// critical code is placed here
LeaveCriticalSection("MyCritical");
END
See Also
Task Functions
ErrCom
Description
Syntax
Return Value
Related Functions
Example
Gets the communication status for the current Cicode task. You can call this
function in reports, Cicode that is associated with an object, and in any Cicode
task.
ErrCom()
0 (zero) if all I/O device data associated with the task is valid, otherwise an error
is returned.
CodeSetMode
IF ErrCom()<>0 THEN
Prompt("I/O device data is bad");
END
In a report format:
{CICODE}
IF ErrCom()<>0 THEN
PrintLn("This Report contains bad data");
END
{END}
See Also
Error Functions
ErrDrv
Description
Syntax
PROTOCOL
MASK
ERROR
MESSAGE
REFERENCE
ACTION
COMMENT
nError: . . . . . . . . . . The protocol specific error code. This field must be a variable
as it also the place where the returned error code is stored.
Since the first 34 specific error codes are standard for all
protocols, CitectSCADA may add 'masking' to make the
error code unique. For example, if an I/O device returns
errors 1 to 10 (which are already used), the driver may add
0x100000 to its error codes. When this function is called, the
mask will be removed before the result is returned to this
variable.
Return Value
Related Functions
Example
The error message (as a string), or an empty string ("") if the error is not found.
The error code is returned into the nError variable.
ErrInfo, ErrHelp
// Get the error message and number associated with error 108
nError = 108;
sError = ErrDrv("TIWAY", "MESSAGE", nError);
See Also
Error Functions
ErrGetHw
Description
363
364
ErrGetHw(Device, DeviceType)
Device: . . . . . . . . . . For I/O Devices that are created by the system engineer,
select the IODevNo as the argument value.
To determine the IODevNo of a physical I/O Device in your
project, use the I/O Device record number from the I/O
Device form in the Citect Project Editor. When using an
IODevNo, the DeviceType argument must be set to 2.
For I/O Devices that are created by CitectSCADA itself, select
one of the following options as the argument value:
Generic
LAN
Cicode
Animation
Reports Server
Alarms Server
Trends Server
I/O Server
The error.
ErrHelp, ErrInfo, ErrMsg, ErrSetHw
Error=ErrGetHw(3,0);
! Sets Error to the current error status for the animation device.
IF Error=0 THEN
DspText(4,0,"");
ELSE
DspText(4,0,"Hardware error");
END
See Also
Error Functions
ErrHelp
Description
Syntax
Return Value
Related Functions
Example
See Also
Error Functions
ErrInfo
Description
Syntax
365
366
See Also
Error Functions
ErrLog
Description
Syntax
ErrLog(Message)
Message: . . . . . . . . . The message to log. This field can also contain control (such
as /n) and formatting characters.
Return Value
Related Functions
Example
See Also
Error Functions
ErrMsg
Description
Syntax
Related Functions
Example
The error message (as a string). A null value is returned if nError is not in the
range of Cicode errors.
IsError, ErrHelp, ErrInfo, ErrTrap
//Get the message of the last hardware error
sMsg = ErrMsg(IsError());
See Also
Error Functions
ErrSet
Description
Sets the error-checking mode. When Mode is set to 0 and a fatal error occurs,
CitectSCADA halts the execution of the Cicode task that caused the error, and
generate a hardware error.
You can perform error checking by setting Mode to 1 and using the IsError()
function to trap errors. When the type of error is determined, you can control
what happens under particular error conditions.
The operation of the ErrSet() function is unique to each Cicode task. If you
enable user error checking for one task, it does not enable error checking for any
other tasks.
Note: This has changed from previous versions of CitectSCADA where this
feature used to effect all Cicode tasks.
Syntax
ErrSet(Mode)
Mode: . . . . . . . . . . . Error-checking mode:
0 - default - CitectSCADA will check for errors.
1 - The user must check for errors.
Return Value
Related Functions
Example
367
368
Error Functions
ErrSetHw
Description
Sets the hardware error status for a hardware device. Call this function to
generate a hardware error.
I/O devices can be grouped into two distinct categories: those created by the
system engineer, and those created by CitectSCADA itself.
I/O devices that are created by the system engineer, are any I/O device listed in
the CitectSCADA I/O devices database, visible as records in the I/O Device form
in the Project Editor.
I/O devices that are created by CitectSCADA, including Generic, LAN, Cicode,
Animation, Reports Server, Alarms Server, Trends Server, and I/O Server (are
those specifically not created by the system engineer).
The arguments values you supply in this function are used by CitectSCADA to
determine the type of device hardware alarm you want to work with.
Warning! To use this function, you must set [Code]BackwardCompatibleErrHw
to 1. You cannot use this function if you have more than 511 I/O devices in your
project.
Syntax
This was for versions of CitectSCADA that permitted a maximum limit of 4095 I/
O Devices.
Versions of CitectSCADA prior to V5.20 masked the IODevNo with a value of
512. The backward compatibility flag for using this mask must be set in the
Citect.INI file (see code parameter BackwardCompatibleErrHw).
Return Value
Related Functions
Example
See Also
Error Functions
ErrSetLevel
Description
Sets the nesting error level to enable CitectSCADA error checking inside a
nested function (when CitectSCADA error checking has been disabled). This
function returns the old error level and sets a new error level.
The nesting error level is incremented every time the ErrSet(1) function is called.
Syntax
ErrSetLevel(Level)
369
370
See Also
Error Functions
ErrTrap
Description
ErrTrap(Error, bHalt)
Error: . . . . . . . . . . . The error number to trap.
bHalt: . . . . . . . . . . . Determines whether the Cicode execution will be halted.
0 - Cicode execution is not halted
1 - Cicode execution is halted
Return Value
Example
See Also
IF Tag=0 THEN
ErrTrap(273);! Traps a divide by zero error.
ELSE
Value=10/Tag;
END
Error Functions
Exec
Description
Syntax
Exec(Command, Mode)
Command: . . . . . . . The operating system command to execute.
Mode: . . . . . . . . . . . The mode of the window:
1 - Normal
3 - Maximized
6 - Minimized
If you do not enter a mode, the default mode is 1.
Return Value
Related Functions
371
372
Exec("c:\winnt\system32\mspaint.exe");
! Starts up the Paint application with a normal window.
Exec("cmd /c mkdir c:\test");
! Uses the DOS shell to create a new directory
See Also
Miscellaneous Functions
ExecuteDTSPkg
Description
Syntax
sSQLSvrUsr: . . . . . The user name providing access to the SQL Server where the
DTS package is stored. A user's account on the SQL Server
consists of this user name and, in most cases, a password.
This parameter also determines which method is used to
load the package.
If sSQLSvrUsr is specified, the package is assumed to be an
SQL Server stored package. In this case, the package is
loaded using the LoadFromSQLServer() method. Otherwise,
the package is file-based and LoadFromStorageFile() is
called.
sSQLSvrPwd: . . . . . The password providing access to the SQL Server, if the
user's account on the server requires a password.
Return Value
0 (zero) if the package was executed successfully, otherwise a DTS error number
is returned.
Example
/* File-based package with one package per file, where the package
name is the same as the file name.*/
iResult = ExecuteDTSPkg("c:\dtspackages\package.dts");
/*SQL Server stored package with additional parameters */
iResult = ExecuteDTSPkg("Server1", "TestPackage", "Param1",
"Param2", "Param3", "Param4", "Param5", "Fred", "1",
"c:\packages\PkgLog.txt", "jsmith", "secret");
See Also
SQL Functions
Exp
Description
373
374
Exp(Number)
Number: . . . . . . . . . Any number.
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
Fact
Description
Syntax
Return Value
Example
See Also
Math/Trigonometry Functions
FileClose
Description
Syntax
Closes a file. All data written to the file is flushed to disk when the file is closed,
and the file number becomes invalid.
FileClose(File)
File: . . . . . . . . . . . . . The file number.
Return Value
Related Functions
Example
See Also
File Functions
FileCopy
Description
Syntax
Copies a file. You can use the DOS wild card characters (*) and (?) to copy
groups of files. In asynchronous Mode, this function will return immediately
and the copy will continue in the background. Unless you are accessing to the
floppy drive, copying files does not interfere with the operation of other
CitectSCADA tasks, because this function is time-sliced.
FileCopy(Source, Dest, Mode)
Source: . . . . . . . . . . The name of the source file to copy.
Dest: . . . . . . . . . . . . The name of destination file to copy to. To copy a file to the
printer, specify the name as "LPT1.DOS".
Mode: . . . . . . . . . . . The copy mode:
0 - Normal
1 - Copy only if the file time is different.
2 - Copy in asynchronous mode.
Multiple modes can be selected by adding them together (for example, set Mode
to 3 to copy in asynchronous mode if the file time is different).
Return Value
Related Functions
Example
See Also
File Functions
375
376
FileDelete
Description
Syntax
Deletes a file.
FileDelete(Name)
Name: . . . . . . . . . . . The name of the file to delete.
Return Value
Related Functions
Example
See Also
File Functions
FileEOF
Description
Syntax
Return Value
Related Functions
Example
See Also
File Functions
FileExist
Description
Syntax
Return Value
FileOpen
! Check if the file exists
IF FileExist("C:\Data\Report.Txt") THEN
! The file exists
END
See Also
File Functions
FileFind
Description
Syntax
Finds a file that matches a specified search criteria. To find a list of files, you
must first call this function with the required path and mode (to find the first
file), then call the function again with an empty path and a mode of 0 (to find the
remaining files). After the last file is found, an empty string is returned.
FileFind(sPath, nMode)
sPath: . . . . . . . . . . . The name of the file to check.
nMode: . . . . . . . . . . The type of file to check:
0 - Normal file
1 - Read-only file
2 - Hidden file
4 - System file
8 - Volume ID
16 - Subdirectory
32 - Archived file
Return Value
Related Functions
Example
The full path and filename. If no files are found, an empty string is returned.
FileOpen, FileSplitPath, FileMakePath
! Search for all dBase files in the run directory and make a backup
sPath = FileFind("[run]:\*.dbf", 0);
WHILE StrLength(sPath) > 0 DO
FileSplitPath(sPath, sDrive, sDir, sFile, sExt);
sBak = FileMakePath(sDrive, sDir, sFile, "BAK");
FileCopy(sPath, sBak, 0);
! Find the next file
sPath = FileFind("", 0);
END
377
378
File Functions
FileGetTime
Description
Syntax
Return Value
Related Functions
Example
See Also
The file time of the file (in the CitectSCADA time/date variable format).
FileOpen, FileClose, FileSetTime
File = FileOpen("[data]:report.txt", "r");
! Get the time of the file
iTime = FileGetTime(File);
FileClose(File);
File Functions
FileMakePath
Description
Syntax
Return Value
Related Functions
Example
See Also
FileOpen
Description
Opens a file and returns a file number that can be used by other file functions.
You can also use this function to check if a file exists, by opening the file in readonly mode. A return value of -1 indicates that the file cannot be opened.
ErrSet(1) needs to be in the previous line of your code, else the execution stops
and a hardware error is generated. If ErrSet(1) is used then it doesn't halt, and -1
is returned.
Syntax
FileOpen(Name, Mode)
Name: . . . . . . . . . . . The name of the file to open.
Mode: . . . . . . . . . . . The mode of the opened file:
"a" - Append mode. Allows you to append to the file without
removing the end of file marker. The file cannot be
read. If the file does not exist, it will be created.
"a+" - Append and read modes. Allows you to append to the
file and read from it. The end of file marker will be
removed before writing and restored when writing is
complete. If the file does not exist, it will be created.
"r" - Read-only mode. Allows you to (only) read from the file.
If the file does not exist or cannot be found, the
function call will fail.
"r+" - Read/write mode. Allows you to read from, and write
to, the file. If the file exists (before the function is
called), its contents will be destroyed. If the file does
not exist or cannot be found, the function call will fail.
"w" - Write mode, file is truncated. Opens an empty file for
writing. If the file exists (before the function is called),
its contents will be destroyed. If the file does not exist
or cannot be found, the function call will fail.
"w+" - Read/write mode, file is truncated. Opens an empty
file for both reading and writing. If the file exists
(before the function is called), its contents will be
destroyed. If the file does not exist or cannot be found,
the function call will fail.
Return Value
The file number. If the file cannot be opened, -1 is returned and the code is
halted.
Related Functions
379
380
See Also
File Functions
FilePrint
Description
Syntax
Return Value
Related Functions
Example
See Also
File Functions
FileRead
Description
Syntax
Reads a number of characters from a file. The string can contain less characters
than requested if the end of file is reached. A maximum of 255 characters can be
read in each call.
FileRead(File, Length)
File: . . . . . . . . . . . . . The file number.
Length: . . . . . . . . . . The number of characters to read.
Return Value
Related Functions
Example
File Functions
FileReadBlock
Description
Syntax
Reads a number of characters from a file. The buffer can contain less characters
than requested if the end of file is reached. A maximum of 255 characters can be
read in each call. The data should be treated as a binary data and should not be
passed to string functions. You may use StrGetChar() function to extract each
character from the buffer, or pass the buffer to another function which will
accept binary data.
FileReadBlock(File, Buffer, Length)
File: . . . . . . . . . . . . . The file number.
Buffer: . . . . . . . . . . . The buffer to return the binary data. This may be a string or a
string packed with binary data. The string terminator is
ignored and the length argument specifies the number of
characters to write.
Length: . . . . . . . . . . The number of characters to read.
Return Value
Related Functions
Example
The number of characters read from the file. When the end of the file is found 0
will be returned. If an error occurs -1 will be returned and IsError() will return
the error code.
FileOpen, FileClose, FileRead, FileWriteBlock, StrGetChar
// read binary file and copy to COM port
length = FileReadBlock(File, buf, 128);
WHILE length > 0 DO
ComWrite(hPort, buf, length, 0);
length = FileReadBlock(File, buf, 128);
END
See Also
File Functions
FileReadLn
Description
Reads a line from a file. Up to 255 characters can be returned. The carriage return
and newline characters are not returned. If the line is longer than 255 characters,
the error overflow (code 275) is returned - you should call this function again to
read the rest of the line.
381
382
FileReadLn(File)
File: . . . . . . . . . . . . . The file number.
Return Value
Related Functions
Example
See Also
File Functions
FileRename
Description
Syntax
Renames a file.
FileRename(Oldname, Newname)
Oldname: . . . . . . . . The original name of the file.
Newname: . . . . . . . . The new name of the file.
Return Value
Related Functions
Example
See Also
File Functions
FileRichTextPrint
Description
Syntax
Prints the rich text file sFilename to the printer given by sPortname.
FileRichTextPrint(sFilename, sPortName)
See Also
File Functions
FileSeek
Description
Syntax
383
384
See Also
File Functions
FileSetTime
Description
Syntax
FileSetTime(File, iTime)
File: . . . . . . . . . . . . . The file number.
iTime: . . . . . . . . . . . The new file time, in the CitectSCADA time/date variable
format.
Return Value
Related Functions
Example
See Also
File Functions
FileSize
Description
Syntax
See Also
File Functions
FileSplitPath
Description
Syntax
Splits a file path into individual string components. You enter the full path
string as sPath. The individual components of the path name are returned in the
arguments sDrive, sDir, sFile, and sExt.
FileSplitPath(sPath, sDrive, sDir, sFile, sExt)
sPath: . . . . . . . . . . . The full path string.
sDrive: . . . . . . . . . . The disk drive.
sDir: . . . . . . . . . . . . The directory string.
sFile: . . . . . . . . . . . . The file name (without the extension).
sExt: . . . . . . . . . . . . The file extension.
Return Value
Related Functions
Example
See Also
FileWrite
Description
Syntax
Writes a string to a file. The string is written at the current file position.
FileWrite(File, String)
File: . . . . . . . . . . . . . The file number.
String: . . . . . . . . . . The string to write.
Return Value
385
386
See Also
File Functions
FileWriteBlock
Description
Syntax
Writes a string or buffer to a file. The data is written at the current file position.
You may create the binary data by using the StrSetChar function or by reading
the data from some other function. This function is similar to the FileWrite()
function however you specify the length of data to write to the file. The
FileWrite() function will send the data to the file until the sting terminator is
found. FileWriteBlock() will ignore any string terminator and copy the length of
bytes to the file. This allows this function to be used for binary data transfer.
FileWriteBlock(File, Buffer, Length)
File: . . . . . . . . . . . . . The file number.
Buffer: . . . . . . . . . . . The data to write to the file. This may be a string or a string
packed with binary data. The string terminator is ignored
and the length argument specifies the number of characters
to write.
Length: . . . . . . . . . . The number of characters to write. The maximum number of
characters you may write in one call is 255. (If you use a
string without a terminator in a function that expects a
string, or in a Cicode expression, you could get invalid
results.) To use the string to build up a buffer, you do not
need the terminating 0 (zero).
Return Value
Related Functions
Example
The number of characters written to the file. If an error occurs -1 will be returned
and IsError() will return the error code.
FileOpen, FileClose, FileWrite, FileReadBlock, StrSetChar
STRING buf;
FOR I = 0 TO 20 DO
StrSetChar(buf, I, I); // put binary data into string
END
! Write binary data to the file.
FileWrite(File, buf, 20);
File Functions
FileWriteLn
Description
Syntax
Return Value
Related Functions
Example
The number of characters written (including the carriage return and newline
characters).
FileOpen, FileClose, FileWrite
! Write a line to the file.
FileWriteLn(File,"Line of file data");
See Also
File Functions
FormActive
Description
Syntax
Return Value
Related Functions
Example
See Also
387
388
FormAddList
Description
Adds a text string to a list box or combo box. You should call this function only
after the FormNew() function, and immediately after either the
FormComboBox() or the FormListBox(), and before the FormRead() function.
The text is added at the end of the list box or combo box.
To add text to a form that is already displayed, use the FormListAddText()
function, and use the FormListSelectText() function to highlight text on the list.
Syntax
FormAddList(sText)
sText: . . . . . . . . . . . The text string to add to the list box or combo box.
Return Value
Related Functions
Example
See Also
FormButton
Description
Adds a button to the current form. You can add buttons that run callback
functions (specified in Fn) to perform any actions you need, as well as the
standard buttons - an [OK] button to save the operator's entries and close the
form, and a [Cancel] button to close the form but discard the changes.
You should call this function only after the FormNew() function and before the
FormRead() function. The button is added to the form at the specified column
and row position. The width of the button is automatically sized to suit the text.
Syntax
See Also
",
",
",
",
FindMenu, 0);
ShowTag, 0);
KillForm, 0);
GotoPg, 0);
Form Functions
FormCheckBox
Description
Adds a check box to the current form. The check box is a form control that allows
the operator to make individual selections. Each check box can be either checked
(true) or cleared (false).
389
390
Return Value
Related Functions
Example
The field handle if the check box is successfully added, otherwise -1 is returned.
FormNew, FormRead
! Create a form, add check boxes, and display the form.
! The operator may select none or all of the check boxes.
FUNCTION
FnMenu()
STRING sNuts, sCherrys, sChocolate;
sNuts = "1";
sCherrys= "0";
sChocolate= "1";
FormNew("IceCream",20,6,1);]
FormCheckBox(2 ,2,"Nuts",sNuts);
FormCheckBox(2, 3,"Cherrys",sCherrys);
FormCheckBox(2 ,4,"Chocolate",sChocolate);
FormRead(0);
If sNuts = "1" THEN
! add the nuts
END
IF sCherrys = "1" THEN
! add the cherrys
END
IF sChocolate = "1" THEN
See Also
Form Functions
FormComboBox
Description
Adds a combo box to the current form. A combo box is a form control that
allows the operator to type a selection or make a single selection from a text list.
You should call this function only after the FormNew() function and before the
FormRead() function. The combo box is added to the form at the specified
column and row position with the specified width and height. If more items are
placed in the list than the list can display, a scroll bar displays (to scroll to the
hidden items).
Use the FormAddList() function to add items for display in the list box. If the
form is already displayed, you can use the FormListAddText() and
FormListSelectText() functions to add (and highlight) text in the list box.
Syntax
391
392
Example
The field handle if the combo box is successfully added, otherwise -1 is returned.
FormNew, FormRead, FormAddList, FormListAddText,
FormListSelectText, FormListBox
! Create a form, add combo box and then display the form
! the operator may type in or select one of the items from the list
FUNCTION
FnMenu()
STRING sBuf;
FormNew("Select Item",20,6,1);
FormComboBox(2 ,2, 15, 5, sBuf, 1);
FormAddList("Item One");
FormAddList("Item two");
FormAddList("Item three");
FormRead(0);
! sBuf should contain the selected item or entered text
END
See Also
Form Functions
FormCurr
Description
Syntax
Gets the form and field handles for the current form and field. You should call
this function only from within a callback function. You can then use the same
callback function for all forms and fields, regardless of how the boxes, buttons,
etc. on the forms are used. You should use this function with the FormGetInst()
function.
FormCurr(hForm, hField)
hForm: . . . . . . . . . . The form handle, returned from the FormNew() function.
The form handle identifies the table where all data on the
associated form is stored.
hField: . . . . . . . . . . . The field handle of the field currently selected.
Return Value
Related Functions
Example
Form Functions
FormDestroy
Description
Syntax
Destroys a form, i.e. removes it from the screen. Use this function (from an
event) to close a form.
FormDestroy(hForm)
hForm: . . . . . . . . . . The form handle, returned from the FormNew() function.
The form handle identifies the table where all data on the
associated form is stored.
Return Value
Related Functions
Example
See Also
Form Functions
FormEdit
Description
Syntax
Adds an edit field to the current form. You should call this function only after
the FormNew() function and before the FormRead() function. A user input/edit
box is added to the form at the specified column and row position. The operator
can enter or edit the text in the edit box. This text is then passed to this function
as Text.
FormEdit(Col, Row, Text, Width)
393
394
See Also
Form Functions
FormField
Description
Syntax
Adds a field control device (such as a button , check box, or edit field) to the
current form. You should call this function only after the FormNew() function
and before the FormRead() function. This function allows you to specify a
control device with more detail than the other field functions.
FormField(Col, Row, Width, Height, Type, Buffer, Text, Fn)
Col: . . . . . . . . . . . . . The number of the column in which the control will be
placed. Enter a number from 0 (column 1) to the form width 1. For example, to place the control in column 8, enter 7.
Row: . . . . . . . . . . . . The number of the row in which the control will be placed.
Enter a number from 0 (row 1) to the form height - 1. For
example, to place the control in row 6, enter 5.
Width: . . . . . . . . . . . The width of the control device.
The field handle if the field is successfully added, otherwise it will return -1.
FormNew
! Display a form with check boxes to start
!! specific motors.
FUNCTION
SelectMotor()
INT hform;
STRING check1 = "0";
STRING check2 = "0";
STRING check3 = "0";
hform = FormNew("Selection Menu", 26, 22, 6);
FormField(16, 1, 12, 1, 9, check1, "Primary ", 0);
FormField(16, 2, 12, 1, 9, check2, "Secondary", 0);
FormField(16, 3, 12, 1, 9, check3, "backup
", 0);
FormButton( 9, 20, " &Cancel ", 0, 2);
395
396
See Also
Form Functions
FormGetCurrInst
Description
Syntax
Extracts data associated with a field (set by the FormSetInst() function). You
should call this function only from within a field callback function. This function
is the same as calling the FormCurr() function and then the FormGetInst()
function.
FormGetCurrInst(iData, sData)
iData: . . . . . . . . . . . Integer data.
sData: . . . . . . . . . . . String data.
Return Value
Related Functions
Example
See Also
Form Functions
FormGetData
Description
Syntax
Gets all data associated with a form and puts it into the output string buffers.
Normally the field data is copied to the output string buffers only when the user
selects the [OK] button. If you want to use the data while the form is displayed,
call this function to get the data. You should call this function only while the
form is displayed, e.g. from a field callback function.
FormGetData(hForm)
hForm: . . . . . . . . . . The form handle, returned from the FormNew() function.
The form handle identifies the table where all data on the
associated form is stored.
Return Value
Related Functions
Example
See Also
Form Functions
FormGetInst
Description
Syntax
Extracts the data associated with a field (set by the FormSetInst() function). You
would normally use this function in a field callback function. It allows single
callback functions to know that the form and field are associated.
FormGetInst(hForm, hField, iData, sData)
hForm: . . . . . . . . . . The form handle, returned from the FormNew() function.
The form handle identifies the table where all data on the
associated form is stored.
hField: . . . . . . . . . . . The field handle of the field currently selected.
iData: . . . . . . . . . . . Integer data.
397
398
See Also
Form Functions
FormGetText
Description
Syntax
Gets the current text from a form field. You should call this function only while
the form is displayed; e.g., from a field callback function.
FormGetText(hForm, hField)
hForm: . . . . . . . . . . The form handle, returned from the FormNew() function.
The form handle identifies the table where all data on the
associated form is stored.
hField: . . . . . . . . . . . The field handle of the field currently selected.
Return Value
Related Functions
Example
See Also
Form Functions
FormGoto
Description
Syntax
Goes to a specified form. The form is displayed on top of all windows and the
keyboard focus is set to this form.
FormGoto(hForm)
hForm: . . . . . . . . . . The form handle, returned from the FormNew() function.
The form handle identifies the table where all data on the
associated form is stored.
Return Value
Related Functions
Example
See Also
Form Functions
FormGroupBox
Description
Adds a group box to the current form. A group box is a form control box drawn
to the specified size. If the box contains radio buttons, they are grouped together.
You should call this function only after the FormNew() function and before the
FormRead() function.
The group box is added to the form at the specified column and row position
with the specified width and height. Use the FormRadioButton() function to add
the radio buttons to the box, and call this function between each group of radio
buttons.
Syntax
399
400
The field handle if the group box is successfully added, otherwise -1 is returned.
FormNew, FormRead, FormRadioButton
! Create a form, add to radio buttons groups and then display the
form
! The operator may select one of the radio buttons from each group
FUNCTION
FnMenu()
STRING sFast, sSlow, sMedium;
STRING sNorth, sSouth, sEast, sWest;
FormNew("Select Item",40,7,1);
FormGroupBox(1 ,1, 15, 5, "Speed");
FormRadioButton(2 ,2,"Fast", sFast);
FormRadioButton(2, 3,"Medium", sMedium);
FormRadioButton(2 ,4,"Slow", sSlow);
FormGroupBox(19 ,2, 15, 6, "Direction");
FormRadioButton(20 ,2,"North", sNorth);
FormRadioButton(20, 3,"South", sSouth);
FormRadioButton(20 ,4,"East", sEast);
FormRadioButton(20 ,5,"West", sWest);
FormRead(0);
END
See Also
Form Functions
FormInput
Description
Syntax
Adds a prompt and edit field to the current form. You should call this function
only after the FormNew() function and before the FormRead() function. When
FormRead() is called, the form will display with the prompt and edit box. The
operator's input is passed back as a string (Text).
FormInput(Col,Row,Prompt,Text,Width)
Form Functions
FormListAddText
Description
Syntax
Adds a new text entry to a combo box or a list box while the form is displayed. It
only adds the text to the list - it does not select it. Use the FormListSelectText()
function to select (highlight) an entry. Call this function only when the form is
displayed, e.g. from a field callback function.
FormListAddText(hForm, hField, Text)
hForm: . . . . . . . . . . The form handle, returned from the FormNew() function.
The form handle identifies the table where all data on the
associated form is stored.
hField: . . . . . . . . . . . The field handle of the field currently selected.
Text: . . . . . . . . . . . . The output text string containing the operator's input.
Return Value
Related Functions
Example
401
402
See Also
Form Functions
FormListBox
Description
Adds a list box to the current form. The list box is a form control that allows the
operator to select from a list of items. You should call this function only after the
FormNew() function and before the FormRead() function.
The list box is added to the form at the specified column and row position with
the specified width and height. If more items are placed in the list than the list
can display, a scroll bar displays for scrolling to the hidden items.
Use the FormAddList() function to add items for display in the list box. If the
form is already displayed, you can use the FormListAddText() and
FormListSelectText() functions to add (and highlight) text in the list box.
Syntax
Example
The field handle if the list box is successfully added, otherwise -1 is returned.
FormNew, FormRead, FormAddList, FormListAddText,
FormListSelectText, FormComboBox
! Create a form, add list box and then display the form.
! The operator may select one of the items from the list.
STRING sBuf;
FUNCTION
FnMenu()
FormNew("Select Item",20,6,1);
FormListBox(2 ,2, 15, 5, sBuf, 1);
FormAddList("Item One");
FormAddList("Item two");
FormAddList("Item three");
FormButton(0,0," OK ",0,1);
FormButton(5,0," CANCEL ",0,2);
FormRead(0);
SELECTION= sBuf;
See Also
Form Functions
FormListDeleteText
Description
Syntax
Deletes an existing text entry from a combo box or a list box while the form is
displayed. It only deletes the text from the list - it does not change the selection.
Call this function only when the form is displayed, e.g. from a field callback
function.
FormListDeleteText(hForm, hField, Text)
hForm: . . . . . . . . . . The form handle, returned from the FormNew() function.
The form handle identifies the table where all data on the
associated form is stored.
hField: . . . . . . . . . . . The field handle of the field currently selected.
Text: . . . . . . . . . . . . The text to delete.
Return Value
403
404
FormListSelectText, FormListAddText
/* create a form with a list */
hForm = FormNew("Ingredients", 40, 10, 1);
hField = FormListBox(2,2,20,5,sBuf);
FormAddList("Flour");
FormAddList("Water");
FormAddList("Salt");
FormAddList("Sugar");
/* Display the form */
FormRead(1);
:
:
/*Remove Sugar from the list */
FormListDeleteText(hForm, hField, "Sugar");
:
:
See Also
Form Functions
FormListSelectText
Description
Syntax
Selects (highlights) a text entry in a Combo box or a List box while the form is
displayed. The text to be selected must exist in the list. (Use the
FormListAddText() function to add a text entry to a list.) Call this function only
when the form is displayed, e.g. from a field callback function.
FormListSelectText(hForm, hField, Text)
hForm: . . . . . . . . . . The form handle, returned from the FormNew() function.
The form handle identifies the table where all data on the
associated form is stored.
hField: . . . . . . . . . . . The field handle of the field currently selected.
Text: . . . . . . . . . . . . The text to be selected. If this text is not present in the list,
then no item will be selected (and this text will not be added).
Return Value
Related Functions
FormListAddText, FormSetText
Example
FormRead(1);
:
:
/*Select Flour */
FormListSelectText(hForm, hField, "Flour");
See Also
Form Functions
FormNew
Description
Creates a new data entry form and defines its size and mode. After the form is
created, you can add fields, and then display the form.
Before you can display a form on the screen, you must call this function to set
the size and mode of the form, and then call the various form field functions,
FormInput(), FormButton(), FormEdit() etc to add user input fields to the form.
To display the form on the screen (to allow the user to enter data) call the
FormRead() function.
Syntax
405
406
32
128 - The form will not close if the ESC or ENTER key is
pressed, unless you specifically define at least one
button on the form which acts as an OK or Cancel
button. For a form with no buttons, the ENTER key
normally closes the form; this mode disables that
behaviour.
Multiple modes can be selected by adding them (for example, to use Modes 4
and 2, specify Mode 6).
Return Value
Related Functions
Example
The form handle if the form is created successfully, otherwise -1 is returned. The
form handle identifies the table where all data on the associated form is stored.
FormDestroy, FormInput, FormButton, FormEdit, FormRead
FormNew("Recipe",30,5,0);
FormInput(1,1,"Recipe No",Recipe,20);
FormInput(1,2,"Amount",Amount,10);
FormRead(0);
See Also
Form Functions
FormNumPad
Description
Syntax
Provides a keypad form for the operator to add numeric values. You can
customize the standard form as a mathematical keypad, with the +, -, and /
operators and the decimal point. For a time keypad, use the AM, PM, and :
(hour/minute divider) buttons. You can also include a password edit field.
FormNumPad(Title, Input, Mode)
Title: . . . . . . . . . . . . The title to display on the number pad form.
Input: . . . . . . . . . . . The existing or default value. This value is returned if the
form is cancelled or accepted without changes.
Mode: . . . . . . . . . . . The buttons to include on the keypad form. The Mode can be
a combination of the following:
0 - Standard keypad
1 - Password edit field
Example
The string value entered by the operator. The IsError() function returns 0 (zero).
If the form was cancelled, the value of Input is returned, and the IsError()
function returns error number 299.
/* Set defaults first, then four keypad forms to adjust recipe. */
Qty_Flour=FormNumPad("Add Flour", Qty_Flour, 17);
Qty_Water=FormNumPad("Add Water", Qty_Water, 17);
Qty_Salt=FormNumPad("Add Salt", Qty_Salt, 17);
Qty_Sugar=FormNumPad("Add Sugar", Qty_Sugar, 17);
See Also
Form Functions
FormOpenFile
Description
Syntax
where:
File Type is the text that displays in the drop box, for
example All Files (*.*). Filter is the file type, for example
*.CI
Return Value
Related Functions
The name and full path of the selected file (as a string) or an empty string ("") if
the Cancel button is selected.
FormSaveAsFile, FormSelectPrinter
407
408
// Display the Open File dialog with the following filter list:
// All Files (*.*)
// Exe Files (*.EXE)
// Cicode Files (*.CI)
sFilename = FormOpenFile("Open", "*.CI", "All Files (*.*)|*.*|Exe
Files (*.EXE)|*.EXE|Cicode Files (*.CI)|*.CI|");
See Also
Form Functions
FormPassword
Description
Adds both a password prompt and edit field to the current form. You should
call this function only after the FormNew() function and before the FormRead()
function. When FormRead() is called, the form will also display the password
prompt and edit field.
The operator's input is not echoed in the field; a single asterisk (*) is displayed
for each character.
Syntax
Return Value
Related Functions
Example
See Also
Form Functions
FormPosition
Description
Syntax
Sets the position of a form on the screen, before it is displayed. You should call
this function only after the FormNew() function and before the FormRead()
function.
FormPosition(X, Y, Mode)
X, Y: . . . . . . . . . . . . The x and y pixel coordinates of the form.
Mode: . . . . . . . . . . . Not used (set to 0).
Return Value
Related Functions
Example
See Also
Form Functions
FormPrompt
Description
Syntax
Adds a prompt field to the current form. You should call this function only after
the FormNew() function and before the FormRead() function.
FormPrompt(Col, Row, Prompt)
Col: . . . . . . . . . . . . . The number of the column in which the prompt will be
placed. Enter a number from 0 (column 1) to the form width 1. For example, to place the prompt in column 8, enter 7.
Row: . . . . . . . . . . . . The number of the row in which the prompt will be placed.
Enter a number from 0 (row 1) to the form height - 1. For
example, to place the prompt in row 6, enter 5.
Prompt: . . . . . . . . . . The prompt string.
Return Value
Related Functions
See Also
Form Functions
409
410
FormRadioButton
Description
Adds a radio button to the current form, allowing the operator to make a
selection from a multiple choice list. You should call this function only after the
FormNew() function and before the FormRead() function.
The radio button is added to the form at the specified column and row position.
The width of the button will be sized to suit the text.
By default, all radio buttons are placed into the one group. If you require
separate groups, use this function in conjunction with the FormGroupBox()
function.
Syntax
Return Value
Related Functions
Example
See Also
Form Functions
FormRead
Description
Displays the current form (created with the FormNew() function), with all the
fields that were added (with the form field functions).
You can display the form and wait for the user to finish entering data by setting
the Mode to 0. This mode is the most commonly used, with [OK] and [Cancel]
buttons to either save or discard operator entries and to close the form.
To display the form and return before the user has finished, use Mode 1. This
mode is used to animate the data on the form or to perform more complex
operations.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
Syntax
FormRead(Mode)
Mode: . . . . . . . . . . . Mode of the form:
0 - Wait for the user.
1 - Do not wait for the user.
Return Value
Related Functions
411
412
See Also
Form Functions
FormSaveAsFile
Description
Syntax
where:
File Type is the text that displays in the drop box, for
example All Files (*.*). Filter is the file type, for example
*.CI
sDefExt: . . . . . . . . . The file extension that will be used as a default when you use
the FormSaveAsFile() function. If you do not specify a
default extension, files will be saved without an extension.
Return Value
Related Functions
Example
The name and full path of the selected file (as a string) or an empty string ("") if
the Cancel button is selected.
FormOpenFile, FormSelectPrinter
// Display the SaveAs dialog with the following filter list:
// All Files (*.*)
See Also
Form Functions
FormSelectPrinter
Description
Syntax
Return Value
Related Functions
Example
See Also
Form Functions
FormSetData
Description
Syntax
Sets all the edit data from the string buffers into the form. You should call this
function only while the form is active.
FormSetData(hForm)
hForm: . . . . . . . . . . The form handle, returned from the FormNew() function.
The form handle identifies the table where all data on the
associated form is stored.
Return Value
Related Functions
Example
413
414
See Also
Form Functions
FormSetInst
Description
Syntax
Associates an integer and string value with each field on a form. This data could
then be used by a callback function. You can use a single callback function for all
fields, and use the data to perform different operations for each field.
FormSetInst(hForm, hField, iData, sData)
hForm: . . . . . . . . . . The form handle, returned from the FormNew() function.
The form handle identifies the table where all data on the
associated form is stored.
hField: . . . . . . . . . . . The field handle of the field currently selected.
iData: . . . . . . . . . . . Integer data.
sData: . . . . . . . . . . . String data.
Return Value
Related Functions
Example
See Also
Form Functions
FormSetText
Description
Sets new field text on a field. This function allows you to change field text while
the form is displayed. Call this function only when the form is displayed, e.g.
from a field callback function.
Return Value
Related Functions
Example
See Also
Form Functions
FormWndHnd
Description
Gets the window handle for the given form. The window handle may be used by
'C' programs and CitectSCADA Wnd... functions. You should call this function
only after the FormNew() function and before the FormRead() function.
The window handle is not the same as the CitectSCADA window number and
cannot be used with functions that expect the CitectSCADA window number
(the Win... functions).
Syntax
FormWndHnd(hForm)
hForm: . . . . . . . . . . The form handle, returned from the FormNew() function.
The form handle identifies the table where all data on the
associated form is stored.
415
416
See Also
Form Functions
FmtClose
Description
Syntax
Closes a format template. After it is closed, the template cannot be used. Closing
the template releases system memory.
FmtClose(hFmt)
hFmt: . . . . . . . . . . . The format template handle, returned from the FmtOpen()
function. The handle identifies the table where all data on the
associated format template is stored.
Return Value
Related Functions
Example
FmtClose(hFmt);
See Also
Format Functions
FmtFieldHnd
Description
Syntax
Gets the handle of a field in a format template. You can then use the field handle
in the FmtGetFieldHnd() and FmtSetFieldHnd() functions. By using a handle,
you only need to resolve the field name once and then call other functions as
required (resulting in improved performance.)
FmtFieldHnd(hFmt, Name)
The handle of the format template field, or -1 if the field cannot be found.
FmtGetFieldHnd, FmtSetFieldHnd
!Resolve names at startup.
hName=FmtFieldHnd(hFmt,"Name");
hDesc=FmtFieldHnd(hFmt,"Desc");
!Set field data.
FmtSetFieldHnd(hFmt,hName,"CV101");
See Also
Format Functions
FmtGetField
Description
Syntax
Gets field data from a format template. Use this function to extract data after a
call to StrToFmt().
FmtGetField(hFmt, Name)
hFmt: . . . . . . . . . . . The format template handle, returned from the FmtOpen()
function. The handle identifies the table where all data on the
associated format template is stored.
Name: . . . . . . . . . . . The field name.
Return Value
Related Functions
Example
The data (as a string). If the field does not contain any data, an empty string will
be returned.
StrToFmt, FmtSetField, FmtToStr
StrToFmt(hFmt,"CV101 Raw Coal Conveyor");
Str=FmtGetField(hFmt,"Name");
! Str will contain "CV101".
See Also
Format Functions
417
418
FmtGetFieldHnd
Description
Syntax
Gets field data from a format template. Use this function to extract data after a
call to StrToFmt(). This function has the same effect as FmtGetField(), except that
you use a field handle instead of the field name.
FmtGetFieldHnd(hFmt, hField)
hFmt: . . . . . . . . . . . The format template handle, returned from the FmtOpen()
function. The handle identifies the table where all data on the
associated format template is stored.
hField: . . . . . . . . . . . The field handle.
Return Value
Related Functions
Example
The data (as a string). If the field does not contain any data, an empty string will
be returned.
StrToFmt, FmtFieldHnd
StrToFmt(hFmt,"CV101 Raw Coal Conveyor");
hField=FmtFieldHnd(hFmt,"Name");
Str=FmtGetField(hFmt,hField);
! Str will contain "CV101".
See Also
Format Functions
FmtOpen
Description
Syntax
Creates a format template. After you create a template, you can use it for
formatting data into strings or extracting data from a string. To format a
template, use the same syntax as a device format, i.e.
{<name>[,width[,justification]]}.
FmtOpen(Name, Format, Mode)
Name: . . . . . . . . . . . The name of the format template.
Format: . . . . . . . . . . The format of the template, as
{<name>[,width[,justification]]}.
Mode: . . . . . . . . . . . The mode of the open:
0 - Open the existing format.
1 - Open a new format.
Return Value
FmtClose
hFmt=FmtOpen("MyFormat","{Name}{Desc,20}",0);
FmtSetField(hFmt,"Name", "CV101");
FmtSetField(hFmt,"Desc","Raw Coal Conveyor");
Str =FmtToStr(hFmt);
! Str will contain "CV101 Raw Coal Conveyor".
See Also
Format Functions
FmtSetField
Description
Syntax
Sets data in a field of a format template. After you have set all the fields, you can
build the formatted string with the FmtToStr() function.
FmtSetField(hFmt, Name, Data)
hFmt: . . . . . . . . . . . The format template handle, returned from the FmtOpen()
function. The handle identifies the table where all data on the
associated format template is stored.
Name: . . . . . . . . . . . The name of the format template.
Data: . . . . . . . . . . . . Field data.
Return Value
Related Functions
Example
See Also
Format Functions
FmtSetFieldHnd
Description
Syntax
The fields, you can build the formatted string with the FmtToStr() function. This
function has the same effect as FmtSetField() except that you use a field handle
instead of the field name.
FmtSetFieldHnd(hFmt, hField, Data)
419
420
Format Functions
FmtToStr
Description
Syntax
Builds a formatted string from the current field data (in a format template).
FmtToStr(hFmt)
hFmt: . . . . . . . . . . . The format template handle, returned from the FmtOpen()
function. The handle identifies the table where all data on the
associated format template is stored.
Return Value
Related Functions
Example
See Also
Format Functions
FTPClose
Description
Syntax
Return Value
See Also
FTPOpen
INT hFtp;
hFtp = FtpOpen("", "", "");
.
.
.
.
FtpClose(hFtp);
FTP Functions
FTPFileCopy
Description
Syntax
Copies a file from the FTP server to the Internet Display Client. Before calling
this function, you must call FtpOpen().
FTPFileCopy(hndFTP, sSrcPath, sDestPath)
hndFTP: . . . . . . . . . The handle of a valid FTP session, as returned by FTPOpen().
sSrcPath: . . . . . . . . The file name and path of the file to be copied from the FTP
Server to the Internet Display Client. This can be any FTP
server.
sDestPath: . . . . . . . The destination of the copied file (including the name of the
file).
Return Values
Related Functions
See Also
FTPOpen, FTPFileFind
FTP Functions
FTPFileFind
Description
Finds a file on the FTP server that matches a specified search criteria. Before you
can call this function, you must call FTPOpen().
To find a list of files, you must first call this function twice - once to find the first
file, then again with an empty path to find the remaining files. After the last file
is found, an empty string is returned.
421
422
FTPFileFind(hndFTP, sPath)
hndFTP: . . . . . . . . . The handle of a valid FTP session, as returned by FTPOpen().
sPath: . . . . . . . . . . . The path you wish to search for the desired file. Do not use
path substitution here.
Return Value
Related Functions
Example
The full path and filename. If no files are found, an empty string is returned.
FTPFileCopy, FTPOpen
INT hFtp;
STRING sFindPath;
STRING sPath;
sFindPath = "\User\Example\*.RDB";
hFtp = FtpOpen("", "", "");
sPath = FtpFileFind(hFtp, sFindPath);
WHILE StrLength(sPath) > +0 DO
sPath = FtpFileFind(hFtp, "");
END
FtpClose(hFtp);
See Also
FTP Functions
FTPOpen
Description
Syntax
Return Value
Related Functions
A handle to the FTP server otherwise -1 if an error occurs (e.g. the server cannot
be found).
FTPClose
FTP Functions
FullName
Description
Syntax
Return Value
Related Functions
Example
Gets the full name of the user who is currently logged-in to the system.
FullName()
The user name (as a string).
Name, UserInfo
/* Display the full name of the current user at AN20. */
DspText(20, 0, FullName());
See Also
Security Functions
FuzzyClose
Description
Syntax
Frees all memory and information for the specified instance. After the fuzzy
instance is closed, the handle given in the hFuzzy parameter is no longer valid.
FuzzyClose(hFuzzy)
hFuzzy: . . . . . . . . . . The fuzzy instance handle (and integer greater than 0).
Return Value
Related Functions
Example
See Also
FuzzyGetCodeValue
Description
Syntax
423
424
Related Functions
Example
See Also
The code value if the function was successful. Use IsError() to find the error
number if the function fails.
FuzzyOpen, FuzzySetCodeValue.
See FuzzyOpen.
FuzzyTech Functions
FuzzyGetShellValue
Description
Syntax
Gets a value for the specified input of the specified instance. The variables in the
instance must have the data type REAL (floating point values).
FuzzyGetShellValue(hFuzzy, iIOIndex, NoHitFlag)
hFuzzy: . . . . . . . . . . The fuzzy instance handle (and integer greater than 0).
iIOIndex: . . . . . . . . Specifies the variable to receive the value. The I/O-Indices
start with 0 and increment by 1 for each variable. To find the
correct index for a specific variable, the variables must be
sorted in alpha-numerical order, first the inputs and then the
outputs.
NoHitFlag: . . . . . . . Variable to receive the new value of the No-hit-flag. The Nohit-flag is TRUE if no rule was active for the variable
specified by iIOIndex, otherwise it is FALSE. This must be a
Cicode variable of INT type - it cannot be a constant or PLC
variable tag.
Return Value
Related Functions
The shell value if the function was successful. Use IsError() to find the error
number if the function fails.
FuzzyOpen, FuzzySetShellValue.
See FuzzyOpen.
FuzzyTech Functions
FuzzyOpen
Description
This function loads a *.FTR file, allocates memory and creates a handle for this
fuzzy instance. To use the FuzzyTech functions you must be a registered user of
one or more of the following fuzzyTech products: fuzzyTECH Online Edition,
fuzzyTECH Precompiler Edition, or fuzzyTECH for Business PlusC. And you
must only use fuzzyTECH to generate the *.FTR file for FTRUN.
The application must call the FuzzyClose function to delete each fuzzy instance
handle returned by the FuzzyOpen function.
Syntax
FuzzyOpen(sFile)
sFile: . . . . . . . . . . . . Specifies the filename of the .FTR file to load.
Return Value
Related Functions
Example
The handle to the fuzzy instance, or -1 if the function fails. Use IsError() to find
the error number.
FuzzyClose, FuzzyGetShellValue, FuzzySetShellValue,
FuzzyGetCodeValue, FuzzySetCodeValue, FuzzyTrace.
INT hFuzzy;
INT NoHitFlag;
INT Status;
REAL MemOutput;
// open the Fuzzy Tech runtime instance
hFuzzy = FuzzyOpen("C:\CITECT\BIN\TRAFFIC.FTR");
Status = IsError();
IF hFuzzy <> -1 THEN
MemOutput = PLCOutput;
WHILE Status = 0 DO
FuzzySetShellValue(hFuzzy, 0, 42.0);
FuzzySetShellValue(hFuzzy, 1, 3.14150);
MemOutput = FuzzyGetShellValue(hFuzzy, 2, NoHitFlag);
Status = IsError();
// Only write to PLC if output changes.
// This reduces load on PLC communication.
IF MemOutput <> PLCOutput THEN
PLCOutput = MemOutput;
END
SleepMS(500);
425
426
See Also
FuzzyTech Functions
FuzzySetCodeValue
Description
Syntax
Return Value
Related Functions
Example
See Also
FuzzySetShellValue
Description
Syntax
FuzzyTrace
Description
Syntax
Controls the trace process (starting and stopping) of the specified instance.
FuzzyTrace(hFuzzy, TraceOn)
hFuzzy: . . . . . . . . . . The fuzzy instance handle (and integer greater than 0).
TraceOn: . . . . . . . . . Specifies whether to start or to stop a trace process for the
Fuzzy instanse specified by hFuzzy. If this parameter is TRUE
(1), the trace process is started. If this parameter is FALSE (0),
the trace process is stopped.
Return Value
Related Functions
Example
See Also
GetArea
Description
Syntax
Return Value
Related Functions
Example
427
428
See Also
Miscellaneous Functions
GetBlueValue
Description
Syntax
Return Value
Related Functions
See Also
GetEnv
Description
Return Value
Example
See Also
Miscellaneous Functions
GetEvent
Description
Syntax
Gets the function handle of the existing callback event handler. You can use this
function handle in the ChainEvent() function to chain call the existing event
function, or in the SetEvent() function to restore the event handler.
GetEvent(Type)
Type: . . . . . . . . . . . . The type of event:
1 - A key has been pressed. When the user presses a key, the
callback function is called after CitectSCADA checks
for hot keys. If the return value is 0, CitectSCADA
checks for key sequences. If the return value is not 0,
CitectSCADA assumes that you will process the key
and does not check the key sequence. It is up to you to
remove the key from the key command line.
If you are using a right mouse button click as an event,
you should read about the ButtonOnlyLeftClick
parameter.
2
429
430
Related Functions
Example
The function handle of the existing callback event handler, or -1 if there are no
event handlers.
OnEvent, CallEvent, ChainEvent, SetEvent
! Get existing event handler.
hFn=GetEvent(0);
! Trap mouse movements.
OnEvent(0,MouseFn);
.
.
! Restore old event handler.
SetEvent(0,hFn);
INT
FUNCTION
MouseFn()
.
.
! Chain call old event handler.
RETURN ChainEvent(hFn);
END
See Also
Event Functions
GetGreenValue
Description
Syntax
431
432
GetPriv
Description
Syntax
Checks if the current user has a privilege for a specified area. With this function,
you can write your own Cicode functions to control user access to the system.
GetPriv(Priv, Area)
Priv . . . . . . . . . . . . . The privilege level (1..8).
Area . . . . . . . . . . . . . The area of privilege (0..255).
Return Value
Related Functions
Example
Returns 1 if the user has the specified privilege in the area, or 0 (zero) if the user
does not have the privilege.
SetArea
/* User must have privilege 2, or cannot do operation. */
IF GetPriv(2, 0) THEN
! Do operation here
ELSE
Prompt("No privilege for command");
END
See Also
Security Functions
GetRedValue
Description
Syntax
Return Value
Related Functions
Color Functions
GrpClose
Description
Syntax
Closes a group. The group is destroyed and the group handle becomes invalid.
You should close a group when it is not in use, to release the associated memory.
CitectSCADA closes all groups on shutdown.
GrpClose(hGrp)
hGrp . . . . . . . . . . . . The group handle, returned from the GrpOpen() function.
The group handle identifies the table where all data on the
associated group is stored.
Return Value
Related Functions
Example
See Also
Group Functions
GrpDelete
Description
Syntax
Deletes a single element or all elements from a group. You can also delete
another group from within the group.
GrpDelete(hGrp, Value)
hGrp: . . . . . . . . . . . The group handle, returned from the GrpOpen() function.
The group handle identifies the table where all data on the
associated group is stored.
Value: . . . . . . . . . . . The element to delete from the group, from 0 to 16375.
Return Value
433
434
GrpInsert, GrpOpen
! Delete 10 and 14 from a group.
GrpDelete(hGrp,10);
GrpDelete(hGrp,14);
See Also
Group Functions
GrpFirst
Description
Syntax
Gets the value of the first element in a group. The first element in the group is
the element with the lowest value. You can follow this function with a
GrpNext() call, to get the value of all the elements in a group.
GrpFirst(hGrp)
hGrp: . . . . . . . . . . . The group handle, returned from the GrpOpen() function.
The group handle identifies the table where all data on the
associated group is stored.
Return Value
Related Functions
Example
See Also
Group Functions
GrpIn
Description
Syntax
See Also
Group Functions
GrpInsert
Description
Syntax
Return Value
Related Functions
Example
See Also
Group Functions
GrpMath
Description
Syntax
435
436
See Also
Group Functions
GrpName
Description
Syntax
Return Value
Related Functions
Example
Group Functions
GrpNext
Description
Syntax
Gets the value of the next element in a group. You can get the value of all the
elements in a group. Call the GrpFirst() function to get the value of the first
element, and then call this function in a loop.
GrpNext(hGrp, Value)
hGrp: . . . . . . . . . . . The group handle, returned from the GrpOpen() function.
The group handle identifies the table where all data on the
associated group is stored.
Value: . . . . . . . . . . . The value returned from GrpFirst() or the latest GrpNext()
call.
Return Value
Related Functions
Example
The value of the next element in a group, or -1 if the end of the group has been
found.
GrpFirst
! Count all values in a group.
Count=0;
Value=GrpFirst(hGrp);
WHILE Value<>-1 DO
Count=Count+1;
Value=GrpNext(hGrp,Value);
END
Prompt("Number of values in group is "+Count:###);
See Also
Group Functions
GrpOpen
Description
Creates a group and returns a group handle, or gets the group handle of an
existing group. After you open a group, you can use the group number in
functions that use groups, e.g. SetArea() and AlarmSetInfo(). You can open a
group that is specified in the Groups database. You can also create groups at
runtime.
When you open a group that is defined in the database, a copy of the group is
made - the original group is not used. You can therefore change the values in the
group without affecting other facilities that use this group.
437
438
GrpOpen(Name, Mode)
Name . . . . . . . . . . . . The name of the group to open.
Mode . . . . . . . . . . . . The mode of the open:
0 - Open an existing group
1 - Create a new group
2 - Attempts to open an existing group. If the group does not
exist, it will create it.
Return Value
Related Functions
Example
The group handle , or -1 if the group cannot be created or opened. The group
handle identifies the table where all data on the associated group is stored.
GrpClose
! Open Plantwide group defined in the database.
hGrp=GrpOpen("Plantwide",0);
! Set current user area to Plantwide.
SetArea(hGrp);
GrpClose(hGrp);
! Set area to 1...10, 20 and 25 by creating a new group.
hGrp=GrpOpen("MyGrp",1);
StrToGrp(hGrp,"1..10,20,25");
SetArea(hGrp);
GrpClose(hGrp);
See Also
Group Functions
GrpToStr
Description
Syntax
Converts a group into a string of values separated by " , " and " .. ". You can then
display the group on the screen or in a report.
GrpToStr(hGrp)
hGrp: . . . . . . . . . . . The group handle, returned from the GrpOpen() function.
The group handle identifies the table where all data on the
associated group is stored.
Return Value
Related Functions
GrpOpen, StrToGrp
See Also
Group Functions
Halt
Description
Stops the execution of the current Cicode task and returns to CitectSCADA. This
function does not affect any other Cicode tasks that are running.
Use this function to stop execution in nested function calls. When Halt() is
called, Cicode returns to CitectSCADA and does not execute any return function
calls.
Syntax
Return Value
Related Functions
Example
See Also
Halt()
0 (zero) if successful, otherwise an error is returned.
Assert, TaskKill
INT
FUNCTION
MyFunc(INT Arg)
IF Arg<0 THEN
Prompt("Invalid Arg");
Halt();
END
.
.
END
Task Functions
HexToStr
Description
Syntax
Converts a number into a hexadecimal string. The string is the width specified
(padded with zeros).
HexToStr(Number, Width)
Number: . . . . . . . . . The number to convert.
Width: . . . . . . . . . . . The width of the string.
439
440
See Also
String Functions
HighByte
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
HighWord
Description
Syntax
Return Value
Related Functions
Example
Math/Trigonometry Functions
InfoForm
Description
Displays graphics object information for the object under the mouse pointer. If
there is no object directly under the mouse pointer, it displays information for
the nearest object. Each tag associated with the object is displayed, along with its
raw and engineering values and a button that displays all the details from the
Variable Tags form. The function also displays the Cicode expression, with any
result that the expression has generated.
This function only supports the display of simple Cicode expressions.
Syntax
Return Value
Related Functions
InfoForm(Mode)
0 (zero) if successful, otherwise an error is returned.
InfoFormAn
Example
System Keyboard
Key Sequence
Command
Comment
See Also
AnHelp
InfoForm();
Display graphics object help for the AN closest to
the cursor
Miscellaneous Functions
InfoFormAn
Description
Syntax
Displays graphics object information for a specified AN. This function displays
each tag associated with the object, along with its raw and engineering values
and a button that displays all the details from the Variable Tags form. The
function also displays the Cicode expression, with any result that the expression
has generated.
InfoFormAn(AN, Mode)
AN: . . . . . . . . . . . . . The AN of the graphics object for which information is
displayed.
Mode: . . . . . . . . . . . For security purposes, the Write button on the information
form displayed by this function can be disabled.
441
442
Example
System Keyboard
Key Sequence
Command
Comment
See Also
### AnHelp
InfoFormAn(Arg1);
Display graphics object help for a specified AN
Miscellaneous Functions
Input
Description
Displays a dialog box in which an operator can input a single value. The dialog
box has a title, a prompt, and a single edit field. For multiple inputs, use the
Form functions.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
Syntax
Return Value
Related Functions
Example
The edit field entry (as a string). If the user presses the Cancel button , an empty
string is returned and the IsError() function returns the error code 299.
Message, FormNew
/* Shut down CitectSCADA if the user inputs "Yes". */
See Also
Miscellaneous Functions
IntToReal
Description
Syntax
Return Value
Related Functions
Example
See Also
Miscellaneous Functions
IntToStr
Description
Syntax
Return Value
Related Functions
Example
See Also
String Functions
443
444
IODeviceControl
Description
Provides control of individual I/O devices. You might need to call this function
several times. If you use incompatible values for the various options of this
function, you may get unpredictable results.
For remote I/O Devices, you should only call this function on the I/O Server on
which the I/O Device is defined.
Syntax
445
446
1 - Daily
2 - Weekly
3 - Monthly
4 - Yearly
16 - Read all tags from the I/O Device. Data is unused - set it
to 0 (zero).
IODeviceInfo
Description
Syntax
IODeviceInfo(IODevice, Type)
IODevice: . . . . . . . . The number or name of the I/O device. If you call this
function from an I/O server, you can use the I/O device
name, enclosed in double quotes. If you call this function
from a client, you should use the I/O Device number.
Type: . . . . . . . . . . . . The type of information:
0
- Protocol address
447
448
- Disabled flag
11 - Unit number
12 - Configured I/O server name
13 - Configured Port name
14 - Configured startup mode
15 - Configured comment
16 - The primary I/O server name the client uses to
communicate to this device
17 - The I/O Server the client is using to communicate to this
device. Will be Standby if the Primary is down.
18 - State of the remote unit:
449
450
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
48
See Also
IODeviceStats
Description
Syntax
Return Value
Related Functions
Example
See Also
Gets statistical information for all I/O Devices, and displays the information in a
dialog box.
IODeviceStats()
0 (zero) if successful, otherwise an error is returned.
IODeviceInfo
IODeviceStats(); ! display all I/O Device information
IsError
Description
Gets the current error value. The error value is set when any error occurs, and is
reset after this function is called. You can call this function if user error-checking
is enabled or disabled.
You should call this function as soon as possible after the operation to be
checked, because the error code could be changed by the next error.
Syntax
IsError()
451
452
The current error value. The current error is reset to 0 after this function is called.
ErrSet
! Enable user error-checking.
ErrSet(1);
! Invalid ArcSine.
Ac=ArcSin(20.0);
! Sets ErrorVariable to 274 (invalid argument passed).
ErrorVariable=IsError()
See Also
Error Functions
KerCmd
Description
Syntax
Return Value
Related Functions
See Also
KeyAllowCursor
Description
Syntax
Allows (or disallows) the command cursor to move to the specified AN or to all
ANs. The command cursor normally moves only to ANs that have commands
defined.
KeyAllowCursor(AN, State)
AN: . . . . . . . . . . . . . The AN where the command cursor can move. If 0, all ANs
are implied.
State: . . . . . . . . . . . . Allow state:
0 - Do not allow the cursor to move to this AN.
See Also
Keyboard Functions
KeyBs
Description
Removes the last key from the key command line. If the key command line is
empty, this function will not perform any action.
You should call this function using a "Hot Key" command (as shown in the
example below), otherwise the backspace character is placed into the key
command line and the command does not execute. A "Hot Key" command is a
command that executes as soon as it is placed into the key command line.
Syntax
Return Value
Related Functions
KeyBs()
0 (zero) if successful, otherwise an error is returned.
KeyGet
Example
System Keyboard
Key Sequence
Command
Comment
*Bs
KeyBs()
Define a backspace Hot Key
453
454
See Also
Keyboard Functions
KeyDown
Description
Syntax
Return Value
Related Functions
Example
See Also
Moves the command cursor down the page to the closest AN. If an AN-Down
cursor override is specified (in the Page Keyboard database) for the graphics
page, the command cursor moves to that AN instead.
KeyDown()
0 (zero) if successful, otherwise an error is returned.
KeyUp, KeyLeft, KeyRight, KeyMove
See KeyDown.
Keyboard Functions
KeyGet
Description
Syntax
Return Value
Related Functions
Gets the last key code from the key command line. The key is removed from the
command line. Use this function to process the operator key commands directly.
You should call this function from the keyboard event function.
KeyGet()
The last key code from the key command line. If the key command line is empty,
0 (zero) is returned.
KeyPeek, KeyPut
See Also
Keyboard Functions
KeyGetCursor
Description
Syntax
Return Value
Related Functions
Example
Gets the AN at the position of the command cursor. If you are using groups, and
there are currently two command cursors, the AN for the innermost will be
returned. For example, if there is a cursor for a group as well as a cursor for one
of its objects, the AN for the object will be returned.
KeyGetCursor()
The AN at the position of the command cursor. If no cursor is visible, -1 is
returned.
KeySetCursor
! If the command cursor is on AN25:
AN=KeyGetCursor();
! Sets AN to 25.
See Also
Keyboard Functions
455
456
KeyLeft
Description
Syntax
Return Value
Related Functions
Example
See Also
Moves the command cursor left (across the page) to the closest AN. If an ANLeft cursor override is specified (in the Page Keyboard database) for the graphics
page, the command cursor moves to that AN instead.
KeyLeft()
0 (zero) if successful, otherwise an error is returned.
KeyRight, KeyUp, KeyDown, KeyMove
See KeyRight
Keyboard Functions
KeyMove
Description
Syntax
Return Value
Related Functions
Example
- Do not move
- Left
- Right
- Up
- Down
See Also
Keyboard Functions
KeyPeek
Description
Syntax
Gets the key code from the key command line (at a specified offset), without
removing the key from the key command line. AN offset of 0 returns the key
code from the last position in the key command line.
KeyPeek(Offset)
Offset: . . . . . . . . . . . The offset from the end of the key command line
Return Value
Related Functions
Example
See Also
Keyboard Functions
KeyPut
Description
Syntax
Puts an ASCII key code or Keyboard key code into the last position of the key
command line. If this key completes any command, that command will execute.
KeyPut(KeyCode)
KeyCode: . . . . . . . . . The key code to put into the key command line.
Return Value
Related Functions
Example
457
458
See Also
Keyboard Functions
KeyPutStr
Description
Syntax
Puts a string at the end of the key command line. The string can contain either
key names or data characters. If this string completes any command, that
command will execute.
KeyPutStr(String)
String: . . . . . . . . . . The string to put into the key command line.
Return Value
Related Functions
Example
See Also
Keyboard Functions
KeyReplay
Description
Replays the last key sequence (except for the last key, which would execute the
command). This function is useful when a command is to be repeated. To call
this function from the keyboard, use a Hot Key " * " (asterisk) command,
otherwise the KeyReplay() function itself is replayed.
Syntax
Return Value
Related Functions
Example
KeyReplay()
0 (zero) if successful, otherwise an error is returned.
KeyReplayAll
If the previous contents of the key command line were:
"START ABC ENTER"
KeyReplay();
See Also
Keyboard Functions
KeyReplayAll
Description
Replays the last key sequence and executes the command. To call this function
from the keyboard, use a Hot Key " * " (asterisk) command, otherwise the
KeyReplayAll() function itself is replayed.
Syntax
Return Value
Related Functions
Example
KeyReplayAll()
0 (zero) if successful, otherwise an error is returned.
KeyReplay
If the previous contents of the key command line were:
"START ABC ENTER"
KeyReplayAll();
! Replays "START ABC ENTER" and executes the command.
See Also
Keyboard Functions
KeyRight
Description
Syntax
Return Value
Related Functions
Example
See Also
Moves the command cursor right (across the page) to the closest AN. If an ANRight cursor override is specified (in the Page Keyboard database) for the
graphics page, the command cursor moves to that AN instead.
KeyRight()
0 (zero) if successful, otherwise an error is returned.
KeyUp, KeyDown, KeyLeft, KeyMove
See KeyLeft
Keyboard Functions
459
460
KeySetCursor
Description
Syntax
Return Value
Related Functions
Example
If the AN does not exist, or if a command does not exist at that AN, or if
KeyAllowCursor() has not been called, the return value is 1. Otherwise, the
function will return 0.
KeyGetCursor, KeyAllowCursor
! Move the command cursor to AN20.
KeySetCursor(20);
See Also
Keyboard Functions
KeySetSeq
Description
Syntax
Adds a keyboard sequence to the current page at runtime. The key sequence is
only added to the current window. When the page is closed, the keyboard
sequence is deleted.
KeySetSeq(sKeySeq, AN, Fn)
sKeySeq: . . . . . . . . . The keyboard sequence.
AN: . . . . . . . . . . . . . The AN where the keyboard sequence will apply. If you set
AN to 0 (zero), the keyboard sequence will apply to all ANs
on the page.
Fn: . . . . . . . . . . . . . The function to call when the keyboard sequence matches.
This function must be a callback function.
Return Value
Related Functions
/* Set the key sequence and call the "Callback" function when the
sequence is found. */
KeySetSeq("F2 ### Enter", 0, Callback);
! This function is called when the key sequence is found.
INT
FUNCTION
CallBack()
INT Value;
! Get user data.
Value=Arg1;
.
.
RETURN 0;
END
See Also
Keyboard Functions
KeyUp
Description
Syntax
Return Value
Moves the command cursor up the page to the closest AN. If an AN-Up cursor
override is specified (in the Page Keyboard database) for the graphics page, the
command cursor moves to that AN.
KeyUp()
0 (zero) if successful, otherwise an error is returned.
KeyDown, KeyLeft, KeyRight, KeyMove
Example
See Also
See KeyUp.
Keyboard Functions
LanguageFileTranslate
Description
Translates an ASCII file into a local language. Use this function to translate RTF
reports for viewing on Display Client screens.
The local language used by this function is specified by the
[Language]LocalLanguage parameter. You must set this parameter
accordingly.
Syntax
LanguageFileTranslate(sSourceFile, sDestFile)
461
462
1 if successful, otherwise 0.
SetLanguage, StrToLocalText
/* Translates the text in Shift.RTF and saves it in LShift.RTF. */
LanguageFileTranslate("c:\Citect\data\Shift.RTF","c:\Citect\data\
LShift.RTF");
/* Translates the text in [Data]:Shift.RTF and saves it in
[LocalData]:LShift.RTF. */
LanguageFileTranslate("[Data]:Shift.RTF","[LocalData]:LShift.RTF"
);
See Also
Miscellaneous Functions
LeaveCriticalSection
Description
Syntax
LeaveCriticalSection(sName)
sName: . . . . . . . . . . The name of the critical section. The name must be entered in
quotation marks.
Return Value
Related Functions
Example
See Also
Task Functions
Ln
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
Log
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
463
464
Login
Description
Logs a user into the CitectSCADA system, and gives users access to the areas
and privileges assigned to them in the Users database. Only one user can be
logged into a computer at any one time. If a user is already logged in when a
second user logs in, the first user is automatically logged out.
At startup, or when the user logs out, a default user is active, with access to area
0 (zero) and privilege 0 (zero) only. Use the LoginForm() function to display a
form for logging in to the system.
Syntax
Login(UserName, Password)
UserName: . . . . . . . The user's name, as defined in the Users database.
Password: . . . . . . . . The user's password, as defined in the Users database.
Return Value
Related Functions
Example
See Also
Security Functions
LoginForm
Description
Syntax
Return Value
Related Functions
LoginForm()
0 (zero) if successful, otherwise an error is returned.
Login
Example
System Keyboard
Login
Display the Login form
Allow user login
Buttons
Text
LoginForm
Comment
See Also
Operator Login
Display the Login form
Allow user login
Security Functions
Logout
Description
Syntax
Return Value
Related Functions
Example
Logs the current user out of the CitectSCADA system. CitectSCADA continues
to run, but with access to area 0 (zero) and privilege 0 (zero) only.
Logout()
0 (zero) if successful, otherwise an error is returned.
Login, LoginForm, LogoutIdle, UserInfo, Message, Input
/* Log the current user out of the system. */
Logout();
See Also
Security Functions
LogoutIdle
Description
Syntax
Sets an idle time for logging out the current user. If the current user does not
execute a command within the specified idle time, a prompt is displayed. If the
prompt is ignored, then the user is logged out. For all users to have the same idle
time, you would call this function at startup. Otherwise, you can call the
function from the Users database to specify an idle time for each user.
LogoutIdle(Idle)
Idle: . . . . . . . . . . . . . The number of minutes the user must be idle before logout
will occur. Set Idle to -1 to disable the current logout timeout.
Return Value
Related Functions
No return value.
Logout, Login, LoginForm
465
466
See Also
Operator1
LogoutIdle(5)
Logs the user out after five minutes
Security Functions
LowByte
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
LowWord
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
MailError
Description
Syntax
Return Value
Related Functions
Example
Gets the last mail error code. The error code is extracted from the MAPI mail
system, and explains what caused the MAPI function to fail.
MailError()
0 (zero) if successful, otherwise an error is returned. Refer also to MAPI errors.
MailLogon, MailLogoff, MailSend, MailRead
! Logon to the mail system
IF MailLogon("RodgerG", "password", 0) THEN
error = MailError();
!do what is required
END
See Also
Mail Functions
MailLogoff
Description
Syntax
Return Value
Related Functions
Example
Logs off from the mail system. You should log off the mail system when all mail
operations are complete. CitectSCADA automatically logs off the mail system on
shutdown.
MailLogoff()
0 (zero) if successful, otherwise an error is returned.
MailLogon, MailSend, MailRead
! Send the report to Rodger
MailLogon("Andrew", "password", 0);
MailSend("Rodger Gaff", "Report", "This is the weekly report",
"[data]:weekly.txt", 0);
MailLogoff();
See Also
Mail Functions
MailLogon
Description
Logs on to the mail system. You must call this function before any other mail
function.
467
468
Return Value
Related Functions
Example
See Also
Mail Functions
MailRead
Description
Reads a standard mail message. The mail message can contain text, an attached
file, or both.
Before you can use this function, you must use the MailLogon() function to log
on to the mail system. You can only read mail sent to the user name specified in
the MailLogon() function.
Syntax
See Also
Mail Functions
MailSend
Description
Sends a standard mail message. The mail message can contain text, an attached
file, or both.
Before you can use this function, you must use the MailLogon() function to log
on to the mail system. You can only send mail from the user name specified in
the MailLogon() function. You can send mail to any mail user or to another
Citect Display Client.
469
470
Return Value
Related Functions
Example
See Also
Mail Functions
MakeCitectColour
Description
MakeCitectColour(nRed,nGreen,nBlue)
nRed: . . . . . . . . . . . The color value for red, from 0-255
nGreen: . . . . . . . . . . The color value for green, from 0-255
nBlue: . . . . . . . . . . . The color value for blue, from 0-255
Return Value
Examples
See Also
Color Functions
Max
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
Message
Description
Displays a message box on the screen and waits for the user to select the OK or
Cancel button.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
471
472
- Stop Icon
32
- Question Icon
48
- Exclamation Icon
64
- Information Icon
Select more than one mode by adding the modes. For example, set Mode to 33 to
display the OK and Cancel buttons and the Question icon.
Return Value
Related Functions
Example
See Also
Miscellaneous Functions
Min
Description
Syntax
Return Value
Related Functions
Variable=Min(24,12);
! Sets Variable to 12.
See Also
Math/Trigonometry Functions
MsgBrdcst
Description
Syntax
Broadcasts a message to all the clients of a server. You should call this function
only on a CitectSCADA server. The message is only received by clients that have
a current message session (opened with the MsgOpen() function).
MsgBrdcst(Name, Type, Str)
Name: . . . . . . . . . . . The name of the CitectSCADA server.
Type: . . . . . . . . . . . . The message number.
Str: . . . . . . . . . . . . . The message text.
Return Value
Related Functions
Example
See Also
Task Functions
MsgClose
Description
Syntax
Closes a message. After the message is closed, the message post function (the
callback function specified in the MsgOpen() function) is not called if a message
is received. When the server side is closed, all clients are closed. When the client
side is closed, only the specified client is closed.
MsgClose(Name, hMsg)
Name: . . . . . . . . . . . The name of the CitectSCADA server.
hMsg: . . . . . . . . . . . The message handle, returned from the MsgOpen() function.
The message handle identifies the table where all data on the
associated message is stored.
Return Value
473
474
Task Functions
MsgGetCurr
Description
Gets the handle of the client message that called the report or remote procedure
that is currently running. You can call this function only in a report or a remote
procedure call.
If the report was called by a client, this function returns that client message
handle. The report can then send a message back to the client. If a function was
called remotely by MsgRPC(), this function returns the message handle for the
remote client.
Syntax
Return Value
Related Functions
Example
MsgGetCurr()
The handle for the client message. The message handle identifies the table where
all data on the associated message is stored. The function returns -1 if no client
called the report or function.
MsgOpen, MsgRPC
! Send message back to the client.
hMsg=MsgGetCurr();
IF hMsg<>-1 THEN
MsgRPC(hMsg,"Prompt","^"Hello Client from Report Server^"",1);
END
See Also
Task Functions
MsgOpen
Description
Syntax
Opens a message session with a CitectSCADA server. You can specify a message
post function - a callback function that is automatically called when a message
arrives. In this function you can call MsgRead() to get the message, and perform
other tasks common to your message sessions. You can then call MsgWrite() to
send a message back to the caller, MsgRPC() to call a procedure on the caller,
and so on.
MsgOpen(Name, Mode, Fn)
Related Functions
Example
The message handle, or -1 if the session cannot be opened. The message handle
identifies the table where all data on the associated message is stored.
MsgClose, MsgRead, MsgWrite, MsgRPC
! Open message on the Client Side
hClient=MsgOpen("Alarm", 0, MsgPostClient);
SELECT CASE hClient
CASE 1
MsgWrite(hClient,1,"MyMessage");
Prompt("Msg operation succeed!");
CASE -1
Prompt("Message session handle is invalid!");
475
476
See Also
Task Functions
MsgRead
Description
Reads a message from a message session. You can call this function only in a
message post function (the callback function specified in the MsgOpen()
function), to read the current message.
The Type and Str variables of this function return the message number and the
text of the message. The return value of this function is the message handle
(allowing a response to be sent back if required).
You must open the message session using the MsgOpen() function, to enable the
callback function.
Syntax
MsgRead(Type, Str)
Type: . . . . . . . . . . . . The message number.
Str: . . . . . . . . . . . . . The message text.
Return Value
Related Functions
Example
See Also
Task Functions
MsgRPC
Description
Calls a remote procedure on another CitectSCADA computer. You can call any
of the in-built Cicode functions remotely, or your own functions. You pass the
Name of the function as a string, not as the function tag, and pass all the
arguments for that function in Arg.
You can call the function in synchronous or asynchronous Mode. In
synchronous mode, MsgRPC() does not return until the remote function is called
and the result is returned. In asynchronous mode, MsgRPC() returns before the
function is called, and the result cannot be returned.
Syntax
477
478
Related Functions
Example
The result of the remote function call (as a string). If the function is called in
asynchronous mode the result of the remote function cannot be returned, so an
empty string is returned.
MsgOpen, MsgClose, MsgRead, MsgWrite
! Call remote procedure, call MyRPC() on server. Wait for result
Str=MsgRPC(hMsg,"MyRPC","Data",0);
! Call remote procedure, pass two strings. Don't wait for call to
complete.
! be careful of your string delimiters as shown.
MsgRPC(hMsg,"MyStrFn","^"First string^",^"Second string^"",1);
! Call remote procedure, pass Cicode string. Don't wait for call
to complete.
STRING sMessage = "this is a message";
MsgRPC(hMsg,"MyStrFn","^"" + sMessage + "^"",1);
! These functions could be used to acknowledge an alarm by record
from any CitectSCADA Client on the network.
! The AlmAck() function is initialized by the Display Client
(Don't forget that servers are also Display Clients.)
! The Alarm tag is passed into the function as a string and a
message is sent to the Alarms Server to initialize
! the AlmAckMsg() function.
FUNCTION
AlmAck(String AlmTag)
INT hAlarm1;
hAlarm1 = MsgOpen("Alarm", 0, 0);
MsgRPC(hAlarm1,"AlmAckMsg",AlmTag,1);
MsgClose("Alarm", hAlarm1);
END
! The AlmAckMsg() function is executed on the Alarms Server that
the Display Client is connected to. This could be
! either the primary or standby Alarms Server. The function
performs the alarm acknowledge.
FUNCTION
AlmAckMsg(String AlmTag)
AlarmAckRec(AlarmFirstTagRec(AlmTag,"",""));
END
Task Functions
MsgState
Description
Syntax
Verifies the status of a message session. Use MsgState() to check the return value
of MsgOpen(). A message post function is set effectively only if MsgState()
returns 1, which means the message session is online.
MsgState(hMsg)
hMsg: . . . . . . . . . . . The message handle, returned from the MsgOpen() function.
The message handle identifies the table where all data on the
associated message is stored.
Return Value
Related Functions
Example
MsgOpen
! Open message on the Client Side
hClient=MsgOpen("Alarm", 0, MsgPostClient);
SELECT CASE hClient
CASE 1
MsgWrite(hClient,1,"MyMessage");
Prompt("Msg operation succeed!");
CASE -1
Prompt("Message session is invalid!");
CASE 0
Prompt("Message session is offline!");
CASE 2
Prompt("Message session is connecting!");
CASE 3
Prompt("Message session is disconnecting!");
END SELECT
See Also
Task Functions
479
480
MsgWrite
Description
Syntax
Return Value
Related Functions
Example
See Also
Task Functions
Name
Description
Syntax
Return Value
Related Functions
Example
Gets the name of the operator who is currently logged-in to the display system.
If this function is called on a server, it returns the name of the local operator.
Name()
The name of the user (as a string).
FullName, Login, LoginForm
/* Display the user name of the current user at AN20. */
DspText(20,0,Name());
See Also
Security Functions
ObjectAssociateEvents
Description
Syntax
Allows you to change the ActiveX objects event class. If you have inserted an
object on a graphics page using Graphics Builder, it allows you to change the
event class to something other than the default of PageName_ObjectName
ObjectAssociateEvents(sEventClass hSource)
hSource: . . . . . . . . . The source object firing the events which are to be handled
by the event handler.
sClass: . . . . . . . . . . . The class of the object. You can use the objects human
readable name, its program ID, or its GUID. If the class does
not exist, the function will fail.
For example:
Return Value
Related Functions
Example
"MSCAL.Calendar.7" - Program ID
"{8E27C92B-1264-101C-8A2F-040224009C02}" - GUID
481
482
With the event class for the object now defined as "SludgeTank", the event
handlers can take the form "SludgeTank_Click".
This would be useful if you define event handlers in relation to an object that
will eventually be copied to other graphics pages, as it will eliminate the need to
redefine the event handlers to identify the default event class associated with
each new placement of the object.
See Also
ActiveX Functions
ObjectAssociatePropert
yWithTag
Description
Syntax
ObjectByName
Description
Syntax
Retrieves an ActiveX object. This is useful when you know the object by name
only (this will often be the case for objects created during configuration, rather
than those created at runtime using a Cicode function).
ObjectByName(sName)
sName: . . . . . . . . . . The name for the object in the form of "AN" followed by its
AN number, eg. "AN35". This name is used to access the
object.
Return Value
Related Functions
Example
See Also
ObjectHasInterface
Description
Syntax
483
484
See Also
ActiveX Functions
ObjectIsValid
Description
Syntax
Determines if the given handle for an object is a valid handle. This function is
useful for programmatically checking that an object was returned for a call.
ObjectIsValid(hObject)
hObject . . . . . . . . . . The handle for the object (as returned by the
ObjectByName() function).
Return Value
Related Functions
Example
See Also
ActiveX Functions
ObjectToStr
Description
Syntax
Return Value
Related Functions
ActiveX Functions
OLEDateToTime
Description
Syntax
OLEDateToTime(OLEDate, Local)
OLEDate: . . . . . . . . The OLE DATE value to convert (stored as a REAL).
Local: . . . . . . . . . . . 0 - OleDate represents a UTC time.
1 - OleDate represents a Local time.
Return Value
Related Functions
Example
See Also
Time/Date Functions
OnEvent
Description
Sets an event callback function for an event type. The callback function is called
when the event occurs.
Using callback functions saves polling or checking for events. Callback functions
have no arguments and must return an integer.
CitectSCADA starts running the function immediately, without reading any
data from the I/O Devices. Any I/O Device variable that you use will contain
485
486
OnEvent(Type, Fn)
Type . . . . . . . . . . . . . The type of event:
0
- A key has been pressed. When the user presses a key, the
callback function is called after CitectSCADA checks
for hot keys. If the return value is 0, CitectSCADA
checks for key sequences. If the return value is not 0,
CitectSCADA assumes that you will process the key
and does not check the key sequence. It is up to you to
remove the key from the key command line.
If you are using a right mouse button click as an event,
you should read about the ButtonOnlyLeftClick
parameter.
487
488
See Also
Event Functions
PackedRGB
Description
Syntax
Returns a packed RGB color based on specified red, green, and blue values.
PackedRGB(nRed, nGreen, nBlue)
nRed: . . . . . . . . . . . The red component of the desired packed RGB color.
nGreen: . . . . . . . . . . The green component of the desired packed RGB color.
nBlue: . . . . . . . . . . . The blue component of the desired packed RGB color.
Return Value
Related Functions
See Also
PackedRGBToCitectCol
our
Description
Syntax
Return Value
Related Functions
See Also
489
490
PageAlarm
Description
Displays a category of active alarms on the alarm page. To use this function, you
must use the Graphics Builder to create a page called "Alarm" (using the alarm
template).
Note: The operation of this function has changed. In Version 2.xx this function
displayed the in-built alarm page from the Include project.
Syntax
PageAlarm(Category)
Category: . . . . . . . . The alarm category to display. Set to 0 (the default) to
display all alarm categories.
Return Value
Related Functions
Example
System Keyboard
Key Sequence
Command
Comment
AlarmPage
PageAlarm(0)
Display all active alarms on the alarm page
System Keyboard
Key Sequence
Command
Comment
See Also
Page Functions
PageDisabled
Description
Displays a category of disabled alarms on the alarm page. To use this function,
you must use the Graphics Builder to create a page called "Disabled" (using the
disabled template).
Note: The operation of this function has changed. In Version 2.xx this function
displayed the in-built disabled alarm page from the Include project.
Syntax
PageDisabled(Category)
Category: . . . . . . . . The alarm category to display. Set to 0 (the default) to
display all alarm categories.
Example
System Keyboard
Key Sequence
Command
Comment
DisabledPage
PageDisabled(0)
Display all disabled alarms on the alarm page
System Keyboard
Key Sequence
Command
Comment
See Also
Page Functions
PageDisplay
Description
Displays a graphics page in the active window. The page must be in one of the
operator's current areas. You can specify either the Page Name or the Page
Number of the graphics page.
CitectSCADA saves the current page (onto a stack) before it displays the
required page. You can call PageLast() to re-display the pages on the stack.
You cannot call this function from the Exit command field (see Page Properties)
or a Cicode Object.
Syntax
PageDisplay(Page)
Page: . . . . . . . . . . . . The Page Name or Page Number of the page to display (in
quotation marks "").
Return Value
Related Functions
Example
Buttons
Text
Command
Comment
Mimic Page
PageDisplay("Mimic")
Display the "Mimic" page
491
492
PageDisplay("MIMIC1");
! Displays page "MIMIC1".
PageDisplay("MIMIC2");
/* Displays page "MIMIC2" and places page "MIMIC1" onto the
PageLast stack. */
PageDisplay("10");
/* Displays page "10" and places page "MIMIC2" onto the PageLast
stack. */
PageLast();
/* Displays the last page on the stack, i.e. page "MIMIC2" and
removes it from the stack. */
See Also
Page Functions
PageFile
Description
Displays a file on the page. After the file is displayed, you can scroll up and
down through the file. To use this function, you must use the Graphics Builder
to create a page called "File" (using the file template).
Note: The operation of this function has changed. In Version 2.xx this function
displayed the in-built file page from the Include project.
Syntax
PageFile(sName)
sName: . . . . . . . . . . The name of the file to display.
Return Value
Related Functions
Example
System Keyboard
Key Sequence
Command
Comment
Page Functions
PageFileInfo
Description
Syntax
Return Value
See Also
The height or width of the specified page in pixels, depending on the value set
for nMode.
Page Functions
PageGetInt
Description
Gets a local page-based integer. Page-based variables are local to each display
page. If two or more windows are displayed, each window has a unique copy of
the variable. You can use these variables in Cicode to keep track of variables
unique to each window.
Note: You can find out the current setting for [Page]ScanTime parameter, by
calling this function as follows: PageGetInt(-2)
Syntax
PageGetInt(Offset)
Offset: . . . . . . . . . . . The offset in the array of integers.
Return Value
Related Functions
See Also
493
494
PageGetStr
Description
Gets a local page-based string. Page-based variables are local to each display
page. If two or more windows are displayed, each window has a unique copy of
the variable. You can use these variables in Cicode to keep track of variables
unique to each window.
Specify the position of the variable in the array in the Offset argument. (The
length of the array is set by the [Page]MaxStr parameter.)
Syntax
PageGetStr(Offset)
Offset: . . . . . . . . . . . The offset in the array of strings.
Return Value
Related Functions
See Also
The string.
PageSetInt, PageGetInt, PageSetStr
Page Functions
PageGoto
Description
Displays a graphics page in the active window. The page must be in one of the
operator's current areas. You can specify either the Page Name or the Page
Number of the graphics page. This function is similar to PageDisplay(), however
PageGoto() does not put the current page onto the PageLast stack.
You cannot call this function from the Exit command field (see Page Properties)
or a Cicode Object.
Syntax
PageGoto(Page)
Page: . . . . . . . . . . . . The Page Name or Page Number of the page to display (in
quotation marks "").
Return Value
Related Functions
Example
See Also
Page Functions
PageHardware
Description
Displays the active hardware alarms on the alarms page. To use this function,
you must use the Graphics Builder to create a page called "Hardware" (using the
alarm template).
Note: The operation of this function has changed. In Version 2.xx this function
displayed the in-built hardware alarm page from the Include project.
Syntax
Return Value
Related Functions
PageHardware
0 (zero) if successful, otherwise an error is returned.
PageAlarm
Example
System Keyboard
Key Sequence
Command
Comment
See Also
Hardware
PageHardware()
Display active hardware alarms on the hardware
alarms page
Page Functions
PageInfo
Description
Syntax
495
496
- Next child in child link. Returns -1 for the end of the list
11
12
- Width of window
13
- Height of window
14
- X position of window
15 - Y position of window
16 - Dynamic window horizontal scale
17 - Dynamic window vertical scale
Types 16 and 17 return a real number between 0 and 1 (as a
STRING) and will be identical, as the dynamic scaling does
not allow a change in the aspect ratio.
18 - Flashing color state. Type 18 returns one of the
following:
"0" - the palette does not flash
"1" - the palette is primary now
"2" - the palette is secondary now
19 - In animation cycle. Returns a 1 (true) or 0 (false)
20 - In communications cycle. Returns a 1 (true) or 0 (false)
21 - Width of background page
22 - Height of background page
23 - The number of animation points on a page
24 - The value of the highest animation point on the page
25 - Indicates when the pages "On Page Shown" event has
been triggered. Returns 1 if triggered, 0 if it has not.
Return Value
PageDisplay
! If currently on page "MIMIC1";
Variable=PageInfo(0);
! Sets Variable to "MIMIC1".
See Also
Page Functions
PageLast
Description
Displays the graphics page that was last displayed. With this function, you can
successively recall the last ten pages that were displayed.
Graphics pages displayed using this command cannot be subsequently recalled.
You cannot call this function from the Exit command field (see Page Properties)
or a Cicode Object.
Syntax
Return Value
Related Functions
PageLast()
0 (zero) if the page is successfully displayed, otherwise an error is returned.
PagePeekLast, PagePopLast, PagePushLast
Example
Buttons
Text
Command
Comment
Last Page
PageLast()
Display the graphics page that was last
displayed
PageDisplay("MIMIC1");
! Displays page "MIMIC1".
PageDisplay("MIMIC2");
/* Displays page "MIMIC2" and places page "MIMIC1" onto the
PageLast stack. */
PageDisplay("10");
! Displays page "10" and places page "MIMIC2" onto the PageLast
stack.
PageLast();
/* Displays the last page on the stack, i.e. page "MIMIC2" and
removes it from the stack. */
497
498
See Also
Page Functions
PageMenu
Description
Syntax
Return Value
Related Functions
Displays a menu page with page selection buttons. A page goto button is
displayed for each of the first 40 pages defined in the project.
PageMenu()
0 (zero) if the page is successfully displayed, otherwise an error is returned.
PageGoto, PageLast, PagePrev, PageSelect
Example
Buttons
Text
Command
Comment
Menu
PageMenu()
Display the menu page
System Keyboard
Key Sequence
Command
Comment
See Also
Menu
PageMenu()
Display the menu page
Page Functions
PageNext
Description
Syntax
PageNext()
Example
Buttons
Text
Command
Comment
Page Next
PageNext()
Display the next page in the browse sequence
System Keyboard
Key Sequence
Command
Comment
PageNext
PageNext()
Display the next page in the browse sequence
See Also
Page Functions
PagePeekLast
Description
Syntax
Gets the Page Name at an offset in the PageLast stack (without removing the
page from the stack).
PagePeekLast(Offset)
Offset: . . . . . . . . . . . The offset from the end of the PageLast stack. Offset 0 is the
last page on the stack, Offset 1 is the second last page on the
stack, etc.
Return Value
Related Functions
Example
499
500
See Also
Page Functions
PagePopLast
Description
Syntax
Return Value
Related Functions
Example
Gets the Page Name of the last item on the PageLast stack and removes the page
from the stack.
PagePopLast()
The page name or an empty string if there is no last page.
PageLast
PageDisplay("MIMIC1");
! Displays page "MIMIC1".
PageDisplay("MIMIC2");
/* Displays page "MIMIC2" and places page "MIMIC1" onto the
PageLast stack. */
PageDisplay("10");
! Displays page "10" and places page "MIMIC2" onto the PageLast
stack.
Variable=PagePopLast();
/* Sets Variable to "MIMIC2" and removes "MIMIC2" from the
PageLast stack. */
PageLast();
! Displays page "MIMIC1".
See Also
Page Functions
PagePopUp
Description
Syntax
Display pop up window at the mouse position. If the mouse position is not
known then the pop up will display in the centre of the screen. The window is
displayed with no resize and will be closed if the page is changed.
PagePopUp(sPage)
sPage: . . . . . . . . . . . The name of the page (drawn with the Graphics Builder).
Return Value
Related Functions
See Also
PagePrev
Description
Syntax
Return Value
Related Functions
PagePrev()
0 (zero) if the page is successfully displayed, otherwise an error is returned.
PageNext
Example
Buttons
Text
Command
Comment
Page Previous
PagePrev()
Display the previous page in the browse
sequence
System Keyboard
Key Sequence
Command
Comment
PagePrev
PagePrev()
Display the previous page in the browse
sequence
501
502
See Also
Page Functions
PagePushLast
Description
Syntax
Return Value
Related Functions
Example
See Also
Page Functions
PageRichTextFile
Description
Syntax
This function creates a rich edit object, and loads a copy of the rich text file
Filename into that object. The rich text object will be rectangular in shape, with
dimensions determined by nHeight, and nWidth. If you do not specify nHeight
and nWidth, hAn will define the position of one corner, and (hAn + 1) the position
of the diagonally opposite corner. This function would often be used as a page
entry function.
PageRichTextFile(hAn, Filename, nMode, nHeight, nWidth)
hAn: . . . . . . . . . . . . The animation point at which to display the rich text object.
Filename: . . . . . . . . The name of the file to be copied and loaded into the rich text
object. The filename must be entered in quotation marks "".
Remember that the filename for the saved report comes from
the File Name field in the Devices form. The location of the
saved file must also be included as part of the filename. For
example, if the filename in the Devices form listed
[Data];RepDev.rtf, then you would need to enter
"[Data]\repdev.rtf" as your argument. Alternatively, you can
manually enter the path, e.g. "c:\citect\data\repdev.rtf".
nMode: . . . . . . . . . . The display mode for the rich text object. The mode can be
any combination of:
0 - Disabled - should be used if the rich text object is to be
used for display purposes only.
1 - Enabled - allows you to select and copy the contents of the
RTF object (for instance an RTF report), but you will
not be able to make changes.
2 - Read/Write - allows you to edit the contents of the RTF
object. Remember, however, that the object must be
enabled before it can be edited. If it has already been
enabled, you can just enter Mode 2 as your argument.
If it is not already enabled, you will need to enable it.
By combining Mode 1 and Mode 2 in your argument
503
504
Example
None
DspRichText, DspRichTextLoad, DspRichTextEdit,
DspRichTextEnable, DspRichTextGetInfo, DspRichTextPgScroll,
DspRichTextPrint, DspRichTextSave, DspRichTextScroll,
FileRichTextPrint
PageRichTextFile(108,"f:\citect\data\richtext.rtf",0);
// This function would produce a rich text object at animation
point 108. Into this object a copy of f:\citect\data\richtext.rtf
would then be loaded. Remember, richtext.rtf is the name of the
output file for the report, as specified in the Devices form.
Because 0 was specified as the nMode for this example, the
contents of this object will be display only. //
PageRichTextFile(53,"[Data]\richtext.rtf",1);
//This function would produce a rich text object at animation
point 53. Into this object a copy of [Data]\richtext.rtf would
then be loaded. It will be possible to select and copy the
contents of the object, but not make changes. //
See Also
Page Functions
PageSelect
Description
Displays a dialog box with a list of all graphics pages defined in the project. AN
operator can select a page name for display.
PageSelect()
Return Value
Related Functions
Example
Buttons
Text
Command
Comment
Page Select
PageSelect()
Display the page selection dialog box
PageSelect();
! Displays the page selection dialog box.
See Also
Page Functions
PageSetInt
Description
Syntax
PageSetInt(Offset, Int)
Offset: . . . . . . . . . . . The offset in the array of integers.
Int: . . . . . . . . . . . . . The integer value to store.
Return Value
Related Functions
See Also
PageSetStr
Description
505
506
PageSetStr(Offset, String)
Offset: . . . . . . . . . . . The offset in the array of integers.
String: . . . . . . . . . . The string to store. The string length is 128 characters.
Return Value
Related Functions
See Also
PageSummary
Description
Displays a category of alarm summary entries on the alarm page. To use this
function, you must use the Graphics Builder to create a page called "Summary"
(using the alarm template).
Note: The operation of this function has changed. In Version 2.xx this function
displayed the in-built summary alarm page from the Include project.
Syntax
Return Value
Related Functions
PageSummary(Category)
0 (zero) if successful, otherwise an error is returned.
PageAlarm
Example
System Keyboard
Key Sequence
Command
Comment
System Keyboard
Key Sequence
Command
Comment
See Also
Page Functions
SummaryPage
PageSummary(0)
Display all alarm summary entries on the alarm
page
Summary ### Enter
PageSummary(Arg1)
Display a specified category of alarm summary
entries on the alarm page
PageTrend
Description
Syntax
Displays a trend page with the specified trend pens. Use this function to display
trends in the system with a single trend page. You must create the trend page
with the Graphics Builder and set all the pen names to blank. Then display that
page by calling this function and passing the required trend tags. Call this
function from a menu of trend pages.
PageTrend(sPage, sTag1 ... sTag8)
sPage: . . . . . . . . . . . Name of the trend page (drawn with the Graphics Builder).
sTag1..sTag8: . . . . . The trend tags to display on the page.
Return Value
Related Functions
Example
Buttons
Text
Command
Comment
Process Trend
PageTrend("MyTrend", "PV1", "PV2", "PV3")
Display the trend page with three trend pens
See Also
Page Functions
ParameterGet
Description
Gets the value of a system parameter. The system parameter can exist in the
CITECT.INI file and/or in the Parameters database.
If the system parameter does not exist in the CITECT.INI file or the database, the
default value is returned. If the system parameter exists in both CITECT.INI and
the database, the value of the system parameter is taken from CITECT.INI.
Syntax
507
508
See Also
Miscellaneous Functions
ParameterPut
Description
Syntax
Return Value
Related Functions
Example
See Also
Miscellaneous Functions
PathToStr
Description
Syntax
Converts a CitectSCADA path into a string. The path string can contain one of
the standard CitectSCADA path operators, BIN, DATA, RUN, or a userconfigured path. If the string does not contain a CitectSCADA path, it is
unchanged.
PathToStr(sPath)
sPath: . . . . . . . . . . . The CitectSCADA path to convert.
See Also
String Functions
Pi
Description
Syntax
Return Value
Example
Gets the value of pi (the ratio of the circumference of a circle to its diameter).
Pi()
The value of pi.
Variable=Pi();
! Sets Variable to 3.1415...
See Also
Math/Trigonometry Functions
PlotClose
Description
Syntax
Displays the plot on screen or sends it to the printer (depending on the output
device you specified in the PlotOpen() function), then closes the plot. Once the
plot is closed, it cannot be used.
PlotClose(hPlot)
hPlot: . . . . . . . . . . . The plot handle, returned from the PlotOpen() function. The
plot handle identifies the table where all data on the plot is
stored.
Return Value
Related Functions
Example
See PlotOpen
See Also
Plot Functions
509
510
PlotDraw
Description
Constructs drawings on your plot. Use the coordinates (X1,Y1) and (X2,Y2) to
define a point, line, rectangle, square, circle, or ellipse. You can specify the style,
color, and width of the pen, and a fill color for a box or circular shape.
You must call the PlotOpen() function first, to get the handle for the plot (hPlot)
and to specify the output device.
Syntax
PlotDraw(hPlot, Type, PenStyle, PenCol, PenWidth, nFill, X1, Y1, X2, Y2)
hPlot: . . . . . . . . . . . The plot handle, returned from the PlotOpen() function. The
plot handle identifies the table where all data on the plot is
stored.
Type: . . . . . . . . . . . . The type of drawing:
1 - Rectangle or square
2 - Circle or ellipse
3 - Line
4 - Point
PenStyle: . . . . . . . . The style of the pen used to draw:
0 - Solid
1 - Dash( -
-)
2 - Dot (...............................)
3 - Dash and dot( - . - . - . - . - )
4 - Dash, dot, dot( - . . - . . - . . - )
5
- Hollow
PenCol: . . . . . . . . . . The color of the pen (flashing color is not supported). Select a
color from the list of Predefined Color Names and Codes or
create an RGB-based color using the function
MakeCitectColour.
PenWidth: . . . . . . . Pen width in pixels. If the width is thicker than one pixel, you
must use a solid pen (PenStyle = 0). Maximum width is 32.
nFill: . . . . . . . . . . . . The fill color of the rectangle, square, circle, or ellipse
(flashing color is not supported). Select a color from the list
of predefined color names and codes or create an RGB-based
color using the function MakeCitectColour. For a point or
line, nFill is ignored.
Example
See PlotOpen.
See Also
Plot Functions
PlotGetMarker
Description
Syntax
Gets the marker number of a symbol. The symbol must be a symbol and
registered with the PlotSetMarker() function.
PlotGetMarker(sSymbolName)
sSymbolName . . . . . The library name and symbol name ("Library.Symbol") of the
symbol that is registered as a marker.
Return Value
Related Functions
Example
511
512
See Also
Plot Functions
PlotGrid
Description
Defines a frame and draws horizontal and vertical grid lines within this frame.
These grid lines can then be used by the PlotLine(), PlotXYLine(), and
PlotScaleMarker() functions. You must define the frame for a plot before you can
plot points with the PlotLine() and PlotXYLine() functions. nSamples specifies the
maximum number of samples that can be plotted for a single line. If you set
FrameWidth to 0 (zero), the frame will be defined but not displayed (however,
the plot will still be displayed).
You can specify the number of grid lines and their color, as well as the
background color which will fill the frame. If nHorGrid and nVerGrid are set to 0
(zero), then the grid lines will not be drawn.
You must call the PlotOpen() function, first, to get the handle for the plot (hPlot),
and to specify the output device. Then call this function to set up the frame and
grid. You can then call the PlotScaleMarker() function to draw scale lines beside
the frame, and call the PlotLine() or PlotXYLine() to plot a set of data points.
Syntax
Example
See PlotOpen
See Also
Plot Functions
513
514
PlotInfo
Description
Gets information about the plot. You can call this function to determine the
number of pixels per page or inch, the resolution of a plot, and the size and
spacing of characters for a specified text font. You can also check whether a
printer can print rotated text. (See PlotText().)
You must first call the PlotOpen() function to get the handle for the plot (hPlot)
and specify the output device.
Syntax
Return Value
Related Functions
hPlot = PlotOpen(36,"Display",1);
:
/* Print text in upward direction but first check if printer
supports text rotation. Set default text orientation to left to
right (just in case). */
Orient = 0;
IF PlotInfo(hPlot,9) THEN
Orient = 1;
END
PlotText(hPlot,hFont,Orient,100,100,"scale");
:
/* Print text "Citect Graph" centred horizontally at top of page.
*/
PageWidth = PlotInfo(hPlot,0);
! Get width of page
hFont = DspFont("Courier",14,black,-1);
TextWidth = PlotInfo(hPlot,8,hFont);
! Get width of each
character
TextPosn = (PageWidth - TextWidth * 12) / 2
! Get start of 1st
character
PlotText(hPlot,hFont,0,TextPosn,0,"Citect Graph");
:
PlotClose(hPlot);
See Also
Plot Functions
PlotLine
Description
Draws a line (in the CitectSCADA plot system) for a set of data points. You
specify the data points in the table pTable, and plot these points between the
LoScale and HiScale values. The line is drawn inside the frame defined by the
PlotGrid() function.
For each line on a plot, you can specify a different pen style, color, and width,
and a different marker style and color. You can draw lines either from left to
right or from right to left.
You must first call the PlotOpen() function to get the handle for the plot (hPlot)
and specify the output device. You should then use the PlotGrid() function to set
up the frame and grid, before you call this function to plot the line.
Syntax
515
516
-)
2 - Dot (...............................)
3 - Dash and dot( - . - . - . - . - )
4 - Dash, dot, dot( - . . - . . - . . - )
5
- Hollow
PenCol: . . . . . . . . . . The color of the pen (flashing color is not supported). Select a
color from the list of Predefined Color Names and Codes or
create an RGB-based color using the function
MakeCitectColour.
PenWidth: . . . . . . . The width of the pen, in pixels. If the width is thicker than
one pixel, you must use a solid pen (PenStyle = 0). The
maximum width is 32.
MarkerStyle: . . . . . . The style of the markers:
0 - No markers
1 - Triangle
2 - Square
3 - Circle
4 - Diamond
5
- Filled triangle
- Filled square
7 - Filled circle
8
- Filled diamond
Return Value
Related Functions
Example
See PlotOpen
See Also
Plot Functions
517
518
PlotMarker
Description
Draws markers on a plotted line or at a specified point. You can plot any one of
the standard markers, or use a symbol of your choice. (You must first register
your symbol as a marker, by using the PlotSetMarker() function.)
To draw a single marker at a specified point, set X and Y to the coordinates of the
point, and set Length to 1.
You can draw markers on a plotted line when you draw the line, i.e. within the
PlotLine() or PlotXYLine() function. You would use the PlotMarker() function
only if you need to draw a second set of markers on the same line. Call
PlotMarker() immediately after the line is drawn. Set X and Y to -1 and Length to
the number of data points (specified in the Length argument of the PlotLine() or
PlotXYLine() function).
You must first call the PlotOpen() function to get the handle for the plot (hPlot)
and specify the output device.
Syntax
- Filled triangle
- Filled square
7 - Filled circle
8
- Filled diamond
Example
See Also
Plot Functions
PlotOpen
Description
Opens a new plot, sets its output device, and returns its plot handle. You can
send the plot to any one of your system printers, or display it on screen at the
specified AN.
519
520
The plot handle if the plot is opened successfully, otherwise -1 is returned. The
plot handle identifies the table where all data on the associated plot is stored.
Related Functions
Example
hPlot=PlotOpen(0,"LPT2:",1);
IF hPlot <> -1 THEN
/* Set up a black frame with red & blue grid lines. */
PlotGrid(hPlot,18,450,800,1850,1600,5,red,10,blue,4,black,white,0
);
/* Draw a scale line to the left of the frame. */
PlotScaleMarker(hPlot,400,1600,6,1,black,0);
/* Plot a simple line in green for a table of 10 values. */
PlotLine(hPlot,0,green,3,6,green,2,10,Buf1,0,100,1);
/* Plot a line in yellow (with black markers) for tables of 8 X
and Y values. */
PlotXYLine(hPlot,0,yellow,4,3,black,2,8,Buf2,0,150,Buf3,0,100,1);
/* Draw a title box above the plot frame, with the heading
"Citect Graph". */
PlotDraw(hPlot,1,0,black,1,grey,900,250,1400,400);
hFont = DspFont("Times",-60,black,grey);
PlotText(hPlot,hFont,0,950,350,"Citect Graph");
PlotClose(hPlot);
END
521
522
See Also
Plot Functions
PlotScaleMarker
Description
Draws scale lines beside the grid on your plot (if there is one) and places
markers on them. The height of the scale line is automatically set to the height of
the frame set in the PlotGrid() function.
Return Value
Related Functions
Example
See PlotOpen
See Also
Plot Functions
523
524
PlotSetMarker
Description
Syntax
Registers a symbol as a marker. You can then draw the new marker at points
and on plotted lines, by specifying the MarkerNo of the symbol as the MarkerStyle
in the PlotMarker() function. Call the PlotGetMarker() function if you do not
know the number of a marker.
PlotSetMarker(MarkerNo, sSymbolName)
MarkerNo: . . . . . . . The number of the marker, to be used as the MarkerStyle in
the PlotMarker() function. Your marker numbers must be
greater than or equal to 20 (to a maximum of 32000).
sSymbolName: . . . . The name and path of the symbol to be defined as a marker.
Return Value
Related Functions
Example
See Also
Plot Functions
PlotText
Description
Prints text on a plot. You can specify the font, position, and orientation of the
text. If you specify an orientation other than 'left-to-right', you must check that
the font (and the printer) supports the orientation.
You must first call the PlotOpen() function to get the handle for the plot (hPlot)
and specify the output device. You also must call the DspFont() function to get a
handle for the font (hFont).
Syntax
- Left-to-right
- Upwards
- Right-to-left
- Downwards
Example
See PlotOpen.
See Also
Plot Functions
PlotXYLine
Description
Plots values from two different tables. Values from one table are considered X
coordinates, and values from the other are considered Y coordinates. Points are
plotted between the low and high scale values specified for x and y. The line is
plotted inside the frame defined by the PlotGrid() function.
For each line, you can specify a different pen style, color, and width, and a
different marker style and color. You can draw lines either from left to right or
from right to left. You must first call the PlotOpen() function to get the handle
for the plot (hPlot) and specify the output device. You should then use the
525
526
-)
2 - Dot (...............................)
3 - Dash and dot( - . - . - . - . - )
4 - Dash, dot, dot( - . . - . . - . . - )
5
- Hollow
PenCol: . . . . . . . . . . The color of the pen (flashing color is not supported). Select a
color from the list of Predefined Color Names and Codes or
create an RGB-based color using the function
MakeCitectColour.
PenWidth: . . . . . . . The width of the pen, in pixels. If the width is thicker than
one pixel, you must use a solid pen (PenStyle = 0). The
maximum width is 32.
MarkerStyle: . . . . . . The style of the markers:
0 - No markers
1 - Triangle
2 - Square
3 - Circle
4 - Diamond
5
- Filled triangle
- Filled square
7 - Filled circle
8
- Filled diamond
527
528
Example
See PlotOpen
See Also
Plot Functions
Pow
Description
Syntax
Return Value
Related Functions
Example
X to the power of Y.
Exp
Variable=Pow(5,3);
! Sets Variable to 125.
See Also
Math/Trigonometry Functions
Print
Description
Prints a string on the current device. You should call this function only in a
report. The output is sent to the device (or group of devices) defined in the
Reports database (in the output device field).
Print(String)
String: . . . . . . . . . . The string (data) to print.
Return Value
Related Functions
Example
See Also
Device Functions
PrintLn
Description
Syntax
Return Value
Related Functions
Example
See Also
Device Functions
PrintFont
Description
Syntax
Changes the printing font on the current device. You should call this function
only in a report. It will change the font style for the device (or group of devices)
defined in the Reports database (output device field). It has effect only on
reports being printed to a PRINTER_DEV - it has no effect on other types of
devices, such as ASCII_DEV and dBASE_DEV.
PrintFont(Font)
Font: . . . . . . . . . . . . The Citect font (defined in the Fonts database).
529
530
{Date(2) }
{PV_1:#####.##}
{PV_2:#####.##}
----------End of Report---------------
Plant Area 1
04:41:56
19-10-93
PV_1
49.00
PV_2
65.00
----------End of Report---------------
See Also
Device Functions
ProjectRestartGet
Description
Gets the path to the project to be run the next time CitectSCADA is restarted.
(You must have a project already set using either ProjectSet or ProjectRestartSet.
Use this function with the Shutdown() function to shut down the project that is
currently running.
ProjectRestartGet()
Return Value
The path to the project to be run the next time CitectSCADA is restarted.
Related Functions
Example
See Also
See Shutdown.
Miscellaneous Functions
ProjectRestartSet
Description
Syntax
Sets the path to the project to be run the next time CitectSCADA is restarted.
ProjectRestartSet(sPath)
sPath: . . . . . . . . . . . The path to the project. You must use the full path, for
example to specify the path to the project "Demo", use:
"C:\CITECT\USER\DEMO".
Return Value
Related Functions
See Also
ProjectSet
Description
Syntax
Sets either the name or the path of the project to be run next time CitectSCADA
is restarted. The project path is written to the [CtEdit]Run parameter.
ProjectSet(sProject)
sProject: . . . . . . . . . The name of the project (for example "DEMO"), or the path to
the project. If you specify the path to the project, you must
use the full path, for example to specify the path to the
project "Demo", use: "C:\PROGRAM
FILES\CITECT\CITECTSCADA\USER\DEMO". If you do
not specify a project, the current project will be used.
Return Value
Related Functions
531
532
See Also
Miscellaneous Functions
Prompt
Description
Syntax
Return Value
Related Functions
Example
See Also
Miscellaneous Functions
Pulse
Description
Syntax
Pulses (jogs) a variable tag on, then off. The variable tag is switched ON (1) and
two seconds later it is switched OFF (0). The exact period of the pulse is
determined by the communication channel to the I/O device. If the
communication channel is busy, the pulse time may be longer than two seconds.
The code in the I/O device should not rely on a pulse time of exactly 2 seconds.
Use the pulse as a trigger only.
Pulse(sTag)
sTag: . . . . . . . . . . . . The digital tag to pulse.
Return Value
Related Functions
See Also
Jog 145
Pulse(M145)
Pulse the variable tag M145 every two seconds
Miscellaneous Functions
QueClose
Description
Closes a queue opened with the QueOpen() function. All data is flushed from
the queue.
If a Cicode task is waiting on the QueRead() function, it returns with a "queue
empty" status. You should close all queues when they are no longer required,
because they consume memory. At shutdown, CitectSCADA closes all open
queues.
Syntax
QueClose(hQue)
hQue: . . . . . . . . . . . The queue handle, returned from the QueOpen() function.
The queue handle identifies the table where all data on the
associated queue is stored.
Return Value
Related Functions
Example
See Also
Task Functions
QueLength
Description
Syntax
533
534
The current length of the queue. If the queue is closed then 0 is returned.
QueClose, QueOpen, QueRead, QueWrite, QuePeek
Length=QueLength(hQue);
Task Functions
QueOpen
Description
Syntax
Open a queue for reading and writing data elements. Use this function to create
a new queue or open an existing queue. Use queues for sending data from one
task to another or for other buffering operations.
QueOpen(Name, Mode)
Name: . . . . . . . . . . . The name of the queue.
Mode: . . . . . . . . . . . The mode of the queue open:
0
Related Functions
Example
The queue handle, or -1 if the queue cannot be opened. The queue handle
identifies the table where all data on the associated queue is stored.
QueClose, QueLength, QueRead, QueWrite, QuePeek
! Create a queue.
hQue=QueOpen("MyQue",1);
! Write data into the queue.
QueWrite(hQue,1,"Quetext");
QueWrite(hQue,1,"Moretext");
! Read back data from the queue.
QueRead(hQue,Type,Str,0);
See Also
Task Functions
QuePeek
Description
Searches a queue for a queue element. You can search for the element by
specifying a string, an integer, or both. You can remove the element from the
queue by adding 8 to the Mode.
Warning! This function may modify the arguments Type and Str depending on
the Mode. Therefore, these arguments must be variables. You should be careful
to not assume that they have not been changed when calling the function.
Syntax
535
536
See Also
Task Functions
QueRead
Description
Reads data from a queue, starting from the head of the queue. Data is returned
in the same order as it was written onto the queue and is removed from the
queue when read. If the Mode is 0 (non-blocking) and the queue is empty, the
function returns with an error. If the Mode is 1 (blocking) the function does not
return until another Cicode task writes data onto the queue.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
Syntax
Return Value
- Non-blocking.
See Also
Task Functions
QueryFunction
Description
The user-defined query function set in AlarmSetQuery. Called for each active
alarm, the query function can be written to display an alarm based on specific
information (for example, OnDate). To examine the information in an alarm
field, call the function AlarmGetFieldRec from within your query function.
Note: The function name "QueryFunction" can be any valid Cicode function
name specified by the user.
Syntax
537
538
Related Functions
Example
The return value must be defined as an INT with a value of either TRUE or
FALSE. If the function returns a value of TRUE, the alarm being filtered is
displayed, otherwise it is excluded from the alarms list.
AlarmSetQuery, AlarmGetFieldRec, AlarmSetInfo
! The query function AlarmQueryDate() compares sDate with the
OnDate of each alarm.AlarmGetFieldRec() is used to check the
contents of the "OnDate" field for each alarm.
! If they are the same, the alarm is displayed.
INT
FUNCTION
AlarmQueryDate(INT nRID, INT nVer, STRING sDate)
INT bResult;
IF sDATE = AlarmGetFieldRec(nRID, "OnDate", nVer) THEN
bResult = TRUE;
ELSE
bResult = FALSE;
END
RETURN bResult;
END
See Also
Alarm Functions
QueWrite
Description
Writes an integer and string onto the end of a queue. The integer and string have
no meaning to the queue system, they are just passed from QueWrite() to
QueRead(). Queue data is written to the end of the queue. When the data is later
read from the queue, it is returned on a first-in-first-out basis.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
Syntax
Return Value
Task Functions
RadToDeg
Description
Syntax
Return Value
Related Functions
Example
See Also
Rand
Math/Trigonometry Functions
Rand(Maximum)
Maximum: . . . . . . . The maximum number. This number must be between 2 and
32767 (inclusive).
Return Value
Example
See Also
Math/Trigonometry Functions
539
540
RealToStr
Description
Syntax
Return Value
Related Functions
Example
See Also
String Functions
RepGetControl
Description
Syntax
0 - Idle
3 - Running
0 - Event triggered
1 - Daily
2 - Weekly
3 - Monthly
4 - Yearly
Return Value
Related Functions
Example
0 - Enabled
1 - Disabled
See Also
Report Functions
Report
Description
Runs a report on the report server. This function only schedules the report for
execution. The running of the report is controlled entirely by the report server.
This function will start the specified report on the Reports Server to which the
CitectSCADA computer is communicating. If you are using the Reports Servers
in Primary/Standby mode, the report can run on the Standby Server. If you call
this function on the Standby Server then the report will definitely run on the
Standby Server, even if the Primary Server is active.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
Syntax
Report(Name)
541
542
Example
Buttons
Text
Command
Comment
Shift Report
Report("Shift")
Runs the Shift Report
System Keyboard
Key Sequence
Command
Comment
Report("SHIFT");
! Runs the report named "SHIFT".
Report("DAY");
! Runs the report named "DAY".
/* The "SHIFT" and "DAY" reports are started. The order in which
the reports are run cannot be determined. If you want the "DAY"
report to run after the "SHIFT" report, call Report("DAY") at the
end of the "SHIFT" report. */
See Also
Report Functions
RepSetControl
Description
Sets report control information to temporarily override the normal settings for a
specified report. You can change the report schedule for a periodic report, and
run one-off or event-triggered reports. These new settings are set on both the
primary and standby report servers, but are not saved to the database. When
you restart your system, CitectSCADA uses the existing settings, defined in the
Reports database.
You might need to call this function several times. For example, to change an
event-triggered report to run at 6 hourly intervals, you need to change the
schedule (Type 4), synchronization time (Type 3), and period (Type 2). If you
use incompatible values for these options, you can get unpredictable results. To
change more than one option, disable the report, set the options, and then reenable the report.
0 - Event triggered
1 - Daily
2 - Weekly
3 - Monthly
4 - Yearly
0 - Enabled
1 - Disabled
543
544
RepSetControl("Shift",1,TimeCurrent()+60);
! Runs the "Shift" report in 1 minute.
! change weekly report to 8 hour shift starting at 7 am
RepSetControl("Weekly",
RepSetControl("Weekly",
RepSetControl("Weekly",
RepSetControl("Weekly",
RepSetControl("Weekly",
5,
4,
3,
2,
5,
See Also
5,
4,
3,
2,
5,
Report Functions
ReRead
Description
Re-reads all the I/O device data associated with the current Cicode task.
CitectSCADA normally keeps the I/O device data current. However, if a section
of Cicode takes a long time to run, CitectSCADA's copy of the I/O device data
can become old and require re-reading.
This function requests all I/O device data for the task so it could take a long time
to complete (e.g. up to 5 seconds), and the Cicode task will run slowly. You
might have to use this function if you have a task that runs in a loop forever, or
that uses the Sleep() function, but only use this function if you must.
ReRead() can be called automatically or manually. This behaviour is controlled
by the CodeSetMode() function, and the [Code]AutoReRead parameter.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
Syntax
ReRead(Mode)
Mode: . . . . . . . . . . . The mode of the read:
Return Value
Related Functions
No value (void).
Sleep, TaskNew
- Read anyway.
See Also
WHILE 1 DO
.
.
! Sleep for 1 hour.
Sleep(3600);
ReRead(0);
END
Task Functions
Round
Description
Syntax
Example
Variable=Round(0.7843,2);
! Sets Variable to 0.78 (result is rounded to 2 decimal places).
Variable=Round(123.45,-1);
! Sets Variable to 120.0 (rounded to -1 decimal place).
See Also
Math/Trigonometry Functions
SemClose
Description
Syntax
Closes a semaphore opened with SemOpen(). You should close all semaphores
when they are no longer required, because they consume memory. If any Cicode
tasks are waiting on this semaphore, the tasks are released with an error.
SemClose(hSem)
hSem: . . . . . . . . . . . The semaphore handle, returned from the SemOpen()
function. The semaphore handle identifies the table where all
data on the associated semaphore is stored.
Return Value
Related Functions
545
546
SemClose(hSem);
Task Functions
SemOpen
Description
Syntax
Related Functions
Example
See Also
The semaphore handle, or -1 if the semaphore was not opened successfully. The
semaphore handle identifies the table where all data on the associated
semaphore is stored.
SemClose, SemSignal, SemWait
hSem=SemOpen("MySem",1);
Task Functions
SemSignal
Description
Syntax
Signals a semaphore. If several Cicode tasks are waiting on this semaphore, the
first task is released. This function is a blocking function. It will block the calling
Cicode task until the operation is complete.
SemSignal(hSem)
hSem: . . . . . . . . . . . The semaphore handle, returned from the SemOpen()
function. The semaphore handle identifies the table where all
data on the associated semaphore is stored.
Task Functions
SemWait
Description
Syntax
Return Value
Related Functions
Example
See Also
Task Functions
547
548
SendKeys
Description
Syntax
The plus (+), caret (^), and percent sign (%) have special
meanings. To send one of these special characters,
enclose the character with braces. For example, to send
the plus sign, use {+}. To send a { character or a }
character, use {{} and {}}, respectively.
Code
Backspace
Break
Caps Lock
Clear
Del
End
Enter
Esc
Help
Home
Insert
Num Lock
Page Down
Page Up
Print Screen
Scroll Lock
{tab}
{up}
{down}
{right}
{left}
{f1}
{f2}
{f3}
{f4}
{f5}
{f6}
{f7}
{f8}
{f9}
{f10}
{f11}
{f12}
Code
Shift
Ctrl
Alt
+
^
%
To specify that Shift, Ctrl, and/or Alt are held down while several keys are
pressed, enclose the keys in parentheses. For example, to hold down the Shift
key while sending E then C, use +(EC). To hold down Shift while sending E,
followed by C without the Shift key, use +EC. To specify repeating keys, use the
form {key number}. For example, {left 42} means send the left arrow key 42
times. Note that you must leave a space between the key and number.
Return Value
Related Functions
Example
See Also
Keyboard Functions
549
550
SerialKey
Description
Redirects all serial characters from a port to the keyboard. If using a keyboard
attached to a serial port, you should call this function at startup, so that
CitectSCADA copies all characters (read from the port) to the keyboard. The
Port must be defined in the Ports database.
If the port is not on an I/O server, you must create a dummy I/O server record
(e.g. name the server DServer1). Complete the Boards and Ports records. Set the
following parameters in the CITECT.INI file:
[IOServer]Name to the server name (e.g. DServer1)
[IOServer]Server to 0
This method enables the port without making the computer an I/O server. (If the
I/O server is enabled (and not required as an I/O server), extra overhead and
memory are used.)
This function can only be called from an I/O server.
Syntax
SerialKey(sPort)
sPort: . . . . . . . . . . . The name of the port connected to the serial keyboard.
Return Value
Related Functions
Example
See Also
Communication Functions
ServerInfo
Description
551
552
See Also
Miscellaneous Functions
SetArea
Description
Syntax
Sets the current viewable areas. You can pass a single area number, or a group of
areas to set multiple areas. You can only set areas that are flagged for the current
user (defined in the Users database).
SetArea(Area)
Area: . . . . . . . . . . . . The area to set (1 to 255).
Return Value
Related Functions
Example
See Also
Miscellaneous Functions
SetEvent
Description
Syntax
Sets an event callback function by specifying a function handle. You can use this
function with the GetEvent() function to restore an old event handler.
SetEvent(Type, hFn)
Type: . . . . . . . . . . . . The type of event:
0
- A key has been pressed. When the user presses a key, the
callback function is called after CitectSCADA checks
for hot keys. If the return value is 0, CitectSCADA
checks for key sequences. If the return value is not 0,
CitectSCADA assumes that you will process the key
and does not check the key sequence. It is up to you to
remove the key from the key command line.
If you are using a right mouse button click as an event,
you should read about the ButtonOnlyLeftClick
parameter.
553
554
SetLanguage
Description
Sets the language database from which the local translations of all native strings
in the project will be drawn, and specifies the character set to be used. Native
strings are those that are preceded by a @, and enclosed in brackets (e.g.
@(Motor Overload)).
This function will dynamically change the language of display items such as
alarm descriptions, button text, keyboard/alarm logs, graphic text, Cicode
strings etc. The language will only be changed on the display client that calls the
555
556
SetLanguage(sLanguage, nCharSet)
sLanguage: . . . . . . . The name of the language database from which the local
translations of all native strings in the project will be drawn.
You do not need the .dbf extension.
nCharSet: . . . . . . . . The character set to use when displaying the localized text in
runtime:
0
1
128
129
130
134
136
161
162
163
177
178
186
204
222
Return Value
Related Functions
Example
ANSI
Default
Japanese - Shiftjis
Korean - Hangul
Korean - Johab
Chinese - simplified
Chinese - traditional
Greek
Turkish
Vietnamese
Hebrew
Arabic
Baltic
Russian
Thai
See Also
Miscellaneous Functions
Sign
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
Sin
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
Shutdown
Description
557
558
Example
See Also
Miscellaneous Functions
ShutdownForm
Description
Displays a dialog box to verify that the user really wants to shut down the
CitectSCADA system. If the user selects [Yes], CitectSCADA is shut down.
This function is a blocking function. It blocks the calling Cicode task until the
operation is complete.
Syntax
Return Value
Related Functions
ShutdownForm()
0 (zero) if successful, otherwise an error is returned.
Shutdown
Example
System Keyboard
Key Sequence
Command
Comment
Shutdown
ShutdownForm();
Display the shutdown form
Buttons
Text
Command
Comment
See Also
Miscellaneous Functions
Shutdown
ShutdownForm();
Display the shutdown form
559
560
ShutdownMode
Description
Syntax
Return Value
Related Functions
Example
See Also
Gets the mode of the shutdown. The mode is used for an online restart, to
specify whether changes made to the project were global or to pages only. If the
mode is pages only, only the graphics pages are shut down and reopened (with
changes). If the mode is global, CitectSCADA is shut down and restarted.
ShutdownMode()
The shutdown mode set when shutdown was called.
Shutdown
nMode = ShutdownMode()
If nMode = 4 Then
Prompt ("Rebooting your Computer")
END
Miscellaneous Functions
Sleep
Description
Suspends the current Cicode task for a specified number of seconds. After the
time delay, the Cicode task wakes and continues execution. If the sleep time is 0,
the Cicode task is pre-empted for 1 time slice only.
This function does not affect any other Cicode tasks - only the task calling
Sleep() is suspended. If you have Cicode that runs continuously in a loop, you
should call the Sleep() function somewhere within the loop, to pause the loop
and allow other tasks to run.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
Syntax
Sleep(Seconds)
Seconds: . . . . . . . . . The number of seconds. Set to 0 to pre-empt the task for one
time-slice.
Return Value
Related Functions
Example
Buttons
Step
PLCBit=1;Sleep(2);PLCBit=0;
Switch Bit ON and then OFF 2 seconds later
See Also
Task Functions
SleepMS
Description
Suspends the current Cicode task for a specified number of milliseconds. After
the time delay, the Cicode task wakes and continues execution. This function is
similar to the Sleep function but with greater resolution.
Although a value of 0 milliseconds is accepted, it is not recommended. Try to use
at least a value of 1.
This function does not affect any other Cicode tasks; only the task calling
SleepMS() is suspended. If you have Cicode that runs continuously in a loop,
you should call the SleepMS() or Sleep() function somewhere within the loop, to
pause the loop and allow other tasks to run.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
Syntax
SleepMS(Milliseconds)
Milliseconds: . . . . . The number of milliseconds (1000 milliseconds per second).
Set to 0 to pre-empt the task for one time-slice. Be careful not
to use a value that is too small. Setting the value to 0 would
generally have no desirable effect.
0 (zero) if successful, otherwise an error is returned.
561
562
Example
Buttons
Text
Command
Comment
Step
PLCBit=1;SleepMS(500);PLCBit=0;
Switch Bit ON and then OFF 500 milliseconds later.
See Also
Task Functions
SPCAlarms
Description
Syntax
Returns the status of the specified SPC alarm. This function is used to configure
SPC alarms, by defining alarms with this trigger in Advanced Alarms.
SPCAlarms(sSPCTag, AlarmType)
sSPCTag: . . . . . . . . The SPC Tag name as defined in SPC Tags.
Return Value
Related Functions
Example
Advanced Alarms
Alarm Tag
Alarm Desc
Expression
Comment
Feed_SPC_XBLCL
Process mean below LCL
SPCAlarms("Feed_SPC", XBelowLCL)
Trigger an alarm when XBelowLCL condition becomes
true.
Advanced Alarms
Alarm Tag
Alarm Desc
Expression
Comment
See Also
Temp_SPC_GRADUP
Mean is drifting up
SPCAlarms("Temp_SPC", XGradualUp)
Trigger an alarm if mean drifts up.
SPC Functions
SPCClientInfo
Description
Returns SPC data for the given SPC tag. The information retrieved through this
function is from the cache maintained by the display client. This function will
give a faster response than the related functions which access the SPC (trend)
server.
563
564
SPCClientInfo(sSPCTag, iType)
sSPCTag: . . . . . . . . The SPC Tag name as defined in SPC Tags.
iType: . . . . . . . . . . . The information to be returned:
1
- Subgroup Size
2 - No. of Subgroups
3 - Process Mean (x double bar)
4 - Process Range
5 - Process Standard Deviation
6 - Lower Specification Limit (LSL)
7 - Upper Specification Limit (USL)
8 - Cp - Process Capability Actual
9 - Cpk - Process Capability Potential
10 - Process Skewness
11 - Process kurtosis
Return Value
Related Functions
Example
See Also
SPC Functions
SPCGetHistogramTable
Description
Returns an array containing the frequencies of particular ranges for the given
SPC tag. The histogram structure is implied in the order of the table as follows the first array element is the data less than -3 sigma. The second value is the data
between -3 sigma and -3 sigma plus the bar width etc. The last value is the data
greater than +3 sigma.
This function can only be called while on an SPC page.
Syntax
Return Value
Related Functions
Example
565
566
See Also
SPC Functions
SPCGetSubgroupTable
Description
Returns an array containing the specified subgroup's elements with the mean,
range and standard deviation. The data will be in the following order:
Element0, Element1, ... , Element(n-1), Mean, Range, StdDev
Return Value
Related Functions
Example
See Also
SPC Functions
SPCPlot
Description
Syntax
Return Value
Related Functions
567
568
See Also
SPC Functions
SPCProcessXRSGet
Description
Gets the process mean, range, and standard deviation overrides for the specified
SPC tag. The values that are returned are the values that are currently being
used by the SPC (trend) server, not necessarily the values specified in the SPC
Tag definition.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
This function can only be called while on an SPC page.
Syntax
Return Value
Related Functions
Example
See Also
SPC Functions
SPCProcessXRSSet
Description
Sets the process mean, range and standard deviation overrides for the specified
SPC tag. The values entered here will override Citect's automatic calculations,
and the overrides specified in the SPC Tags definition.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
This function can only be called while on an SPC page.
Syntax
Return Value
Related Functions
569
570
See SPCProcessXRSGet
SPC Functions
SPCSetLimit
Description
Syntax
Sets the upper or lower control limits of X-bar, range, or standard deviation
charts. Using this function will only set the controller limits on the Client display
which will not affect the SPC Alarms. To set the server control limits, use the
SPCProcessXRSSet function.
SPCSetLimit(AN, Type, Value, Setting)
AN: . . . . . . . . . . . . . The AN where the SPC chart is located.
Type: . . . . . . . . . . . . The SPC type:
1 - X-bar upper control limit
2 - X-bar lower control limit
3 - Range upper control limit
4 - Range lower control limit
5 - Standard deviation upper control limit
6 - Standard deviation lower control limit
7 - X-bar centre line
8 - Range centre line
9 - Standard deviation centre line
Value: . . . . . . . . . . . The value for the control limit.
Setting: . . . . . . . . . . Automatic calculation or manual setting of control limits:
0 - Automatic
1 - Manual
Return Value
Example
See Also
SPC Functions
SPCSpecLimitGet
Description
Gets the process Upper and Lower Specification Limits (USL and LSL) for the
specified SPC tag. The values that are returned are the values that are currently
being used by the SPC (trend) server, not necessarily the values specified in the
SPC Tag definition.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
Syntax
Return Value
Related Functions
Example
* rDecPercent;
* rIntPercent;
0 THEN
SPCSpecLimitSet(sTAG, rLSL, rUSL);
571
572
See Also
SPC Functions
SPCSpecLimitSet
Description
Sets the process Upper and Lower Specification Limits (USL and LSL) for the
specified SPC tag. The values entered here will override those specified in the
SPC Tags definition.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
Syntax
Return Value
Related Functions
Example
See Also
SPCSubgroupSizeGet
Description
Gets the subgroup size for the specified SPC tag. The value that is returned is the
value that is currently being used by the SPC (trend) server, not necessarily the
value specified in the SPC Tag definition.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
This function can only be called while on an SPC page.
SPCSubgroupSizeGet(sSPCTag, SizeVariable)
sSPCTag . . . . . . . . . The SPC Tag name as defined in SPC Tags.
SizeVariable . . . . . . . The Cicode variable that stores the subgroup size. This
variable must be defined as a global of type INT. Do not
specify a constant in this field.
Return Value
Related Functions
Example
See Also
SPCSubgroupSizeSet
Description
Sets a new subgroup size for the specified SPC tag. The new subgroup size
becomes the new size as long as the SPC (trend) server is running. The subgroup
size is updated first in the SPC server, which then informs all display clients to
update. This will force re-calculation of SPC values (UCL and LCL) across the
span of any displayed charts.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
This function can only be called while on an SPC page.
Syntax
SPCSubgroupSizeSet(sSPCTag, iSize)
sSPCTag: . . . . . . . . The SPC Tag name as defined in SPC Tags.
iSize: . . . . . . . . . . . . The new size of the subgroup to set.
Return Value
Related Functions
Example
573
574
See Also
SPC Functions
SQLAppend
Description
Syntax
Appends a statement string to the SQL buffer. Cicode cannot send an SQL
statement that is longer than 255 characters. If you have an SQL statement that is
longer than the 255 character limit, you can split the statement into smaller
strings, and use this function to append the statements in the SQL buffer.
SQLAppend(hSQL, String)
hSQL: . . . . . . . . . . . The handle to the SQL connection, returned from the
SQLConnect() function. The SQL connection handle
identifies the table where details of the associated SQL
connection are stored.
String: . . . . . . . . . . The statement string to append to the SQL buffer.
Return Value
Related Functions
Example
See Also
See SQLSet
SQL Functions
SQLBeginTran
Description
Starts a database transaction. When you make a transaction, your changes are
not written to the database until you call the SQLCommit() function.
Alternatively, you can use the SQLRollBack function() to discard all changes
made during the transaction.
After you begin a transaction, you must call either SQLCommit() to save the
changes or SQLRollBack() to discard the changesthese functions complete the
transaction and release all database locks. Unless you complete the transaction,
you cannot successfully disconnect the SQL connection.
A single database connection can only handle one transaction at a time. After
you call SQLBeginTran(), you must complete that transaction before you can call
SQLBeginTran() again.
If you disconnect from a database while a transaction is active (not completed),
CitectSCADA automatically "rolls back" the transaction; any changes you made
to the database in that transaction are discarded.
You do not need to begin a transaction to modify a database. Any changes you
make to a database before you call the SQLBeginTran() are automatically
committed, and no database locks are held.
The SQLBeginTran() function is not supported by all databases. If you have
difficulty using the function, check that both your database and ODBC driver
support transactions. Refer to the documentation for your database for more
information on transactions.
Syntax
SQLBeginTran(hSQL)
hSQL: . . . . . . . . . . . The handle to the SQL connection, returned from the
SQLConnect() function. The SQL connection handle
identifies the table where details of the associated SQL
connection are stored.
Return Value
Related Functions
Example
575
576
See Also
SQL Functions
SQLCommit
Description
Commits (to the database) all changes made within a transaction. If you call the
SQLBeginTrans() function to begin a transaction, you must call the
SQLCommit() function to save the changes you make to the database during
that transaction (with the Insert, Delete, and Update SQL commands).
The SQLCommit() and SQLRollBack() functions both complete a transaction and
release all database locks. But while the SQLCommit() function saves all changes
made during the transaction, the SQLRollBack() function discards these
changes. Unless you call the SQLCommit() function before you disconnect the
database, CitectSCADA automatically rolls back the transaction; any changes
you made to the database in that transaction are discarded.
The SQLCommit() function could affect different databases in different ways. If
you have difficulty using the function, check that your database is ODBC
compatible. Refer to the documentation for your database for information on
committing transactions.
Syntax
SQLCommit(hSQL)
Related Functions
Example
See Also
See SQLBeginTran
SQL Functions
SQLConnect
Description
Syntax
SQLConnect(sConnect)
sConnect: . . . . . . . . The connection string, in the format:
<attribute>=<value>[;<attribute>=<value>. . .]
DLG
Data Source Name. The name of the data source defined with the
ODBC utility in the Windows Control Panel. You must use the DSN
attribute, unless you are using Citect v2.01 or earlier.
Dialog box. Set DLG to 1 to display a dialog box that allows the
user to input their user ID, password, and connection string. DLG
is an optional attribute.
577
578
PWD
MODIFY
SQL
REREAD
AFTER
UPDATE
REREAD
AFTER
INSERT
DRV
DSN
Btrieve Files
dBASE Files
EXCEL Files
IBM DB2
Informix
INGRES
Netware SQL
Oracle
OS/2 and DB2/2
Paradox
SQLBase/ (Gupta)
SQL Server
*
*
*
X
*
*
*
*
*
*
*
UID
PWD
DRV
QEBTR
QEDBF
QEXLS
QEDB2
*
*
*
*
*
*
*
*
*
*
QEING
QEXQL
QEORA
QEEE
QEPDX
QEGUP
QESS
*
*
*
*
QETXT
QEXDB
Related Functions
Example
See Also
SQL Functions
579
580
SQLDisconnect
Description
Syntax
SQLDisconnect(hSQL)
hSQL: . . . . . . . . . . . The handle to the SQL connection, returned from the
SQLConnect() function. The SQL connection handle
identifies the table where details of the associated SQL
connection are stored.
Return Value
Related Functions
Example
See Also
SQLEnd
Description
Ends the execution of an SQL query (from the latest SQLExec() call). If you have
called the SQLExec() function from within a database connection, you should
call SQLEnd() before you disconnect from that database. When the SQLEnd()
SQLEnd(hSQL)
hSQL. . . . . . . . . . . . The handle to the SQL connection, returned from the
SQLConnect() function. The SQL connection handle
identifies the table where details of the associated SQL
connection are stored.
Return Value
Related Functions
Example
See Also
SQLErrMsg
Description
Syntax
Return Value
Related Functions
Example
Returns an error message from the SQL system. If a 307 error code occurs when
one of the SQL functions is called, an SQL error message is generated. Call this
function to get that error message.
SQLErrMsg()
The error message (as a string).
SQLBeginTran, SQLCommit, SQLConnect, SQLDisconnect, SQLEnd,
SQLExec, SQLFieldInfo, SQLGetField, SQLInfo, SQLNext,
SQLNoFields, SQLNumChange, SQLRollBack, SQLTraceOff,
SQLTraceOn
See SQLConnect
581
582
SQL Functions
SQLExec
Description
Executes an SQL query on a database. With this function, you can execute any
SQL query or command supported by the SQL database. Only "CHAR" type
fields are supported in database tables.
Keywords such as "DATE", "TIME", and "DESC" cannot be used as field names
by some database systems. To use fields with these names, you must append
underscores to the names (e.g. "TIME_", "DATE_", "DESC_").
The SQLNext() function must be called after the SQLExec() function before you
can access data in the first record.
Only one query can be active at a time, so you do not need to end one query
before you execute another queryeach time you call SQLExec(), the previous
query (through a previous SQLExec() call) is automatically ended. Similarly,
CitectSCADA automatically ends the latest query when it disconnects the
database, even if you have not called SQLEnd(). However, the SQLEnd()
function ensures efficiencySQLEnd() releases the memory that was allocated
when the latest query was executed.
Syntax
SQLExec(hSQL, sSelect)
hSQL: . . . . . . . . . . . The handle to the SQL connection, returned from the
SQLConnect() function. The SQL connection handle
identifies the table where details of the associated SQL
connection are stored.
sSelect: . . . . . . . . . . The SQL query to be sent to the SQL database.
Return Value
Related Functions
These examples assume that the following tables are setup in a SQL server (with
the name configured in Windows Control Panel) and opened with the
SQLConnect() function:
PEOPLE
SURNAME
FIRSTNAME
OCCUPATION
DEPARTMENT
MARTIAN
CASE
LIGHT
BOLT
MARVIN
CARRIE
LARRY
BETTY
ENGINEER
SUPPORT
PROGRAMMER
ENGINEER
MANAGEMENT
CITECT
CITECT
SYSTEMS
PHONE
SURNAME
NUMBER
MARTIAN
CASE
BOLT
LIGHT
5551000
5551010
5551020
5551030
Each SQL string (sSQL) should be encased within the SQLExec function, for
example:
SQLExec(hSQL, sSQL);
FIRSTNAME
OCCUPATION
DEPARTMENT
MARTIAN
CASE
LIGHT
BOLT
ALLEN
MARVIN
CARRIE
LARRY
BETTY
MATTHEW
ENGINEER
SUPPORT
PROGRAMMER
ENGINEER
PROGRAMMER
MANAGEMENT
CITECT
CITECT
SYSTEMS
CITECT
583
584
Assuming that OK was pressed on the Message Box, the tables will be changed
to:
PEOPLE
SURNAME
FIRSTNAME
OCCUPATION
DEPARTMENT
CASE
LIGHT
BOLT
CARRIE
LARRY
BETTY
SUPPORT
PROGRAMMER
ENGINEER
CITECT
CITECT
SYSTEMS
PHONE
SURNAME
NUMBER
CASE
BOLT
LIGHT
5551010
5551020
5551030
To change a record:
sSQL = "UPDATE PEOPLE SET OCCUPATION='SUPPORT' WHERE
FIRSTNAME='LARRY'";
FIRSTNAME
OCCUPATION
DEPARTMENT
MARTIAN
CASE
LIGHT
BOLT
MARVIN
CARRIE
LARRY
BETTY
ENGINEER
SUPPORT
SUPPORT
ENGINEER
MANAGEMENT
CITECT
CITECT
SYSTEMS
This SQL command will return the following table back to Citect. The table can
then be accessed by the SQLNext() function and the SQLGetField() functions.
CITECT TABLE for hSQL
SURNAME
MARTIAN
BOLT
You can also select data using a much more complete SQL string, for example:
OCCUPATION
NUMBER
CASE
LIGHT
SUPPORT
PROGRAMMER
5551010
5551030
This code example leaves the information in the sInfo two dimensional array as
follows:
sInfo
0
1
2
3
4
...
See Also
CASE
LIGHT
SUPPORT
PROGRAMMER
5551010
5551030
SQL Functions
SQLFieldInfo
Description
Gets information about the fields or columns selected by a SQL query. The
function returns the name and width of the specified field. If you call the
function within a loop, you can return the names and sizes of all the fields in the
database.
Keywords such as "DATE", "TIME", and "DESC" cannot be used as field names
by some database systems. To use fields with these names, you must append
underscores to the names (e.g. "TIME_", "DATE_", "DESC_").
Syntax
585
586
Related Functions
Example
See Also
SQL Functions
SQLGetField
Description
Gets field or column data from a database record. To get the database record,
use the SQLExec() and SQLNext() functions.
Keywords such as "DATE", "TIME", and "DESC" cannot be used as field names
by some database systems. To use fields with these names, you must append
underscores to the names (e.g. "TIME_", "DATE_", "DESC_").
Syntax
SQLGetField(hSQL, sField)
hSQL: . . . . . . . . . . . The handle to the SQL connection, returned from the
SQLConnect() function. The SQL connection handle
identifies the table where details of the associated SQL
connection are stored.
sField: . . . . . . . . . . . The name of the field or column.
Return Value
The field or column data (as a string). A null string is returned if the field or
column does not contain data.
The maximum length of the return data is 255 characters. If the returned data is
longer than this, the function will return error 306.
Related Functions
Example
See Also
SQLInfo
Description
Syntax
587
588
Example
SQLInfo(1,2);
See Also
SQL Functions
SQLNext
Description
Syntax
Gets the next database record from an SQL query. Use the SQLExec() function to
select a number of records or rows from the SQL database, and then use the
SQLNext() function to step through each record separately.
SQLNext(hSQL)
hSQL: . . . . . . . . . . . The handle to the SQL connection, returned from the
SQLConnect() function. The SQL connection handle
identifies the table where details of the associated SQL
connection are stored.
Return Value
Related Functions
Example
See Also
See SQLConnect
SQL Functions
SQLNoFields
Description
Syntax
Gets the number of fields or columns that were returned by the last SQL
statement.
SQLNoFields(hSQL)
hSQL: . . . . . . . . . . . The handle to the SQL connection, returned from the
SQLConnect() function. The SQL connection handle
identifies the table where details of the associated SQL
connection are stored.
Return Value
Related Functions
Example
See Also
SQLNumChange
Description
Syntax
Gets the number of records that were modified in the last SQL Insert, Update, or
Delete statement.
SQLNumChange(hSQL)
hSQL: . . . . . . . . . . . The handle to the SQL connection, returned from the
SQLConnect() function. The SQL connection handle
identifies the table where details of the associated SQL
connection are stored.
Return Value
Related Functions
Example
589
590
SQL Functions
SQLRollBack
Description
Rolls back (discards) all changes made to the database within the current
transaction. If you call the SQLBeginTrans() function to begin a transaction, you
are not committed to changes to the database made by the Insert, Delete, and
Update commands until you call the SQLCommit() function. You can discard
these changes by calling the SQLRollBack() function.
You can only call the SQLRollBack() function if you have called SQLBeginTran()
to begin a transaction. You do not need to begin a transaction to modify a
database, but any changes you make to a database outside of a transaction are
automatically committed.
The SQLRollBack() function could affect different databases in different ways. If
you have difficulty using the function, check that your database is ODBCcompatible. Refer to the documentation for your database for more information
on rolling back transactions.
Syntax
SQLRollBack(hSQL)
hSQL: . . . . . . . . . . . The handle to the SQL connection, returned from the
SQLConnect() function. The SQL connection handle
identifies the table where details of the associated SQL
connection are stored.
Return Value
Related Functions
Example
See Also
SQLSet
Description
Sets a statement string in the SQL buffer. Cicode cannot send an SQL statement
that is longer than 255 characters. If you have an SQL statement that is longer
than the 255 character limit, you can split the statement into smaller strings, and
SQLSet(hSQL, String)
hSQL: . . . . . . . . . . . The handle to the SQL connection, returned from the
SQLConnect() function. The SQL connection handle
identifies the table where details of the associated SQL
connection are stored.
String: . . . . . . . . . . The statement string to set in the SQL buffer. The string must
contain the first part of an SQL statement.
Return Value
Related Functions
Example
See Also
SQL Functions
SQLTraceOff
Description
Syntax
Return Value
Related Functions
Example
See Also
Turns off the debug trace. Use this function to stop tracing function calls that are
made to the database.
SQLTraceOff()
0 (zero) if successful, otherwise an error number is returned. (For details of the
307 error code, call the SQLErrMsg function).
SQLBeginTran, SQLCommit, SQLConnect, SQLDisconnect, SQLEnd,
SQLErrMsg, SQLExec, SQLFieldInfo, SQLGetField, SQLInfo,
SQLNext, SQLNoFields, SQLNumChange, SQLRollBack, SQLTraceOn
See SQLFieldInfo
SQL Functions
591
592
SQLTraceOn
Description
Syntax
Turns on a debug trace. Use this function to begin tracing function calls that are
made to the database. The information is written to a log file.
SQLTraceOn(sFile)
sFile: . . . . . . . . . . . . The output file name for the debug trace.
Return Value
Related Functions
Example
See Also
See SQLFieldInfo
SQL Functions
Sqrt
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
StrClean
Description
Removes control characters from a string. Any character that is not a displayable
ASCII character is removed from the string.
StrClean(String)
String: . . . . . . . . . . The source string.
Return Value
Related Functions
Example
See Also
String Functions
StrFill
Description
Syntax
Return Value
Related Functions
Example
See Also
String Functions
StrFormat
Description
Syntax
Converts a variable into a formatted string. This function is the equivalent of the
Cicode " :#### " operator.
StrFormat(Variable, Width, DecPlaces, EngUnits)
Variable: . . . . . . . . . The variable to format into a string.
593
594
See Also
String Functions
StrGetChar
Description
Syntax
Gets a single character from a string or buffer. Use this function to read a string,
character by character.
StrGetChar(String, iOffset)
String: . . . . . . . . . . The source string.
iOffset: . . . . . . . . . . The offset in the string, commencing at 0.
Return Value
Related Functions
Example
See Also
String Functions
StrLeft
Description
Syntax
See Also
String Functions
StrLength
Description
Syntax
Return Value
Related Functions
Example
See Also
String Functions
StrLower
Description
Syntax
Return Value
Related Functions
Example
595
596
See Also
String Functions
StrMid
Description
Syntax
Return Value
Related Functions
Example
See Also
String Functions
StrPad
Description
Syntax
Return Value
A padded string.
StrFill
Variable=StrPad("Test"," ",10);
! Sets Variable to "Test
".
Variable=StrPad("Test","abc",-14);
! Sets Variable to "abcabcabcaTest".
See Also
String Functions
StrRight
Description
Syntax
Return Value
Related Functions
Example
See Also
String Functions
StrSearch
Description
Syntax
Searches for a string within a string, commencing at a specified offset. The result
of the search is the index in the source string, where the first character of the substring is found. Index 0 is the first character in the string, index 1 is the second,
and so on.
StrSearch(Offset, String, Substring)
Offset: . . . . . . . . . . . The offset in the string, commencing at 0.
String: . . . . . . . . . . The source string.
Substring: . . . . . . . . The substring to search for.
Return Value
The index in the search string, or -1 if the sub-string does not exist in the string.
597
598
StrLength
Variable=StrSearch(1,"ABCDEF","CD");
! Sets Variable to 2.
Variable=StrSearch(4,"ABCDEF","CD");
! Sets Variable to -1.
Variable=StrSearch(5,"ABCDEF","F");
! Sets Variable to 5.
See Also
String Functions
StrSetChar
Description
Syntax
Sets a single character into a string or buffer. Use this function to build up a
string, character by character, and terminate the string with the end-of-string
character 0 (zero). (If you use a string without a terminator in a function that
expects a string, or in a Cicode expression, you could get invalid results.) To use
the string to build up a buffer, you do not need the terminating 0 (zero).
StrSetChar(sText, iOffset, Char)
sText: . . . . . . . . . . . The destination string.
iOffset: . . . . . . . . . . The offset in the string, commencing at 0.
Char: . . . . . . . . . . . . The ASCII character to set into the string.
Return Value
Related Functions
Example
See Also
String Functions
StrToChar
Description
Syntax
Return Value
Related Functions
Example
See Also
String Functions
StrToDate
Description
Converts a "date" string into a time/date variable. This variable is the same as
returned from the TimeCurrent() function. To set the order of the day, month,
and year, and the delimiter, use the Windows Control panel.
Note: Time/date functions can only be used with dates from 1980 to 2035. You
should check that the date you are using is valid with the following Cicode:
IF StrToDat(Arg1)>0 THEN
.
.
ELSE
.
.
END
Syntax
StrToDate(String)
String: . . . . . . . . . . The source string.
Return Value
Related Functions
Example
599
600
See Also
String Functions
StrToFmt
Description
Syntax
Converts a string into field data for a format template. This function is useful for
breaking a string into separate strings. After the string is converted, you can call
the FmtGetField() function to extract the individual data from the template
fields.
StrToFmt(hFmt, String)
hFmt: . . . . . . . . . . . The format template handle, returned from the FmtOpen()
function. The handle identifies the table where all data on the
associated format template is stored.
String: . . . . . . . . . . The source string.
Return Value
Related Functions
Example
See Also
String Functions
StrToGrp
Description
Syntax
Converts a string into a group and places it into a group number. Any existing
values in the group are cleared before the new values are inserted. The group
string is a series of numbers separated by " , " to list individual values or " .. " to
specify a range of values.
StrToGrp(hGrp, Str)
hGrp: . . . . . . . . . . . The group handle, returned from the GrpOpen() function.
The group handle identifies the table where all data on the
associated group is stored.
Str: . . . . . . . . . . . . . The string to convert.
Return Value
GrpOpen
hGrp=GrpOpen("MyGrp",1);
! Set group to 1 ... 10 and 20, 30 and 40.
StrToGrp(hGrp,"1..10,20,30,40");
See Also
String Functions
StrToHex
Description
Syntax
Converts a hexadecimal string into an integer. This function will search the
string for the first non-blank character, and then start converting until it finds
the end of the string or a non-hexadecimal numeric character. If the first nonblank character is not one of the following hexadecimal characters, the return
value is 0 (zero):
A space;
StrToHex(String)
String: . . . . . . . . . . The string to convert.
Return Value
Related Functions
Example
See Also
String Functions
601
602
StrToInt
Description
Syntax
Converts a string into an integer. This function will search the string for the first
non-blank character, and then start converting until it finds the end of the string
or a non-numeric character. If the first non-blank character is not a numeric
character (0-9), a space, a " + " or a " - " sign, the return value is 0 (zero).
StrToInt(String)
String: . . . . . . . . . . The string to convert.
Return Value
Related Functions
Example
See Also
String Functions
StrToLines
Description
Converts a string into separate lines that contain no more than the number of
characters specified in the MaxChars argument.
The function breaks the string by inserting newline characters into the text
string, thus dividing it into separate lines. The string will be broken at a
whitespace character if possible, and that whitespace will be replaced by the
newline character. If no whitespace characters are available then the insertion
will be made at the maximum number of characters from the previous line
break.
Syntax
StrToLines(String,MaxChars, nLines)
String: . . . . . . . . . . The string to convert.
MaxChars: . . . . . . . The maximum number of characters permitted in each new
line produced by the StrToLines() function.
nLines: . . . . . . . . . . The number of lines produced by the StrToLines() function
from the input string.
Example
See Also
String Functions
StrToLocalText
Description
Converts a native string into the local version of that string. (The string must be
contained within quotation marks, as shown in the example below.) The local
version is taken from the current language database (as specified using the
[Language]LocalLanguage parameter).
StrToLocalText(sText)
sText . . . . . . . . . . . . The string for which you would like the local translation
returned. This string must be enclosed in quotation marks.
For example:
"@(Motor Overload)"
Return Value
Related Functions
The local version of the text if it was found, otherwise the native text or "#MESS"
is returned, depending on the setting of the [Language]DisplayError
parameter.
LanguageFileTranslate, SetLanguage
603
604
StrToLocalText("@(Motor Overload)");
! Returns the Local translation of Motor Overload.
See Also
String Functions
StrToPeriod
Description
Converts a string into a time period. You would normally use this function to
convert operator input, e.g. to set a trend period.
A valid period string is in the format HH:MM:SS, MM:SS or SS, where HH is the
hours, MM is the minutes and SS is the seconds. The colon character (':')
represents the time delimeter for these fields, which will be the current system
time delimeter as set in the Windows Control Panel.
If minutes are specified, seconds must be in the range 0-59. If hours are specified,
minutes must be in the range 0-59.
Syntax
StrToPeriod(String)
String: . . . . . . . . . . The string to convert.
Return Value
Related Functions
Example
See Also
String Functions
StrToReal
Description
Converts a string into a floating-point number. This function will search the
string for the first non-blank character, and then start converting until it finds
the end of the string or a non-numeric character. If the first non-blank character
is not a numeric character (0-9), a space, a decimal point, a " + " or a " - " sign, the
return value is 0 (zero).
StrToReal(String)
String: . . . . . . . . . . The string to convert.
Return Value
Related Functions
Example
See Also
String Functions
StrToTime
Description
Converts a "time" string into a time/date variable. The value returned is the
number of seconds from midnight. You can add this value to the date to get the
current time value. To set the time delimiter, use the Windows Control Panel.
A valid time string is in the format HH:MM:SS or HH:MM:SS tt, where HH is
the hour in the range 0-23, MM is the minute in the range 0-59, SS is the second
in the range 0-59 and tt is the time extension; e.g., am or pm. The colon character
':' represents the time delimeter for these fields, which will be the current system
time delimeter as set in the Windows control panel.
Times may also be passed in the for HH or HH:MM. In other words, you may
omit the right-hand fields if they are 0.
Syntax
StrToTime(String)
String: . . . . . . . . . . The string to convert.
Return Value
Related Functions
Example
605
606
See Also
String Functions
StrToValue
Description
Syntax
StrToValue(String)
String: . . . . . . . . . . The string to convert.
Return Value
Related Functions
Example
System Keyboard
Key Sequence
Command
Comment
F3 ######## Enter
SP123 = StrToValue(Arg1);
Set setpoint 123 to value unless value is invalid
Note that the Cicode is halted. Any other Cicode after the StrToValue() function
will not execute.
See Also
String Functions
StrTrim
Description
Removes leading and trailing spaces from a string. Internal spaces are not
removed from the string.
StrTrim(String)
String: . . . . . . . . . . The source string.
Return Value
Related Functions
Example
Test String
");
See Also
String Functions
StrUpper
Description
Syntax
Return Value
Related Functions
Example
See Also
String Functions
StrWord
Description
Syntax
Gets the first word from a string. The word is removed from the string to allow
the function to be repeated. Word separators can be a space, newline, carriage
return, or tab character.
StrUpper(String)
String: . . . . . . . . . . The source string.
Return Value
607
608
StrSearch
Str="THIS IS A STRING";
Variable=StrWord(Str);
! Sets Variable to "THIS".
Variable=StrWord(Str);
! Sets Variable to "IS".
Variable=StrWord(Str);
! Sets Variable to "A".
Variable=StrWord(Str);
! Sets Variable to "STRING".
See Also
String Functions
SwitchConfig
Description
Syntax
Return Value
Example
See Also
Miscellaneous Functions
SysTime
Description
Gets the CitectSCADA internal system millisecond counter. The counter is not
based on time, but counts from 0 up to the maximum integer value and then
back to 0.
Syntax
Return Value
Related Functions
Example
See Also
SysTime()
The CitectSCADA internal system millisecond counter (as an integer).
SysTimeDelta, Time, TimeCurrent
Start=SysTime();
! Gets the current time.
.
.
Delay=SysTime()-Start;
! Sets Delay to the time difference, in milliseconds.
Time/Date Functions
SysTimeDelta
Description
Calculates the time difference between a start time and the current time, and
updates the start time to the current time. You can time continuous events in a
single operation. See the SysTime() function for information on its use.
Note: Time/date functions can only be used with dates between 1980 and 2035.
You should check that the date you are using is valid with Cicode similar to the
following:
IF StrToDate(Arg1)>0 THEN
.
.
ELSE
609
610
Syntax
SysTimeDelta(Start)
Start: . . . . . . . . . . . . The start time returned from the SysTime() function.
Return Value
Related Functions
Example
The time difference from a start time and the current time.
SysTime
Start=SysTime();
! Gets the current time.
.
.
Delay1=SysTimeDelta(Start);
! Sets Delay1 to the time difference from Start.
.
.
Delay2=SysTimeDelta(Start);
! Sets Delay2 to the time difference from the last SysTimeDelta()
call.
See Also
Time/Date Functions
TableLookup
Description
Syntax
Searches for a value in a table, and returns the position (offset) of the value in the
table. Note that the first item in a table is offset 0 (zero), the next item is offset 1,
etc.
TableLookup(Table, Size, Value)
Table: . . . . . . . . . . . The table to search. The table must be an array of real
numbers.
Size: . . . . . . . . . . . . The maximum number of items in the table.
Value: . . . . . . . . . . . The value to locate.
Return Value
Related Functions
The offset to the table value, or -1 if the value does not exist.
TableMath
REAL Levels[5]=10,15,50,100,200;
Variable=TableLookup(Levels,5,50);
! Sets Variable to 2.
Variable=TableLookup(Levels,5,45);
! Sets Variable to -1.
See Also
TableMath
Description
Syntax
- Minimum
- Maximum
- Average
- Standard deviation
- Total
Return Value
Related Functions
611
612
REAL Array[5]=10,15,50,100,200;
REAL Min,Avg;
! Get the minimum value.
Min=TableMath(Array, 5, 0, 0); ! Sets Min to 10.
! Get the average value.
Avg=TableMath(Array, 5, 2, 0); ! Sets Avg to 75.
See Also
TableShift
Description
Syntax
Shifts table items in a table by a number of positions. You can shift the table left
or right. Items shifted off the end of the table are lost. Items within a table that
are not replaced by other items (that have moved) are set to 0.
TableShift(Table, Size, Count)
Table: . . . . . . . . . . . The table to shift, an array of real numbers.
Size: . . . . . . . . . . . . The maximum number of items in the table.
Count: . . . . . . . . . . . The number of positions to shift the table items. A negative
Count moves items to the right and a positive Count moves
items to the left.
Return Value
Related Functions
Example
See Also
TagDebug
Description
Displays a dialog which allows you to select from a list of all the configured
variable tags in your system. Once you have selected a tag, you can either press
the Read button to get the tag's current value; or change the value by entering a
new one, and pressing the Write button. This function is useful for debugging or
commissioning.
To read or change (write) the value of an element in an array variable, type it into
the dialog's variable tag field as follows:
Syntax
Return Value
Related Functions
Example
See Also
TagDebug()
The name of the tag entered in the dialog.
TagInfo, TagRead, TagWrite
TagDebug(); /* Display debug form to allow user to debug */
TagInfo
Description
Syntax
Gets information about a variable tag. This function allows you to develop
generic Cicode and Super Genies.
TagInfo(sName, nType)
sName: . . . . . . . . . . The name of the tag from which to get information.
To get information on a particular element in an array, enter
the array name here, followed by the number of the element
as follows:
"PLC_Array[9]"
613
614
Bits 16 - zero-padded
See Also
TagRamp
Description
Syntax
The above example tells the function to read the 10th element
in the array variable PLC_Array (remember, the address of
the first element in an array is 0 (zero)).
If you enter an array offset using the nOffset argument, it will
be added to the index value specified here. For example,
TagRead("PLC_Array[9]", 4) will read the 14th element in
PLC_Array (because [9] means the 10th element, and an
offset of 4 means 4 elements after the 10th = element 14).
iPercentInc: . . . . . . The percentage by which you want to increase the value of
the variable. A negative number will decrease the variable.
The increment is calculated as a percentage of the full range.
Return Value
615
616
Example
Buttons
Text
Repeat Command
Comment
See Also
Ramp Up
TagRamp("PLC_VAR_1",2);
Continual increment by 2%
TagRead
Description
Reads a variable from the I/O device. The variable tag must be defined in the
Variable Tags database. Because the variable tag is specified as a string (not as a
tag), you can ignore the data type of the variable.
This function is a blocking function. It blocks the calling Cicode task until the
operation is complete.
If you try to read many variables at the same time, the TagRead() function may
be slow. The offset index for array variables is checked against the size of the
array.
Note: This function uses the format from the Variable Tag Database to format
the resulting string. This m means that if, for example, real_test = 12.345678, and
is defined with format ##.##, ("real_test") will return 12.35.
Syntax
TagRead(sTag, nOffset)
sTag: . . . . . . . . . . . . The variable tag name (or alarm property name), as a string.
To read a particular element in an array, you can enter the
array name here, followed by an index to the element as
follows:
"PLC_Array[9] "
The above example tells the function to read the 10th element
in the array variable PLC_Array (remember, the address of
the first element in an array is 0 (zero)).
If you enter an array offset using the nOffset argument, it will
be added to the index value specified here. For example,
TagRead("PLC_Array[9]", 4) will read the 14th element in
PLC_Array (because [9] means the 10th element, and an
offset of 4 means 4 elements after the 10th = element 14).
Related Functions
Example
The value of the I/O device variable, as a string. An error is returned if the tag
does not exist, or if the variable cannot be read from the I/O device.
TagWrite, IODeviceControl, IODeviceInfo
sValueVar1 = TagRead("PLC_VAR1");
sValueVarStr = TagRead("PLC_VAR_STR"); ! Read string data
/* Read the 15 element in array variable "PLC_Array" */
PLC_Array_15 = TagRead("PLC_Array[14]");
See Also
TagScaleStr
Description
Syntax
Gets the value of a tag at a specified scale. The value is returned as a formatted
string using the tags format specification and (optionally) the engineering units.
Use this function to write generic Cicode that will work with any type of tag.
The variable tag must be defined in the Variable Tags database.
TagScaleStr(sTag, Percent, EngUnits)
sTag: . . . . . . . . . . . . The name of the tag.
Percent: . . . . . . . . . . The percentage of full scale of the returned value.
EngUnits: . . . . . . . . Determines if the value is returned with engineering units:
0 - Do not return the value with engineering units
1 - Return the value with engineering units
Return Value
Related Functions
Example
617
618
See Also
TagWrite
Description
Writes to an I/O device variable by specifying the variable tag. The variable tag
must be defined in the Variable Tags database.
This function completes asynchronously to the caller. An error only occurs if the
tag does not exist. If the function fails to write to the I/O device, a hardware error
is generated.
Syntax
The above example tells the function to read the 10th element
in the array variable PLC_Array (remember, the address of
the first element in an array is 0 (zero)).
If you enter an array offset using the nOffset argument, it will
be added to the index value specified here. For example,
TagRead("PLC_Array[9]", 4) will read the 14th element in
PLC_Array (because [9] means the 10th element, and an
offset of 4 means 4 elements after the 10th = element 14).
sValue: . . . . . . . . . . The value to be written to the I/O device variable. The value
is specified as a string. The function converts the string into
the correct format, and then writes it to the variable.
To write to a particular element in an array, you can enter the
array name here, followed by an index to the element as
follows:
"PLC_Array[9] "
Related Functions
Example
See Also
TagWrite("PLC_VAR1", 123);
TagWrite("PLC_VAR_STR", "string data to write");
TagWrite("PLC_ARRAY", 42, 3); ! Write to element 4 in array
TagWrite("PLC_Array[9]", 2); ! Write to element 12 in array
Tan
Description
Syntax
Return Value
Related Functions
Example
See Also
Math/Trigonometry Functions
619
620
TaskGetSignal
Description
Syntax
Retrieves a value that indicates the signal that is currently set for a specific task.
This function can be used to check the value of the current signal before using
TaskSetSignal to apply a new signal.
TaskGetSignal(Hnd)
Hnd: . . . . . . . . . . . . The task's handle. To retreive this use the function
TaskHnd().
Return Value
Related Functions
See Also
The value of the current signal. (0 (zero) represents normal operation, 1 indicates
the task is stopped).
TaskSetSignal, TaskHnd, TaskKill, TaskNew, TaskResume
Task Functions
TaskHnd
Description
Syntax
Gets the task handle of a specific task. You can then use the task handle with
other task functions to control the task. If you do not specify a thread name, it
will default to that of the current task.
TaskHnd(sName)
sName: . . . . . . . . . . The thread name of the task. The thread name is the name of
the function that was passed to the TaskNew() function. For
example, if. . .
TaskNew("MyTask","",0);
then:
hTask=TaskHnd("MyTask");
The task handle, identifying the table where all data on the task is stored.
TaskKill, TaskNew, TaskResume, TaskSuspend
! Get the task handle of the current task and then kill it.
See Also
Task Functions
TaskKill
Description
Syntax
Kills a task. The Cicode task will be stopped and will not run again.
TaskKill(hTask)
hTask: . . . . . . . . . . . The task handle, returned from the TaskNew() or TaskHnd()
function. The task handle identifies the table where all data
on the associated task is stored.
Return Value
Related Functions
Example
See Also
Task Functions
621
622
TaskNew
Description
Creates a new Cicode task and returns the task handle. You pass the Name of the
function (that creates the task) as a string, not as the function tag, and pass all the
arguments for that function in Arg. After the task is created, it runs in parallel to
the calling task. The new task will run forever unless it returns from the function
or is killed by another task.
You can set the Mode to run the task forever or only until the current page is
changed or the current window is freed. If you do not add 4 to the Mode,
CitectSCADA starts the task immediately, without reading any data from the I/O
devices - any I/O device variable that you use will either contain 0 (zero) or the
last value read. If you add 4 to the Mode, CitectSCADA requests all I/O device
data and waits for the data to be returned before starting the task - the task is
provided with the correct data, but there will be a delay in starting the task. Use
Mode 4 when the I/O device data must be read, but do not use Mode 4 when the
task has to start immediately.
It is also possible to specify that if the task is already running, the function will
fail, and an error will display. This is useful when you want only a single
instance of the function running at any point in time.
While a task runs, its copy of the I/O device data is not refreshed, so if a task
runs for a long time, the data may become old. Use the ReRead() function to
update the data (if required).
Any animation output for the new task is displayed in the window where it was
created. If you want to send output to other windows, use the WinSelect()
function.
Syntax
Related Functions
Example
The task handle, or -1 if the task cannot be successfully created. The task handle
identifies the table where all data on the associated task is stored.
TaskHnd, TaskKill, TaskResume, TaskSuspend, ReRead,
WinSelect
! Create a task that displays a message for 10 seconds.
hTask=TaskNew("MyFunc","Data",0);
! Continue to run while task runs.
FUNCTION
MyFunc(STRING Msg)
FOR I=0 TO 10 DO
Prompt(Msg);
Sleep(1);
END
END
.
.
! Call a function which expects more complex argument
hTask=TaskNew("ArgFunc","^"string one^",^"string two^",1,2",0);
hTask=TaskNew("ArgFunc","^""+sOne+"^",^""+sTwo+"^","+iOne:##+","+
iTwo:##,0);
FUNCTION
ArgFunc(STRING sOne, STRING sTwo, INT iOne, INT iTwo)
.
.
END
See Also
Task Functions
TaskResume
Description
Syntax
Resumes a task that was suspended by the TaskSuspend() function. After a task
is resumed, it runs on the next time-slice.
TaskResume(hTask)
623
624
Task Functions
TaskSetSignal
Description
Syntax
Return Value
Related Functions
See Also
TaskSuspend
Description
Syntax
Suspends a task. The task will stop running and will start again only when
TaskResume() is called.
TaskSuspend(hTask)
hTask: . . . . . . . . . . . The task handle, returned from the TaskNew() or TaskHnd()
function. The task handle identifies the table where all data
on the associated task is stored.
Return Value
See Also
Task Functions
TestRandomWave
Description
Syntax
Generates a random wave. The height of the wave is restricted by minimum and
maximum values. You can offset the starting point of the wave, for example, to
display multiple waves at the same AN. You can use this function to generate
test input.
TestRandomWave(Period, Low, High, Offset)
Period: . . . . . . . . . . The number of seconds required to generate one cycle of the
wave. If no period is entered, the period has a default of 60.
Low: . . . . . . . . . . . . The lowest value of the wave. If no low value is entered, this
value has a default of 0.
High: . . . . . . . . . . . . The highest value of the wave. If no high value is entered,
this value has a default of 100.
Offset: . . . . . . . . . . . The offset in seconds, to generate the wave. If no offset is
entered, the offset has a default of 0.
Return Value
Related Functions
Example
See Also
Miscellaneous Functions
TestSawWave
Description
Generates a saw wave. The height of the wave is restricted by minimum and
maximum values. You can offset the starting point of the wave, for example, to
625
626
Return Value
Related Functions
Example
See Also
Miscellaneous Functions
TestSinWave
Description
Syntax
Generates a sine wave. The height of the wave is restricted by minimum and
maximum values. You can offset the starting point of the wave, for example, to
display multiple waves at the same AN. You can use this function to generate
test input.
TestSinWave(Period, Low, High, Offset)
Period: . . . . . . . . . . The number of seconds required to generate one cycle of the
wave. If no period is entered, the period has a default of 60.
Low: . . . . . . . . . . . . The lowest value of the wave. If no low value is entered, this
value has a default of 0.
High: . . . . . . . . . . . . The highest value of the wave. If no high value is entered,
this value has a default of 100.
Offset: . . . . . . . . . . . The offset in seconds, to generate the wave. If no offset is
entered, the offset has a default of 0.
See Also
Miscellaneous Functions
TestSquareWave
Description
Syntax
Generates a square wave. The height of the wave is restricted by minimum and
maximum values. You can offset the starting point of the wave, for example, to
display multiple waves at the same AN. You can use this function to generate
test input.
TestSquareWave(Period, Low, High, Offset)
Period: . . . . . . . . . . The number of seconds required to generate one cycle of the
wave. If no period is entered, the period has a default of 60.
Low: . . . . . . . . . . . . The lowest value of the wave. If no low value is entered, this
value has a default of 0.
High: . . . . . . . . . . . . The highest value of the wave. If no high value is entered,
this value has a default of 100.
Offset: . . . . . . . . . . . The offset in seconds, to generate the wave. If no offset is
entered, the offset has a default of 0.
Return Value
Related Functions
Example
See Also
Miscellaneous Functions
627
628
TestTriangWave
Description
Syntax
Return Value
Related Functions
Example
See Also
Miscellaneous Functions
Time
Description
Time(Format)
Format: . . . . . . . . . . The format of the time:
0
Example
See Also
Time/Date Functions
TimeCurrent
Description
Gets the current system time/date in time/date variable format. Note that
CitectSCADA stores time as the number of seconds since 01/01/1970. You can
convert this value into usable date and time variables by using the various Date
and Time functions.
Note: Time/date functions can only be used with dates between 1980 and 2035.
You should check that the date you are using is valid with Cicode similar to the
following:
IF StrToDate(Arg1)>0 THEN
.
.
ELSE
.
.
END
Syntax
Return Value
TimeCurrent()
A time/date variable.
629
630
StrToDate, StrToTime
! If the current system time is 11:43:10 a.m.;
TimeVariable=TimeToStr(TimeCurrent(),0);
! Sets TimeVariable to "11:43".
See Also
Time/Date Functions
TimeHour
Description
Syntax
TimeHour(Time)
Time: . . . . . . . . . . . . The time/date variable.
Return Value
Related Functions
Example
See Also
Time/Date Functions
TimeInfo
Description
Syntax
"0" - 12 hour
"1" - 24 hour
Related Functions
Example
Current time hour format ("0" for 12 hour, "1" for 24 hour)
DateInfo
! If the current system time is 15:43:10.;
ClockType=TimeInfo(1);
! Sets ClockType to "1".
See Also
Time/Date Functions
TimeMidNight
Description
Returns the number of seconds between midnight on January 1, 1970, and the
midnight immediately prior to the specified time/date. This function is useful for
performing calculations with the time and date.
Note: Time/date functions can only be used with dates from 1980 to 2035. You
should check that the date you are using is valid with Cicode similar to the
following:
IF StrToDate(Arg1)>0 THEN
.
.
ELSE
.
.
END
631
632
TimeMidNight(Time)
Time: . . . . . . . . . . . . The time/date variable.
Return Value
Related Functions
Example
A time/date variable.
TimeCurrent
timeNow = TimeCurrent();
! get the time variable at 7am today
time7am = TimeMidNight(timeNow) + 7*60*60;
IF timeNow > time7am AND timeNow < time7am + 10 THEN
Beep();
Prompt("Wake Up!");
END
See Also
Time/Date Functions
TimeMin
Description
Syntax
TimeMin(Time)
Time: . . . . . . . . . . . . The time/date variable.
Return Value
Related Functions
Example
Time/Date Functions
TimeSec
Description
Syntax
TimeSec(Time)
Time: . . . . . . . . . . . . The time/date variable.
Return Value
Example
See Also
Time/Date Functions
TimeSet
Description
Sets the new system time. You can set the time only on the computer where this
function is called, or on the time server (and therefore on all CitectSCADA
computers on the network).
When you change the time on the time server, the alarm, report, and trend
servers must adjust their databases records to the new time. Adjusting records
can be time-consuming and can cause some loss of data (if data logging is in
progress). Change the time only if necessary.
Note: Time/date functions can only be used with dates from 1980 to 2035. You
should check that the date you are using is valid with Cicode similar to the
following:
633
634
Syntax
TimeSet(Time, Mode)
Time: . . . . . . . . . . . . The time/date variable to which the new time is set.
Mode: . . . . . . . . . . . The mode of the set:
0 - Sets the time on this computer only. If this computer is a
time server, the time will be sent to all other
CitectSCADA computers on the network.
1 - Set the time on this computer, and also send this time to
the time server. The time server will then send the new
time to all other CitectSCADA computers on the
network.
2 - Get the time from the time server. The Time argument is
ignored.
4 - Send this computer's time to the time server. The time
server will then send this time to all other
CitectSCADA computers on the network. The Time
argument is ignored.
Return Value
Related Functions
Example
See Also
Time/Date Functions
TimeToOLEDate
Description
Syntax
Converts a Citect time/date value to an OLE DATE value (this should be stored
in a REAL).
TimeToOLEDate(Time, Local)
Time: . . . . . . . . . . . . Time/date variable.
Local: . . . . . . . . . . . 0: The return value is output as UTC time. 1 The return
value is output as Local time.
Return Value
Related Functions
Example
See Also
Time/Date Functions
TimeToStr
Description
Converts a time/date variable into a string. Use this function for calculating time
differences or run times, and so on. Set Format to 6 to convert time periods that
are in milliseconds, such as the times that are returned from the SysTime() and
SysTimeDelta() functions.
Warning! Once a date/time is retrieved as UTC, the string cannot be used by the
Cicode functions StrToDate and StrToTime to synthesize a date/time value as
these functions support local time only.
Note: Time/date functions can only be used with dates from 1980 to 2035. You
should check that the date you are using is valid with Cicode similar to the
following:
IF StrToDate(Arg1)>0 THEN
.
.
ELSE
.
.
END
Syntax
635
636
Related Functions
Example
See Also
Time/Date Functions
TimeUTCOffset
Description
Syntax
Determines the local time bias from UTC that was in force at a specified time.
For example, US Pacific Standard Time is -8 hrs from UTC, so -28000 would be
returned (-8 hours x 60 mintues x 60 seconds). However, if the specified time
occurred during daylight saving, the returned value would be -7 hours (or 25200 seconds).
TimeUTCOffset(Time)
Time: . . . . . . . . . . . . The time/date variable.
Return Value
Related Functions
See Also
Toggle
Description
Syntax
Toggles a digital tag on or off. If the variable tag is ON (1), this function will turn
it OFF. If the variable tag is OFF (0), this function will turn it ON.
Toggle(sTag)
sTag . . . . . . . . . . . . . The digital tag to toggle.
Return Value
Related Functions
Example
Buttons
Text
Command
Comment
See Also
Motor 145
Toggle(M145)
Toggle the variable tag M145 (Motor 145) on or off
Miscellaneous Functions
TraceMsg
Description
637
638
TraceMsg(String)
String . . . . . . . . . . . The message to display.
Return Value
Related Functions
Example
See Also
Miscellaneous Functions
TrnAddHistory
Description
Adds an old (backed up) trend history file to the trend system so that its data can
be used. When you back-up a trend file, change its extension so that it indicates
the age of the files trend data (for example, the month and year).
AN archived trend file does not need to reside in the same directory as existing
active trends. CitectSCADA retrieves the trend name from the header of the
specified file and adds its data to the trend history. Note that only a reference to
the archived file, and not the file itself, is kept in the trend history. Therefore,
care must be taken if using this function to access archived files residing on
removable storage media. When you remove the media, the archived data is no
longer available for display.
This function can only be used at a Trends Server. However, a client can call this
function remotely by using the MsgRPC() function.
Syntax
TrnAddHistory(FileName)
FileName: . . . . . . . . The file name and directory path of an old history file. The
old file does not need to reside in the same directory as
existing active trends to be restored.
Return Value
Related Functions
Example
See Also
Trend Functions
TrnClientInfo
Description
Syntax
Gets information about the trend that is being displayed at the AN point.
TrnClientInfo(hAn, Pen, Type, Data, Error)
hAN: . . . . . . . . . . . . The AN point number at which the trend is displayed.
Pen: . . . . . . . . . . . . . The trend pen number:
0 - The pen currently in focus
1...8 - Pen1. . .Pen8
Type: . . . . . . . . . . . . The type of information you would like returned.
1 - The number of samples configured for the trend. If you
select Type 1, the Data argument is ignored.
Data: . . . . . . . . . . . . For future enhancements; is currently ignored.
Error: . . . . . . . . . . . An output argument. If the function is successful, the error is
set to 0 (zero). If unsuccessful, an error value is set, and a
hardware alarm is triggered.
Return Value
Related Functions
Example
See Also
Trend Functions
TrnComparePlot
Description
Prints two trends, one overlaid on the other. Each trend can have up to four tags
configured on it. The significance of this type of plot is that the two trends show
639
640
See Also
Trend Functions
TrnDelete
Description
Syntax
Deletes a trend that is displayed on a current page. This trend may have been
created by the TrnNew() function or by a trend object.
TrnDelete(AN)
AN: . . . . . . . . . . . . . The AN where the trend is located.
Return Value
Related Functions
Example
See Also
Trend Functions
641
642
TrnDelHistory
Description
Removes a trend history file that has been added to the trend system by the
TrnAddHistory() function. This function does not delete the file completely, it
only disconnects it from the historical trend system.
This function can only be used at a Trends Server. However, a client can call this
function remotely by using the MsgRPC() function.
Syntax
TrnDelHistory(FileName)
FileName: . . . . . . . . The trend history file to disconnect from the historical trend
system.
Return Value
Related Functions
Example
See Also
Trend Functions
TrnEcho
Description
Syntax
Enables and disables the echo of the trend display. Use this function when you
need to make many changes to a trend display, so that the display updates only
once. You should first disable the trend echo, do all the trend changes, and then
enable the echo to show the changes.
TrnEcho(AN, nMode)
AN: . . . . . . . . . . . . . The animation number of the trend.
nMode: . . . . . . . . . . The mode of the echo:
0 - Disable echo of the trend display.
1 - Enable echo of the trend display, to show changes.
Return Value
Related Functions
Example
The current echo mode, otherwise 0 (zero) is returned, and an error code is set.
You can call the IsError() function to get the actual error code.
TrnSetScale, TrnSetPeriod
! Disable echo of trend display at AN40
See Also
Trend Functions
TrnEventGetTable
Description
Stores event trend data in an event table and the associated time stamp in a time
table, for a specified trend tag. Data is stored at the specified Period, working
backwards from the starting point specified by EventNo. If Period differs from the
trend period configured in the Trend Tags database, the values to be stored are
calculated from the trend data. Values are either averaged or interpolated.
This function is a blocking function. It blocks the calling Cicode task until the
operation is complete.
Syntax
643
644
Related Functions
See Also
The actual number of samples read. The return value is 0 if an error occurs. You
can call the IsError() function to get the actual error code. If EventNo is 0 (zero)
then the EventNo will be set to the current event number.
TrnEventSetTable, TrnGetEvent, TrnGetDisplayMode
Trend Functions
TrnEventGetTableMS
Description
Stores event trend data and time data (including milliseconds) for a specified
trend tag. The event trend data is stored in an event table, and the time stamp in
time tables. Data is stored at the specified Period, working backwards from the
starting point specified by EventNo. If Period differs from the trend period
configured in the Trend Tags database, the values to be stored are calculated
from the trend data. Values are either averaged or interpolated.
This function is a blocking function. It blocks the calling Cicode task until the
operation is complete.
Syntax
645
646
Related Functions
See Also
The actual number of samples read. The return value is 0 if an error occurs. You
can call the IsError() function to get the actual error code.
TrnEventSetTableMS TrnGetEvent, TrnEventGetTable
Trend Functions
TrnEventSetTable
Description
Adds new event to a trend, or overwrites existing points with new values.
To add new events, set 'EventNo' to zero. The events are inserted at a point
determined by the time stamp associated with each event. If the timestamp of a
Related Functions
Example
The actual number of samples read. The return value is 0 if an error occurs. You
can call the IsError() function to get the actual error code.
TrnEventGetTable
REAL TrendTable1[100];
INT TimeTable[100];
/* Defines an array of a maximum of 100 entries. Assume that
TrendTable1 has been storing data from a source. */
TrnEventSetTable("OP1",nEventNo, 1,10,TrendTable1[0],
TimeTable[0]);
/* A set of 10 trend data values are set for the OP1 trend tag. */
647
648
Trend Functions
TrnEventSetTableMS
Description
Sets event trend data and time data (including milliseconds) for a specified trend
tag. The event trend data is set in an event table, and the time stamp in time
tables. Data is set at the period specified, working backwards from the starting
point specified by EventNo.
If the period of setting data differs from the trend period (defined in the Trend
Tags database), the values to be set are calculated from the trend data, either
averaged or interpolated. The user must have the correct privilege (as specified
in the Trend Tags form), otherwise the data is not written.
This function is a blocking function. It blocks the calling Cicode task until the
operation is complete.
Syntax
Period: . . . . . . . . . . This will be the interval (in seconds) between trend values
when they are set (i.e. it will be the perceived sampling
period for the trend). This period can differ from the actual
trend period. Set to 0 (zero) to default to the actual trend
period.
Length: . . . . . . . . . . Number of trend values in the trend table.
Table: . . . . . . . . . . . Table of floating-point values in which the trend data is
stored. You can enter the name of an array here (see
example).
TimeTable: . . . . . . . Table of integer values in which the time stamp is stored. To
ensure that events stay in correct time-stamp order, the
values in this table should be in ascending order. When
EventNo is non-zero the values in this table may be zero. This
will result in the values of the requested events being
overwritten but the timestamps staying the same.
Related Functions
Example
The actual number of samples read. The return value is 0 if an error occurs. You
can call the IsError() function to get the actual error code.
TrnEventGetTable
// Arrays for trend data
REAL garSingleValue[1];
INT ganSingleTime[1];
INT ganSingleMS[1];
// Push the data in the trend system
INT
FUNCTION LogTrend(STRING sTagName, REAL rValue, INT nDateTime, INT
nMS)
INT nSamplesWritten;
garSingleValue[0] = rValue;
ganSingleTime[0] = nDateTime;
ganSingleMS[0] = nMS;
nSamplesWritten= TrnEventSetTableMS(sTagname, 0, 0, 1,
garSingleValue[0], ganSingleTime[0], ganSingleMS[0]);
RETURN nSamplesWritten;
END
See Also
Trend Functions
TrnExportClip
Description
Exports trend data to the Windows Clipboard. The data is set at the specified
Time and Period, and listed from earliest to latest. Any gated or invalid data is
written as 0.0.
Data is stored as a grid, with each row time-stamped. The first column/field is
the date, followed by the time, followed by the tags 1 to 8.
You can use the ClipMode argument to make the output more useful. For
example, to paste the data into Excel, use ClipMode 2 for CSV format. If you use
ClipMode 1 or 3, the default paste menu option causes data to be pasted into the
users spreadsheet as text. If you use ClipMode 3, use the Paste Special option to
paste the required format. (Note that not all packages support multiple
clipboard formats in this way.)
Syntax
649
650
Related Functions
ClipSetMode, TrnExportCSV
651
652
See Also
Trend Functions
TrnExportCSV
Description
Exports trend data to a file in CSV (Comma Separated Variable) format. The data
is set at the specified Time and Period, and listed from earliest to latest. Any gated
or invalid data is written as 0.0.
Data is stored as a grid, with each row time-stamped. The first column/field is
the date, followed by the time, followed by the tags 1 to 8.
You can view the CSV file with a text editor, and import the file directly into
other packages such as Excel for data analysis and presentation.
Syntax
653
654
Related Functions
Example
TrnExportDBF, TrnPrint
TrnExportCSV("c:\TrnData.CSV", TimeCurrent(), 2, 60 * 60/2, 2,
"Feed", "Weight");
/* Export the last hour of data from the trend tags Feed and
Weight. Note that the 60 * 60/2 is a decomposed way or writing
1800, which is the numberof 2 second samples in 1 hour. */
See Also
Trend Functions
TrnExportDBF
Description
Exports trend data to a file in dBASE III format. The data is set at the specified
Time and Period, and listed from earliest to latest. Any gated or invalid data is
written as 0.0.
Data is stored as a grid, with each row time-stamped. The first column/field is
the date, followed by the time, followed by the tags 1 to 8.
You can import the DBF file directly into other packages such as Excel, for data
analysis and presentation.
Syntax
655
656
See Also
Trend Functions
TrnExportDDE
Description
Exports trend data via DDE. The data is set at the specified Time and Period, and
listed from earliest to latest. Any gated or invalid data is written as 0.0. Data is
stored as a grid, with each row time-stamped. The first column/field is the date,
followed by the time, followed by the tags 1 to 8.
657
658
Example
See Also
Trend Functions
TrnFlush
Description
Syntax
Writes acquired trend data to disk without waiting for the trend buffer to be
filled. CitectSCADA normally buffers the trend data in memory and only writes
to disk when required, to give optimum performance. Because this function
reduces the performance of the Trends Server, use it only when necessary.
TrnFlush(Name)
Name: . . . . . . . . . . . The name of the logging tag. Set to " * " to flush all trend data.
Return Value
Related Functions
Example
See Also
Trend Functions
659
660
TrnGetBufEvent
Description
Syntax
Gets the event number of a trend at an offset for a specified pen. This function
only operates on an event-based trend.
TrnGetBufEvent(AN, Pen, Offset)
AN: . . . . . . . . . . . . . The AN where the trend is located.
Pen: . . . . . . . . . . . . . The trend pen number:
0
1...8
- Pen1. . .Pen8
Related Functions
Example
See Also
Trend Functions
TrnGetBufTime
Description
Syntax
Gets the time and date of a trend at an offset for a specified pen. The Offset
should be a value between 0 (zero) and the number of samples displayed on the
trend.
TrnGetBufTime(AN, Pen, Offset)
AN: . . . . . . . . . . . . . The AN where the trend is located.
Pen: . . . . . . . . . . . . . The trend pen number:
0
1...8
- Pen1. . .Pen8
Related Functions
Example
See Also
Trend Functions
TrnGetBufValue
Description
Syntax
Gets the value of a trend at an offset for a specified pen. The offset should be a
value between -1 and the number of samples displayed on the trend.
TrnGetBufValue(AN, Pen, Offset)
AN: . . . . . . . . . . . . . The AN where the trend is located.
Pen: . . . . . . . . . . . . . The trend pen number:
0
1...8
- Pen1. . .Pen8
661
662
Related Functions
Example
The trend value. If the actual value is gated or invalid, the standard invalid or
gated values are returned (no error is set). You can check this return value using
TrnIsValidValue().
TrnGetCursorValue, TrnIsValidValue
! For the trend at AN20
DspText(31,0,TrnGetBufValue(20,0,10):###.#);
/* Displays the trend value at offset 10 for the pen currently in
focus. */
See Also
Trend Functions
TrnGetCursorEvent
Description
Syntax
Gets the event number of a trend, at the trend cursor position for a specified pen.
This function only operates on an event-based trend.
TrnGetCursorEvent(AN, Pen)
AN: . . . . . . . . . . . . . The AN where the trend is located.
Pen: . . . . . . . . . . . . . The trend pen number:
0
1...8
Return Value
Related Functions
Example
- Pen1. . .Pen8
See Also
Trend Functions
TrnGetCursorMSTime
Description
Gets the time (in milliseconds from the previous midnight) at a trend cursor for
a specified pen.
TrnGetCursorMSTime(AN, Pen)
AN: . . . . . . . . . . . . . The AN where the trend is located.
Pen: . . . . . . . . . . . . . The trend pen number:
0
1...8
Return Value
Related Functions
Example
- Pen1. . .Pen8
The number of milliseconds since the previous midnight. If the trend cursor is
disabled, 0 (zero) is returned. If AN or Pen is invalid, 0 (zero) is returned and an
error code is set.
TrnGetCursorTime
! For the trend at AN20
STRING timeStr;
STRING msecStr;
timeStr = TimeToString(TrnGetCursorTime(20,1),2) + " ";
msecStr = TimeToString(TrnGetCursorMSTime(20,1),6);
DspText(31,0,timeStr + msecStr);
returns
"23/02/01 10:53:22.717"
See Also
Trend Functions
TrnGetCursorPos
Description
Syntax
Return Value
Related Functions
Example
The offset of a trend cursor from its origin, in samples, or -1 if the trend cursor is
disabled.
TrnSetCursorPos
! For the trend at AN20
! If the trend cursor is disabled
Offset=TrnGetCursorPos(20);
! Sets Offset to -1.
663
664
See Also
Trend Functions
TrnGetCursorTime
Description
Syntax
Gets the time and date at a trend cursor for a specified pen.
TrnGetCursorTime(AN, Pen)
AN: . . . . . . . . . . . . . The AN where the trend is located.
Pen: . . . . . . . . . . . . . The trend pen number:
0
1...8
Return Value
Related Functions
Example
- Pen1. . .Pen8
See Also
Trend Functions
TrnGetCursorValue
Description
Syntax
1...8
Return Value
Related Functions
Example
- Pen1. . .Pen8
The trend value. If the actual value is gated or invalid, the standard invalid or
gated values are returned (no error is set). You can check this return value using
TrnIsValidValue().
TrnGetBufValue
! For the trend at AN20
DspText(31,0,TrnGetCursorValue(20,0));
! Displays the value at the trend cursor for the focus pen.
See Also
Trend Functions
TrnGetCursorValueStr
Description
Syntax
Gets the value at a trend cursor for a specified pen. The value is returned as a
formatted string using the pen's format specification and (optionally) the
engineering units.
TrnGetCursorValueStr(AN, Pen, EngUnits)
AN: . . . . . . . . . . . . . The AN where the trend is located.
Pen: . . . . . . . . . . . . . The trend pen number:
0
1...8
- Pen1. . .Pen8
Return Value
The trend value (as a string). If trend data is invalid, or an argument passed to
the function is invalid "<na>" is returned. If the actual value is gated (not
triggered) "<gated>" is returned. If the trend cursor is disabled, an empty string
is returned.
665
666
TrnGetCursorValue
! For the trend at AN20
DspText(31,0,TrnGetCursorValueStr(20,0,1));
/* Displays the value at the trend cursor for the focus pen. The
value will display as a formatted string (including the
engineering units).*/
See Also
Trend Functions
TrnGetDefScale
Description
Gets the default engineering zero and full scales of a trend tag.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
Syntax
Return Value
Related Functions
Example
See Also
Trend Functions
TrnGetDisplayMode
Description
Syntax
Returns the display mode of the selected trend pen. The display mode is set
using TrnSetDisplayMode.
TrnGetDisplayMode(AN, PenNumber)
AN: . . . . . . . . . . . . . The AN of the chosen trend.
1...8
Return Value
- Pen1. . .Pen8.
Related Functions
Example
TrnSetDisplayMode
int DisplayMode = TrnGetDisplayMode (10, 7)
/* Returns The Display Mode of pen 7 for the trend at AN 10.*/
See Also
Trend Functions
667
668
TrnGetEvent
Description
Syntax
Gets the event number of the trend at a percentage along the trend, using the
current event as the base point. This function only operates on an event-based
trend. The first recorded event (the start event) would be event number 1 and
the highest number would be the latest event. The event number is stored in a
LONG and would eventually wrap around if you have enough events.
TrnGetEvent(AN, Pen, Percent)
AN: . . . . . . . . . . . . . The AN of the chosen trend.
Pen: . . . . . . . . . . . . . The trend pen number:
0
1...8
- Pen1. . .Pen8
Percent: . . . . . . . . . . The percentage of the trend from the starting event, from 0
(the start event) to 100 (the end event).
Return Value
Related Functions
Example
See Also
Trend Functions
TrnGetFormat
Description
Syntax
1...8
- Pen1. . .Pen8
See Also
Trend Functions
TrnGetGatedValue
Description
Syntax
Return Value
Related Functions
Example
See Also
Returns the internally stored value for <GATED>. If the internally stored value
changes in the future, you will not need to modify your Cicode, as this function
ensures the return of the correct value.
TrnGetGatedValue()
The internally stored value for <GATED>.
TrnGetInvalidValue, TrnIsValidValue
MyTrendValue REAL;
IF MyTrendValue = TrnGetGatedValue() THEN
Prompt ("This value is <GATED>")
ELSE IF MyTrendValue = TrnGetInvalidValue() THEN
Prompt("This value is <TRN_NO_VALUES>")
ELSE
Prompt("Trend value is = " + RealToStr(MyTrendValue)
ENDIF
Trend Functions
TrnGetInvalidValue
Description
Syntax
Return Value
Returns the internally stored value for <INVALID>. If the internally stored value
changes in the future, you will not need to modify your Cicode, as this function
ensures the return of the correct value.
TrnGetInvalidValue()
The internally stored value for <INVALID>.
669
670
TrnGetGatedValue, TrnIsValidValue
! TrnIsValidValue() example
REAL newArray[100];
REAL oldArray[90];
INT trigger;
INT
FUNCTION
DoubleArray()
INT i;
FOR i = 0 to 99 DO
IF TrnIsValidValue(oldArray[i]) = 1 OR trigger = 0 THEN
newArray[i] = TrnGetGatedValue();
ELSE IF i >= 90 OR TrnIsValidValue(oldArray[i]) = 2 THEN
newArray[i] = TrnGetInvalidValue();
ELSE
newArray[i] = oldArray[i] * 2;
END END
END
RETURN i;
END
See Also
Trend Functions
TrnGetMode
Description
Syntax
1...8
Return Value
Related Functions
Example
- Pen1. . .Pen8
See Also
Trend Functions
TrnGetMSTime
Description
Syntax
Gets the time (in milliseconds from the previous midnight) of the trend (plotted
by a specified pen) at a percentage along the trend, using the time and date of
the right-most sample displayed. The time associated with the right-most
sample displayed is known as the end time. The start time is the time of the leftmost sample displayed. Percent 0 (zero) will correspond to the end time, and
Percent 100 will correspond to the start time
1...8
- Pen1. . .Pen8
Percent: . . . . . . . . . . The percentage of the trend from the time and date of the
right-most sample displayed (end time), from 0 to 100.
Return Value
671
672
TrnGetTime
! For Pen 1 at AN20
STRING timeStr;
STRING msecStr;
timeStr = TimeToString(TrnGetTime(20,1,100),2) + " ";
msecStr = TimeToString(TrnGetMSTime(20,1,100),6);
DspText(31,0,timeStr + msecStr);
returns
"23/02/01 10:53:22.717"
See Also
Trend Functions
TrnGetPen
Description
Syntax
1...8
Return Value
Related Functions
Example
- Pen1. . .Pen8
The trend tag (as a string) being plotted by Pen. If AN or Pen is invalid, an empty
string is returned, and an error code is set. You can call the IsError() function to
get the actual error code.
TrnSetPen
! For the trend at AN20
DspText(31,0,TrnGetPen(20,0));
! Displays the trend tag being plotted by the focus pen.
See Also
Trend Functions
TrnGetPenFocus
Description
TrnGetPenFocus(AN)
AN: . . . . . . . . . . . . . The AN of the chosen trend.
Return Value
Related Functions
Example
The pen currently in focus (between 1 and 8). If AN is invalid, -1 is returned and
an error code is set.
TrnSetPenFocus
! For the trend at AN20
DspText(31,0,TrnGetPenFocus(20));
! Displays the pen currently in focus.
See Also
Trend Functions
TrnGetPenNo
Description
Syntax
Gets the pen number of a pen name. The pens on a trend are either defined in the
Page Trends database or set by the TrnSetPen() function.
TrnGetPenNo(AN, Tag)
AN: . . . . . . . . . . . . . The AN of the chosen trend.
Tag: . . . . . . . . . . . . . The trend tag.
Return Value
Related Functions
Example
See Also
Trend Functions
673
674
TrnGetPeriod
Description
Syntax
Gets the current display period of a trend. (To obtain the sampling period, use
the TrnInfo function.)
TrnGetPeriod(AN)
AN: . . . . . . . . . . . . . The AN of the chosen trend.
Return Value
Related Functions
Example
The current display period of a trend (in seconds), or 0 (zero) if an error occurs.
TrnSetPeriod, TrnInfo
/* For the trend at AN20, get and display the current display
period. */
! If the period is 10 seconds
INT Period;
STRING Str;
Period=TrnGetPeriod(20);
Str=TimeToStr(Period,5);
DspStr(31,"",Str);
See Also
Trend Functions
TrnGetScale
Description
Syntax
Gets the display scale of the trend tag being plotted by a specified pen.
TrnGetScale(AN, Pen, Percent)
AN: . . . . . . . . . . . . . The AN of the chosen trend.
Pen: . . . . . . . . . . . . . The trend pen number:
0
1...8
- Pen1. . .Pen8
Related Functions
Example
The scale of the trend tag being plotted by Pen. If AN or Pen is invalid, 0 (zero) is
returned and an error code is set.
TrnSetScale, TrnGetDefScale
! For the trend at AN20
See Also
Trend Functions
TrnGetScaleStr
Description
Syntax
Gets the scale of the trend tag being plotted by a specified pen. The value is
returned as a formatted string using the pen's format specification and
(optionally) the engineering units.
TrnGetScaleStr(AN, Pen, Percent, EngUnits)
AN: . . . . . . . . . . . . . The AN of the chosen trend.
Pen: . . . . . . . . . . . . . The trend pen number:
0
1...8
- Pen1. . .Pen8
Return Value
Related Functions
Example
The scale of the trend tag being plotted by Pen (as a string). If AN or Pen is
invalid, <na> is returned and an error code is set.
TrnGetScale
! For the trend at AN20
DspText(31,0,TrnGetScaleStr(20,0,0,1));
/* Displays the zero scale of the focus pen. The scale displays as
a formatted string (including the engineering units). */
DspText(32,0,TrnGetScaleStr(20,2,50,1));
675
676
See Also
Trend Functions
TrnGetSpan
Description
Gets the span time of a trend (if the span was set by the TrnSetSpan() function).
The span time is the total time displayed in the trend window.
Note: If you call the TrnSetPeriod() function after the TrnSetSpan() function, the
span is automatically set to 0 (zero).
Syntax
TrnGetSpan(AN)
AN: . . . . . . . . . . . . . The AN of the chosen trend.
Return Value
Related Functions
Example
The span time, in seconds. 0(zero) is returned if the AN is invalid or if the span
was not set by the TrnSetSpan() function.
TrnSetSpan, TrnGetPeriod, TrnSetPeriod
// Use a keyboard command or button to set a span of 2 hours.
TrnSetSpan(40,StrToTime("2:00:00");
// Then use TrnGetSpan function to display the span
Time = TrnGetSpan(40)
DspText(31,0,TimeToStr(Time,5));
See Also
Trend Functions
TrnGetTable
Description
This function allows you to tabulate values from a specific section of trend. The
values in the table (possibly an array variable) are arranged by time.
If the period (Period) is different to the trend's sampling period (configured in
the Trend Tags database), the returned values are determined by DisplayMode.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
677
678
The actual number of samples read. 0(zero) is returned if an error occurs. You
can call the IsError() function to get the actual error code.
TrnSetTable, TrnGetDisplayMode
REAL TrendTable1[100];
/* Defines an array of a maximum of 100 entries in which the trend
data is stored. */
TrnGetTable("OP1",StrToDate("18/12/91")
+StrToTime("09:00"),2,10,TrendTable1[0],0);
/* Stores the values of trend tag "OP1" in Table TrendTable1. Data
is stored at the following times:
18/12/91 09:00:00 TrendTable1[0]
08:59:58 TrendTable1[1]
08:59:56 TrendTable1[2]
.
.
18/12/91 08:59:42 TrendTable1[9] */
Average=TableMath(TrendTable1[0],100,2);
/* Gets the average of the trend data. */
See Also
Trend Functions
TrnGetTime
Description
Gets the time and date of the trend (plotted by a specified pen) at a percentage
along the trend, using the time and date of the right-most sample displayed. The
time associated with the rightmost sample displayed is known as the end time.
The start time is the time of the left-most sample displayed. Percent 0 (zero) will
correspond to the end time, and Percent 100 will correspond to the start time.
679
680
1...8
- Pen1. . .Pen8
Percent: . . . . . . . . . . The percentage of the trend from the time and date of the
right-most sample displayed (end time), from 0 to 100.
Return Value
Related Functions
Example
See Also
Trend Functions
TrnGetUnits
Description
Syntax
Gets the data units for the trend tag plotted by a specified Pen.
TrnGetUnits(AN, Pen)
AN: . . . . . . . . . . . . . The AN of the chosen trend.
Pen: . . . . . . . . . . . . . The trend pen number:
0
1...8
Return Value
Related Functions
- Pen1. . .Pen8
The data units for the trend tag plotted by Pen, otherwise an empty string is
returned, and an error code is set. You can call the IsError() function to get the
actual error code.
TrnGetFormat, TrnGetScale
See Also
Trend Functions
TrnInfo
Description
Syntax
Return Value
Example
The value (as a string), otherwise an empty string is returned, and an error code
is set. You can call the IsError() function to get the actual error code.
! Get the file name of trend tag LT131
sFileName = TrnInfo("LT131", 3);
See Also
Trend Functions
681
682
TrnIsValidValue
Description
Syntax
TrnIsValidValue(TrendValue)
TrendValue: . . . . . . . A trend value (of type REAL).
Return Value
0 for <VALID>
1 for <GATED>
2 for <INVALID>
Related Functions
Example
TrnGetGatedValue, TrnGetInvalidValue
! TrnIsValidValue() example
REAL newArray[100];
REAL oldArray[90];
INT trigger;
INT
FUNCTION
DoubleArray()
INT i;
FOR i = 0 to 99 DO
IF TrnIsValidValue(oldArray[i]) = 1 OR trigger = 0 THEN
newArray[i] = TrnGetGatedValue();
Prompt ("This value is <GATED>");
ELSE IF i >= 90 OR TrnIsValidValue(oldArray[i]) = 2 THEN
newArray[i] = TrnGetInvalidValue();
ELSE
newArray[i] = oldArray[i] * 2;
Prompt ("This value is <TRN_NO_VALUES>");
END END
END
RETURN i;
END
See Also
Trend Functions
TrnNew
Description
Syntax
Creates a new trend at run time. This function performs the same operation as
an entry in the Page Trends database. After the trend is created by the TrnNew()
function, all the other trend functions can access and control the trend.
TrnNew(AN, Trend, Tag1 ... Tag8)
AN: . . . . . . . . . . . . . The AN where the bottom right-hand corner of the trend is
located.
Trend: . . . . . . . . . . . The trend definition number.
Tag1 . . .Tag8: . . . . . The trend tags.
Return Value
Related Functions
Example
See Also
Trend Functions
TrnPlot
Description
Prints the trend line of one or more trend tags. Each trend line is drawn with a
different pen style and marker as appropriate. The trend plot includes a
comment and a legend, and you can specify the vertical high and low scales. The
Mode defines the color mode of the printer. The default mode is black and
white.
For more advanced trend plotting, you can use the low-level plot functions.
Syntax
683
684
See Also
Trend Functions
TrnPrint
Description
Syntax
Prints the trend that is displayed on the screen (at hAn) using the current display
mode for each trend. You can specify the trend title, the target printer, whether
to print in color or black and white, and whether to display the Plot Setup form
when the function is called.
TrnPrint(sPort, sTitle, hAn, iModeColour, iDisplayForm)
sPort: . . . . . . . . . . . The name of the printer port to which the plot will be
printed. This name must be enclosed within quotation marks
"". For example "LPT1:", to print to the local printer, or
"\\Pserver\canon1" using UNC to print to a network
printer.
It is not necessary to enter a printer port. The first time the
printer port is omitted, you will be prompted to select one at
the Printer Setup form. The selection you make will then be
used as the default.
sTitle: . . . . . . . . . . . The title to print at the top of the trend plot. If you do not
specify a title in sTitle, the page title will be used.
hAn: . . . . . . . . . . . . The AN where the trend plot is located.
iModeColour: . . . . . The color mode of the printer.
-1 - Color to be decided (Default). CitectSCADA refers to the
[GENERAL]PrinterColourMode parameter to
determine print color. If there is no setting for this
parameter, it will default to black and white.
0 - Black and White
1 - Color
DisplayForm: . . . . . Defines whether or not the Plot Setup form will display
when the function is called. This form allows you to enter the
color mode of the printer, and define the printer setup etc.
(See Printing Trend Data for more information on this form.)
-1 - CitectSCADA refers to the
[GENERAL]DisablePlotSetupForm parameter to
685
686
See Also
Trend Functions
TrnSamplesConfigured
Description
Syntax
Gets the number of samples configured for the currently displayed trend.
TrnSamplesConfigured(AN)
AN: . . . . . . . . . . . . . The AN where the trend is located.
Return Value
Example
The number of samples configured for the trend, or 0 (zero) if an error occurs.
You can call the IsError() function to get the actual error code.
/* For the trend at AN20, get and display the number of samples */
INT nSamples;
nSamples=TrnSamplesConfigured(20);
DspStr(31,"",IntToStr(nSamples));
See Also
Trend Functions
TrnScroll
Description
Syntax
Scrolls the trend pen by a specified percentage (of span), or number of samples.
TrnScroll(AN, Pen, nScroll, nMode)
AN: . . . . . . . . . . . . . The AN where the trend is located. Set to -1 for all trends on
the current page.
Pen: . . . . . . . . . . . . . The trend pen number. Set to -1 for all pens.
nScroll: . . . . . . . . . . The amount by which the trend will be scrolled. Use nMode
to specify whether the trend will be scrolled by percentage or
by number of samples.
Because the resolution of Client requests is 1 second, requests
of millisecond accuracy are rounded to 1 second. For
example, if requested to scroll 2 samples of 400 milliseconds
(a total of 0.8 seconds), the trend will actually scroll 1 second.
See Also
Trend Functions
TrnSelect
Description
Sets up a page for a trend. This function allows you to set up a trend before the
trend page is displayed. You can therefore use a single trend page to display any
trend in the project by selecting the trend first, and then displaying the trend
page. The PageTrend() function uses this function to display the standard trend
pages.
Call this function and a set of TrnSetPen() functions before you display a trend
page. When the trend page is displayed, all pens set by the TrnSetPen()
functions are displayed. You can use the TrnSelect() function to configure
different set of pens to be displayed on one generic trend page. The pen settings
in the Page Trend database are overridden.
Note: Trend functions used after the TrnSelect() function must use the special
value -2 as their AN. (See the example below).
687
688
Return Value
Related Functions
Example
See Also
Trend Functions
TrnSetCursor
Description
Syntax
Moves the trend cursor by a specified number of samples. If the trend cursor is
disabled, this function enables it. If the cursor is enabled and the number of
samples is 0 (zero), the cursor is disabled. If the cursor is moved off the current
trend frame, the trend scrolls.
TrnSetCursor(AN, Samples)
AN: . . . . . . . . . . . . . The AN where the trend is located. Set to -1 for all trends on
the current page.
Samples: . . . . . . . . . The number of samples to move the cursor.
Return Value
Related Functions
Example
See Also
Trend Functions
TrnSetCursorPos
Description
Syntax
Moves the trend cursor to a specified x-axis point, offset from the trend cursor
origin. If the trend cursor is disabled, this function enables it. If the position is
outside of the trend frame, it sets the trend cursor to half of the frame.
TrnSetCursorPos(AN, Position)
AN: . . . . . . . . . . . . . The AN where the trend is located. Set to -1 for all trends on
the current page.
Position: . . . . . . . . . The x-axis point at which to position the trend cursor, offset
from the trend cursor origin.
Return Value
Related Functions
Example
See Also
Trend Functions
TrnSetDisplayMode
Description
Syntax
689
690
TrnSetEvent
Description
Syntax
Sets the start event of a trend pen. This function only operates on an event-based
trend.
TrnSetEvent(AN, Pen, Event)
AN: . . . . . . . . . . . . . The AN of the chosen trend.
Pen: . . . . . . . . . . . . . The trend pen number:
0
1...8
- Pen1. . .Pen8
See Also
Trend Functions
TrnSetPen
Description
Sets the trend tag of a trend pen. The trend pen changes to the specified tag and
the trend is refreshed. The trend pen must be in the operator's area to be
691
692
Return Value
Related Functions
Example
See Also
Trend Functions
TrnSetPenFocus
Description
Syntax
Sets the focus to a specified pen. After the focus is set, the focus pen is used with
other trend functions.
TrnSetPenFocus(AN, Pen)
AN: . . . . . . . . . . . . . The AN of the chosen trend.
Pen: . . . . . . . . . . . . . The trend pen:
- Make the next pen the focus pen; do not skip blank pens.
-3
- Make the previous pen the focus pen; do not skip blank
pens.
-2
- Make the next pen the focus pen; skip blank pens.
-1
- Make the previous pen the focus pen; skip blank pens.
1...8
Return Value
Related Functions
The old pen focus number, or -1 if an error occurs. You can call the IsError()
function to get the actual error code.
TrnGetPenFocus
Example
System Keyboard
Key Sequence
Command
Comment
See Also
NextPen
TrnSetPenFocus(20, -2)
For the trend at AN20, make the next pen the
focus pen
Trend Functions
TrnSetPeriod
Description
Sets the display period (time base) of a trend. When the period is changed,
CitectSCADA reads the historical data to reconstruct the trend data, and
refreshes the trend. All pens have the same display period.
This function clears the span set by the TrnSetSpan() function.
Syntax
TrnSetPeriod(AN, Period)
AN: . . . . . . . . . . . . . The AN where the trend is located. Set to -1 for all trends on
the current page.
Period: . . . . . . . . . . The new sampling period (in seconds) of the trend. To set the
display period to the sampling period, set this argument to 0
(zero),
Return Value
693
694
Example
System Keyboard
Key Sequence
Command
Comment
See Also
## Enter
TrnSetPeriod(20, Arg1)
Set a new sampling period for the trend at AN20
Trend Functions
TrnSetScale
Description
Syntax
Sets a new scale for a trend pen. In the automatic scaling mode, the zero and full
scales are automatically generated.
TrnSetScale(AN, Pen, Percent, Scale)
AN: . . . . . . . . . . . . . The AN where the trend is located. Set to -1 for all trends on
the current page.
Pen: . . . . . . . . . . . . . The trend pen number:
-1 - All pens
0
1...8
- Pen1...Pen8
-1
Trend Functions
TrnSetSpan
Description
Syntax
Sets the span time of a trend. The span time is the total time displayed in the
trend window. You can set the period to contain fractions of a second. For
example, if you set a trend with 240 samples to a span of 10 minutes, then each
sample would be 2.5 seconds. Choose a span long enough to ensure a sufficient
sample rate to capture reliable real time data.
TrnSetSpan(AN, Span)
AN: . . . . . . . . . . . . . The AN of the chosen trend.
Span: . . . . . . . . . . . . The span time (in seconds).
Return Value
Related Functions
Example
See Also
Trend Functions
TrnSetTable
Description
Writes trend tag data from a table to the trend logging system (starting at the top
of the table, and continuing to the bottom). Each value is written with a time and
date, as specified by Period. If Period differs from the trend sampling period
(defined in the Trend Tags database), the trend's sample values will be
calculated (averaged or interpolated) from the tabulated trend data.
The user must have the correct privilege (as specified in the database), otherwise
the data is not written.
This function is a blocking function. It will block the calling Cicode task until the
operation is complete.
Syntax
695
696
The actual number of samples read. The return value is 0 if an error occurs. You
can call the IsError() function to get the actual error code.
TrnGetTable
REAL TrendTable1[100];
/* Defines an array of a maximum of 100 entries. Assume that
TrendTable1 has been storing data from a source. */
TrnSetTable("OP1",StrToDate("18/12/91")
+StrToTime("09:00"),2,10,TrendTable1[0]);
/* A set of 10 trend data values are set for the OP1 trend tag. */
See Also
Trend Functions
TrnSetTime
Description
Syntax
Sets the end time and date of a trend pen. Samples taken after this time and date
will not be displayed.
TrnSetTime(AN, Pen, Time)
AN: . . . . . . . . . . . . . The AN where the trend is located, or:
-1
0
- All pens
1...8
- Pen1. . .Pen8
Time: . . . . . . . . . . . . The end time and date of the trend. Samples taken after this
time and date will not be displayed. Set to 0 (zero) to set the
trend to the current time (real-time mode).
Return Value
Related Functions
Example
See Also
Trend Functions
697
698
TrendDspCursorScale
Description
Syntax
Displays a scale value for the current pen in the current pen font.
TrendDspCursorScale(AN, Percent)
AN: . . . . . . . . . . . . . The AN number of the trend.
Percent: . . . . . . . . . . The percentage of full scale to display for the current pen, as
an integer.
Return Value
Related Functions
Example
See Also
TrendDspCursorTag
Description
Syntax
Displays the trend tag name of the current pen in the pen font.
TrendDspCursorTag(AN)
AN: . . . . . . . . . . . . . The AN number of the trend.
Return Value
Related Functions
See Also
Trend Functions
TrendDspCursorTime
Description
Displays the cursor time of the current pen in the current pen font.
TrendDspCursorTime(AN, Format)
AN: . . . . . . . . . . . . . The AN number of the trend.
Format: . . . . . . . . . . Format of the string:
0
Example
See Also
TrendDspCursorValue
Description
Syntax
Display the cursor value of the current pen in the current pen font.
TrendDspCursorValue(AN)
AN: . . . . . . . . . . . . . The AN number of the trend.
Return Value
699
700
Example
See Also
TrendGetAn
Description
Syntax
Return Value
Related Functions
Example
See Also
Gets the AN number of the trend beneath the current mouse position.
TrendGetAn()
The AN of the trend, or 0 (zero) if the mouse is not positioned over a valid trend.
TrendDspCursorScale, TrendDspCursorTag, TrendDspCursorTime,
TrendDspCursorValue, TrendRun, TrendSetDate, TrendSetScale,
TrendSetSpan, TrendSetTime, TrendSetTimebase, TrendZoom
See in-built trend templates.
Trend Functions
TrendPopUp
Description
Syntax
Displays a pop-up trend with the specified trend pens. You must create the
trend page with the graphic builder and set all the pen names to blank.
TrendPopUp(sPage, sTag1. . .sTag8)
sPage: . . . . . . . . . . . The name of the trend page (drawn with the Graphics
Builder).
sTag1..sTag8: . . . . . The trend tags to display on the page.
Return Value
Related Functions
Example
Buttons
Text
Popup Trend
See Also
Trend Functions
TrendRun
Description
Syntax
Initializes the cursor and rubber-band features on a trend page. This function is
included as a Cicode Object on all new trend pages. Only use this function when
configuring a trend template that requires this functionality.
TrendRun(iPageType)
iPageType: . . . . . . . The type of the page:
0 - Normal trend page template
1 - Compare trend page template
Return Value
Related Functions
Example
See Also
TrendSetDate
Description
Syntax
Sets the end date for all pens on a trend. Samples taken after this date will not be
displayed. You can enter the date in the Value argument, or leave the Value blank
- a form is then displayed in run time for the operator to enter an end date.
TrendSetDate(AN, Value)
AN: . . . . . . . . . . . . . The AN number of the trend.
Value: . . . . . . . . . . . The new date, as a string. Samples taken after date will not
be displayed. This argument is optional.
Return Value
701
702
Example
See Also
TrendSetScale
Description
Syntax
Sets the scale of the current pen or of all pens on a trend. You can enter a scale in
the Value argument, or leave the Value blank. A form is then displayed in run
time for the operator to enter a value for the scale.
TrendSetScale(AN, Percent, Value)
AN: . . . . . . . . . . . . . The AN number of the trend.
Percent: . . . . . . . . . . The scale to be set:
0 - Zero scale
100 - Full scale
Value: . . . . . . . . . . . AN optional value for the scale, as a string.
Return Value
Related Functions
Example
See Also
TrendSetSpan
Description
Syntax
Sets the span time of the trend. The span time is the time period covered in the
trend window. You can enter a span time in the Value argument, or leave the
Value blank - a form is then displayed in run time for the operator to enter a
value for the span time.
TrendSetSpan(AN, Value)
AN: . . . . . . . . . . . . . The AN number of the trend.
Example
See Also
TrendSetTime
Description
Syntax
Sets the end time for all the pens on a trend. Samples taken after this time will
not be displayed. You can enter an end time in the Value argument, or leave the
Value blank - a form is then displayed in run time for the operator to enter a
value for the end time.
TrendSetTime(AN, Value)
AN: . . . . . . . . . . . . . The AN number of the trend.
Value: . . . . . . . . . . . AN optional value for the end time, as a string. Samples
taken after this time will not be displayed.
Return Value
Related Functions
Example
See Also
TrendSetTimebase
Description
Syntax
Sets a new sampling period for a trend. You can enter a sampling period in the
Value argument, or leave the Value blank. A form is then displayed in run time
for the operator to enter a value for the sampling period.
TrendSetTimebase(AN, Value)
703
704
Example
See Also
TrendWin
Description
Syntax
Displays a trend page (in a new window) with the specified trend pens. You
must create the trend page with the graphic builder and set all the pen names to
blank. You then display that page by calling this function and pass the required
trend tags. The function will create a new window with the specified window
mode.
TrendWin(sPage, X, Y, Mode, sTag1 . . .sTag8)
sPage: . . . . . . . . . . . The name of the trend page (drawn with the Graphics
Builder).
X: . . . . . . . . . . . . . . The x pixel coordinate of the top left corner of the window.
Y: . . . . . . . . . . . . . . The y pixel coordinate of the top left corner of the window.
Mode: . . . . . . . . . . . The mode of the window:
0 - Normal page.
1 - Page child window. The window is closed when a new
page is displayed, e.g. when the PageDisplay() or
PageGoto() function is called. The parent is the current
active window.
2 - Window child window. The window is closed
automatically when the parent window is freed with
the WinFree() function. The parent is the current active
window.
4 - No re-size. The window is displayed with thin borders
and no maximize/minimize icons. The window cannot
be re-sized.
64
- Always on top.
Example
Buttons
Text
Command
Comment
See Also
Trend Functions
Trend Window
TrendWin("MyTrend", 0, 0, 4, "PV1", "PV2",
"PV3")
Display a trend page in a new window with no
maximize and minimize icons
705
706
TrendZoom
Description
"Zooms" a specified trend in either one or both axes. Set the zoom values
(TimeZoom and/or ScaleZoom) to greater than one to "zoom in" or to less than one
to "zoom out".
If you specify a destination AN, you can zoom one trend (at SourceAn) onto
another (at DestAn), in the same way as on the standard zoom trend page.
Syntax
Return Value
Related Functions
Example
See Also
Trend Functions
UserCreate
Description
Syntax
Creates a record for a new user. A new user of the specified type is created. The
name of the user must be unique.
UserCreate(sName, sFullName, sPassword, sType)
sName: . . . . . . . . . . The name of the user.
sFullName: . . . . . . . The full name of the user.
Example
See Also
Security Functions
UserCreateForm
Description
Syntax
Return Value
Related Functions
Displays a form to create a record for a new user. A new user of the specified
type is created. The name of the user must be unique.
UserCreateForm()
0 (zero) if successful, otherwise an error is returned.
UserDelete, UserEditForm, UserPassword, UserPasswordForm,
UserCreate
Example
UserCreateForm()
See Also
Security Functions
UserDelete
Description
Syntax
Deletes the record for a user. Changes are written to both the Users database and
the runtime database in memory.
UserDelete(sName)
707
708
See Also
Security Functions
UserEditForm
Description
Syntax
Return Value
Related Functions
Example
Displays a form to allow the user to create or delete any user record in the
database. This function should have restricted access. Changes are written to
both the Users database and the runtime database in memory.
UserEditForm()
0 (zero) if successful, otherwise an error is returned.
UserCreate, UserDelete
/* Display a form for the user to create or delete user records. */
UserEditForm();
See Also
Security Functions
UserInfo
Description
Syntax
Gets information about the operator who is currently logged-in to the system.
UserInfo(Type)
Type: . . . . . . . . . . . . The type of user information:
0 - Flag to indicate if anyone is logged in or not
1 - The login name of the user
2 - The full name of the user
3 - The time the user logged in
4 - The time the user entered the last command
See Also
Security Functions
UserPassword
Description
Syntax
Changes the password for the user. Changes are written to both the Users
database and the runtime database in memory.
UserPassword(sName, sPassword, sOldPassword)
sName: . . . . . . . . . . The name of the user.
sPassword: . . . . . . . The password of the user.
The sPassword argument is optional. If not passed, this
argument defaults to an empty string which is subsequently
ignored. It is included for the purposes of handling duplicate
user names and separate password identification
compatibility.
sOldPassword: . . . . The password assigned to the user before the
UserPassword() function is run.
The sOldPassword argument is optional. If passed,
CitectSCADA will only permit the password change (and
consequent re-setting of the expiry period) when the old
password is correctly entered. If the sOldPassword
parameter is not passed, the password change will proceed
without restriction.
Return Value
Related Functions
709
710
See Also
Security Functions
UserPasswordExpiryDa
ys
Description
Returns the number of days left before the user's password is due to expire.
To use this function, you can build a form page by using cicode that takes the
user name and password as inputs and output the number of days that return by
UserPasswordExpiryDays().
Syntax
UserPasswordExpiryDays(sUserName, sPassword)
sUserName: . . . . . . The name of the user.
sPassword: . . . . . . . The password of the user.
The sPassword argument is optional. If not passed, this
argument defaults to an empty string which is subsequently
ignored. It is included for the purposes of handling duplicate
user names and separate password identification
compatibility.
Return Value
Related Functions
See Also
The return value contains either the number of days before password expiry, or
one of two exception conditions:
-1 - no expiry
UserPassword
Security Functions
UserPasswordForm
Description
Syntax
Display a form to allow users to change their own passwords. Changes are
written to both the Users database and the runtime database in memory.
UserPasswordForm()
Related Functions
Example
See Also
Security Functions
Version
Description
Syntax
Return Value
Example
- Revision number
- Version text
See Also
Miscellaneous Functions
WinCopy
Description
Syntax
Copies the graphics image of the active window on to the Windows Clipboard.
You can paste this clipboard image into other applications.
WinCopy(xScale, yScale, bSwapBlackWhite)
711
712
See Also
Window Functions
WinFile
Description
Syntax
Writes the graphics image of the active window to a file. The file is saved in the
CitectSCADA compressed .BMP format.
WinFile(sFile, xScale, yScale, bSwapBlackWhite)
sFile: . . . . . . . . . . . . The name of the file to be created.
xScale: . . . . . . . . . . The x scaling factor for the item being copied. This
arguement is optional, as a default setting of 1 is used to
maintain the horizontal scaling of the image. The outcome is
proportional to 1; for example, 0.5 halves the width of the
image.
yScale: . . . . . . . . . . The y scaling factor for the item being copied. This
arguement is optional, as a default setting of 1 is used to
maintain the current vertical scaling of the image. The
See Also
Window Functions
WinFree
Description
Removes the active display window. Note that the last window (and any child
windows owned by the last window) cannot be removed. You cannot call this
function as an exit command (see Page Properties) or from a Cicode Object.
Note: This function cannot be used in the CitectSCADA Web Client.
Syntax
Return Value
Related Functions
Example
WinFree()
0 (zero) if successful, otherwise an error is returned.
WinNew, WinNewAt
WinFree();
! Removes the active display window.
See Also
Window Functions
WinGetFocus
Description
Syntax
Gets the number of the CitectSCADA window that has the keyboard focus.
WinGetFocus()
713
714
Related Functions
Example
The window number of the CitectSCADA window that has the keyboard focus.
Note that this is not the same as the window handle, returned from the
WndFind() function.
WndFind
nCitectWin=WinGetFocus();
! Gets the number of the CitectSCADA window that has the keyboard
focus
See Also
Window Functions
WinGetWndHnd
Description
Syntax
Return Value
Gets the window handle for the current window. The window handle may be
used by 'C' programs and Citect Wnd... functions. You may pass the windows
handle to a 'C' program by using the DLL functions.
WinGetWndHnd()
The window handle if successful, otherwise 0 (zero) is returned. Note that this is
not the same as a CitectSCADA window number returned from the
WinNumber() function.
Related Functions
Example
INT hWnd;
hWnd = WinGetWndHnd();
WinShow(hWnd,6); //iconize the window
See Also
Window Functions
WinGoto
Description
Syntax
Changes the active window. The specified window is placed in front of all other
windows and all keyboard commands will apply to this window. You cannot
call this function as an exit command (see Page Properties) or from a Cicode
Object.
WinGoto(Window)
See Also
Window Functions
WinMode
Description
Syntax
715
716
WinNew
! Iconize the active CitectSCADA window.
WinMode(7);
See Also
Window Functions
WinMove
Description
Moves the active window to a new location and sizes the window in a single
operation. This is the same as calling the WinPos() and the WinSize() functions.
You use PageInfo to get the current window position.
Note: This function cannot be used in the CitectSCADA Web Client.
Syntax
Return Value
Related Functions
Example
See Also
Window Functions
WinNew
Description
Syntax
Opens a display window. The specified page displays in the new window. The
window can later be destroyed with the WinFree() function.
WinNew(Page)
Page: . . . . . . . . . . . . The Page Name or Page Number of the page to display in the
window.
Related Functions
Example
The window number of the window, or -1 if the window cannot be opened. Note
that this is not the same as the window handle returned from the WndFind()
function.
WinFree, WinNewAt
! If the display window being opened is window number 2:
Window=WinNew("Alarm");
! Displays the Alarm page and sets Window to 2.
See Also
Window Functions
WinNewAt
Description
Syntax
717
718
64
- Always on top.
Related Functions
The window number of the window, or -1 if the window cannot be opened. Note
that this is not the same as the window handle returned from the WndFind()
function.
WinFree, WinNew
Example
Buttons
Text
Command
Comment
Mimic Page
WinNewAt("Mimic", 100, 20, 0)
Display the mimic page in a new window at
coordinate 100, 20.
Buttons
Text
Command
Comment
Pop Page
WinNewAt("Popup", 100, 200, 2)
Display the popup page in a child window at
coordinate 100, 200
Buttons
Text
Command
Comment
Pop Page
WinNewAt("Popup", 100, 200, 4)
Display the popup page in a new window with no
maximize and minimize icons
System Keyboard
Key Sequence
Command
Comment
System Keyboard
Key Sequence
Command
Comment
See Also
Window Functions
WinNext
Description
Syntax
719
720
Related Functions
Example
The window number of the window, or -1 if there is no next window. Note that
this is not the same as the window handle returned from the WndFind()
function.
WinNew, WinPrev
! If the display window being made active is window number 2:
Window=WinNext();
! Makes the next window active and sets Window to 2.
See Also
Window Functions
WinNumber
Description
Syntax
Return Value
Related Functions
Example
Gets the window number of the active CitectSCADA window. This number can
be used with other functions to control the window.
WinNumber()
The window number of the window. Note that this is not the same as the
window handle returned from the WndFind() function.
WinNew, WinGoto
! Create a new window, but keep the active window the same:
Window=WinNumber();
WinNew("Alarm");
WinGoto(Window);
See Also
Window Functions
WinPos
Description
Syntax
Moves the active window to a new location. You use PageInfo() to get the
current window position.
WinPos(X, Y)
X, Y: . . . . . . . . . . . . The new x and y pixel coordinates of the top-left corner of
the active window.
Return Value
See Also
Window Functions
WinPrev
Description
Syntax
Return Value
Related Functions
Example
See Also
Window Functions
WinPrint
Description
Syntax
721
722
See Also
Window Functions
WinPrintFile
Description
Syntax
Prints a file to the system printer. The file must be saved with the WinFile()
function.
WinPrintFile(sFile, sPort, xScale, yScale, bSwapBlackWhite)
sFile: . . . . . . . . . . . . The file name.
sPort: . . . . . . . . . . . The name of the printer port to which the window will be
printed. This name must be enclosed within quotation marks
"". For example "LPT1:", to print to the local printer, or
"\\Pserver\canon1" using UNC to print to a network
printer.
xScale: . . . . . . . . . . The x scaling factor for the print. Set to 0 (zero) to
automatically scale the print to fit the page.
yScale: . . . . . . . . . . The y scaling factor for the print. Set to 0 (zero) to
automatically scale the print to fit the page.
bSwapBlackWhite: . Swaps the colors black and white for the purpose of printing
pages with a lot of black content. Use the label TRUE to swap
black and white.
Return Value
Related Functions
Example
See Also
Window Functions
WinSelect
Description
Selects a window to make active. This function only affects the output of Cicode
functions. It does not change the screen focus of the windows, or move a
background window to the foreground.
Always re-select the original window if it is called from a Page database (Page
Numbers, Page Symbols, etc.), because other Cicode tasks will assume it is the
correct window. This function only changes the active window for the Cicode
task that called it.
Syntax
WinSelect(Window)
Window: . . . . . . . . . The window number to select. Note that this is not the same
as the window handle returned from the WndFind()
function.
Return Value
Related Functions
Example
See Also
Window Functions
723
724
WinSize
Description
Syntax
Sizes the active window. The origin of the window does not move.
WinSize(Width, Height)
Width, Height: . . . . The new width and height of the window, in pixels.
Return Value
Related Functions
WinMove, WinPos
Example
WinSize(200,100);
! Sizes the active window to 200 pixels wide x 100 pixels high.
See Also
Window Functions
WinTitle
Description
Syntax
WinTitle(sTitle)
sTitle . . . . . . . . . . . . The new title for the window.
Return Value
Related Functions
Example
See Also
Window Functions
WhoAmI
Description
Displays the user name and full name of the user currently logged-in to the
system. The names are displayed at the prompt AN.
WhoAmI()
0 (zero) if successful, otherwise an error is returned.
Name, FullName, UserInfo
/* Display the user's full name and user name at the prompt AN. */
WhoAmI();
See Also
Security Functions
WndFind
Description
Gets the Windows handle of any window of any application, so that the window
can be manipulated. The window handle is not the same as the CitectSCADA
window number and cannot be used with functions that expect the
CitectSCADA window number (the Win... functions).
The window title (caption) must be an exact match of the window name
(including any blank spaces) for this function to find the window. You should
therefore check that the other application does not change the title of the
window during execution.
Note that if the title banner of a CitectSCADA window is set with the
CitectSCADA parameter [Page] WinTitle, you should not specify justification
(for example, use {TITLE,32,N}). If justification is not disabled (i.e. the N is
omitted), you must pass the full title of the window (including leading and
trailing blanks) to this function.
Syntax
WndFind(sTitle)
sTitle . . . . . . . . . . . . The title (caption) of the window.
Return Value
Related Functions
Example
The window handle. Note that this is not the same as a CitectSCADA window
number returned from the WinNumber() function.
WinNew
hWndExcel=WndFind("Microsoft Excel");
! Gets the Windows number of the window titled "Microsoft Excel".
See Also
Window Functions
725
726
WndGetFileProfile
Description
Syntax
Return Value
Related Functions
Example
See Also
Window Functions
WndGetProfile
Description
Syntax
Gets the value of a WIN.INI parameter. If the parameter has no value or does not
exist, the default value is returned.
WndGetProfile(Group, Parameter, Default)
Group: . . . . . . . . . . The WIN.INI group name.
Parameter: . . . . . . . The parameter name.
Default: . . . . . . . . . . The default value of the parameter.
Return Value
Related Functions
Example
See Also
Window Functions
WndHelp
Description
Syntax
727
728
See Also
Window Functions
WndInfo
Description
Syntax
Gets information on the window system (such as the widths and heights of the
various elements displayed by Windows). WndInfo() can also return flags that
indicate whether the current version of the Windows operating system is a
debugging version, whether a mouse is present, or whether the functions of the
left and right mouse buttons have been exchanged.
WndInfo(Type)
Type: . . . . . . . . . . . . The system measurement to be retrieved. All measurements
are in pixels. The system measurement must be one of the
following values:
0 - Width of the screen.
1 - Height of the screen.
2 - Width of the arrow bitmap on a vertical scroll bar.
3 - Height of the arrow bitmap on a horizontal scroll bar.
4 - Height of the window title. This is the title height plus the
height of the window frame that cannot be sized
(SM_CYBORDER).
5 - Width of the window frame that cannot be sized.
6 - Height of the window frame that cannot be sized.
7 - Width of the frame when the window has the
WS_DLGFRAME style.
8 - Height of the frame when the window has the
WS_DLGFRAME style.
9 - Height of the scroll box on vertical scroll bar.
10 - Width of the scroll box (thumb) on horizontal scroll bar.
12 - Height of the icon.
13 - Width of the cursor.
14 - Height of the cursor.
15 - Height of a single-line menu bar. This is the menu height
minus the height of the window frame that cannot be
sized (SM_CYBORDER).
16 - Width of the window client area for a full-screen
window.
729
730
- Not Used
See Also
Window Functions
WndPutFileProfile
Description
Syntax
Window Functions
WndPutProfile
Description
Syntax
Return Value
Related Functions
Example
See Also
Window Functions
WndShow
Description
Syntax
731
732
See Also
Window Functions
WndViewer
Description
Syntax
Related Functions
Example
WndHelp
WndViewer("MyFile.MVB",1, "Contents");
! Displays the contents topic in the Multimedia file "MyFile.MVB".
WndViewer("HelpFile.MVB",2, "HelpTip");
! Displays the HelpTip topic in the Multimedia file "HelpFile.MVB"
in a popup.
See Also
Window Functions
733
734
Part IV
Cicode Errors
Source
Cause
0 - 31
256 - 511
General
382 - 383
1024 - 1279
NetBIOS
You can use the IsError() function to get the number of the last error.
Alternatively, you can trap and process errors within your user functions. Use
the ErrSet() function to enable or disable error trapping.
Error title
256
General software
An internal CitectSCADA software error is detected. Contact Citect
error
Support and provide details on what causes the error.
Value is out of range A numeric value is out of range. An out-of-range value has been
passed to a function, or an array index is off the end of an array, or
a value that is outside of the specified engineering scale has been
assigned to a I/O Device variable. You can disable range checking
on PLC variables with the CodeSetMode() function.
257
Description
738
Error title
Description
258
259
260
261
262
263
264
265
266
267
268
Check that the file does exist (use File Manager), and that you
have the correct rights to open it. (Check with your network
supervisor that you have correct rights to open the file).
Cannot read file
The specified file cannot be read. Either an error occurred during a
read operation, or the end of file was unexpectedly found, or a loss
of the file server occurred, or the operating system is out of
resources.
Cannot write to file
The specified file cannot be written to. During a function call (that
tried to write to a file), a write error occurred. There could be a disk
full error, or a loss of the file server may have occurred, or the
operating system is out of resources.
Invalid file type
An attempt was made to open a file of the wrong type, e.g. you tried
to open an ASCII file as a dBASE file.
Field not found in file The specified field does not exist in the device or database. A
function that is trying to access an individual field in a database
cannot find that field. Check that you have specified the correct
field name and database name.
File mode is invalid An operation has been attempted on a file or device that is of the
wrong mode, e.g. you tried to perform a seek on a printer device.
Do not use this operation on this type of device.
Key not found in file The requested key was not found when a key search was
performed on a database device, i.e. the record specified on an
indexed search cannot be found. Either the record does not exist or
you have specified the wrong key.
Error title
269
Bad handle specified A bad handle has been passed to a function. You have called a
function that requires a device handle, font handle, window handle,
etc., but you passed a number that does not associate with a read
device, font, or window (e.g. you called WinGoto(100) when no
window with the handle "100" exists). Check where the handle or
number was retrieved from, and make sure it is the same handle.
This error may also occur if you have closed or destroyed the
resource and you then try to access it.
No more free handles All the available file handles have been used, i.e. too many files or
left
databases are open at the same time. Open fewer files at one time
or increase the number of file handles in the [CtEdit]DBFiles
parameter.
Out of memory
CitectSCADA is out of memory. Increase the amount of memory in
the computer or use smaller databases.
Divide by zero
An attempt has been made to divide a number by zero.
Invalid argument
An invalid argument has been passed to a Cicode function. This is
passed
a general error message and is generated when arguments passed
to a function are out of range or are invalid. Check the value of
arguments being passed to the function. If arguments are input
directly from the operator, you should check that the correct
arguments are being passed to the function.
Overflow
A calculation has resulted in a numeric value overflow. Check for
operations that will generate large numbers.
No privilege for
A user has requested an operation for which he or she has no
operation
privilege.
Not in correct area
A user has requested data that does not belong to the current user
area.
Report already busy A request has been made to run a report that is already running.
You can get the current state of a report with the RepGetControl()
function. You can ignore this error message (because the report is
already running).
Report is late for
The report cannot run at the rate requested in the configuration. An
execution
attempt could have been made to run a report too frequently, and
the required data cannot be read from the I/O Device(s) in time for
the next report.
Invalid report ID
The specified report name does not exist, or the user has no
specified
privilege to run the report, or the report is not in the current user
area. Check the name of the report and the current user's privilege
and areas.
No server could be
The specified CitectSCADA server cannot be found. Either the
found
server is not running or there is some communication problem with
the network. Check that the network is set up correctly, and the
[Lan] Disable parameter is set to 0 (zero), and you are using the
same Server Name on both the client and server.
271
272
273
274
275
276
277
278
279
280
281
Description
739
740
Error title
282
Foreground Cicode
cannot block
283
284
285
286
287
Description
You cannot block the foreground CitectSCADA task. You may have
called a blocking function from one of the Page animation
databases.
Trend has missed
The trend cannot run at the rate requested in the configuration. An
samples
attempt could have been made to trend the data too frequently, and
the required data cannot be read from the I/O Device(s) in time for
the next trend. Either increase the performance of the
communication link to the PLCs or slow the rate of trend data
acquisition.
Device is disabled
An attempt was made to access a device that is disabled. You can
disable any devices (printers and other logging devices) with the
DevDisable() function. When CitectSCADA (or your Cicode
function) tries to access a disabled device, this error message
returns and all output is lost.
Foreground Cicode The foreground Cicode task is taking too long to animate the
run is too long
display page. The Cicode is too complex and is taking too long to
execute. Simplify the Cicode that is animating the page, or increase
the [Code] TimeSlice parameter. If you cannot simplify the Cicode,
you can create a separate task using TaskNew() to calculate your
complex operation, and then use the Display functions to display
the results. Cicode running from a TaskNew() call is in background
mode and can run as long as required.
Out of Cicode threads CitectSCADA has run out of Cicode tasks. Run fewer tasks (e.g.
reports, key commands, and Cicode tasks) in parallel, or increase
the number of tasks with the [Code]Threads parameter. This error
can be caused by a configuration error if you keep creating tasks
but do not "kill" them when they are no longer required.
Floating point
An invalid floating-point number has been found. Check the
exception trap
floating-point data from the I/O Device.
Error title
Description
288
Out of buffers
289
290
291
292
293
294
741
742
Error title
Description
295
Cicode stack overflow A Cicode evaluation stack overflow has occurred. There are too
many local function variables or nested function calls. Reduce the
number of local variables or increase the [Code] Stack parameter.
The Cicode stack is used to store local function variables and
function calls. If you have many nested functions and a large
number of local function variables, the Cicode stack may overflow.
When the Cicode stack overflows, the Cicode that caused the
overflow is halted.
296
Queue empty
297
Semaphore owner
died
298
Semaphore timeout
299
Cancelled
300
301
302
303
Invalid animation
number
You can estimate the size of the stack by counting the maximum
number of local function variables in the deepest function calls. For
example, if function A has 10 variables and calls function B with 30
variables, which calls function C with 40 variables, the stack needs
to be 10 + 30 + 40 = 80 deep.
An attempt has been made to read an element from an empty
queue.
The owner of a Cicode semaphore was halted, killed, or returned
without releasing the semaphore. Reset the shared resource back
to a known state (because the task that died may have left it in a
mess), and then continue. For example, if you are sharing a printer,
do a form feed.
The requested semaphore was still in use after the specified
timeout. Either try to get the semaphore again or abort the
operation and tell the operator of the error.
The specified form or command was cancelled. This error is
returned when a user presses the Cancel button on a form. The
normal procedure is to abort the operation.
The trend does not exist at the specified AN and page. A trend
function may have been called when the trend is not defined for
that AN.
The required trend pen name does not exist in the Trends database
or is not in the current user area. Check that the pen name exists
and check the current user's privilege and area.
The requested trend data is not valid. Either the I/O Device data
was bad, or the CitectSCADA trend server was shut down, or the
trend data was disabled.
The AN specified in the function is not defined. You called one of
the DspXXX animation functions, but you specified an animation
number that was out of range or that had been deleted.
Error title
Description
304
305
Conflicting types of
animation
306
307
308
309
310
Incompatible server
version
311
Alarm tag
synchronize error
312
313
No MAPI
314
MAPI offline
315
MAPI no mail
743
744
Error title
316
dBASE record locked The dBASE file is being accessed by another user. Check if the
by another
dBASE file has been opened in exclusive mode by the other user.
This error can also occur if another user is updating the dBASE file,
and will most likely occur if it is an indexed database, and the file is
on a slow file server. You can adjust dBASE access with the
[General]LockRetry and [General]LockDelay parameters.
Not in this version
The operation is not supported in this version of CitectSCADA. You
must upgrade to a higher version.
Invalid page function You have called the PageGoto(), PageNext(), PagePrev(),
PageDisplay(), or PageLast() as an exit command in the Pages
database.
Low physical memory CitectSCADA is low on physical memory. Increase available
physical memory (not virtual memory). Reduce the size of
SMARTDRV cache, close any other windows programs that are
running, or add more RAM to your computer. You can set the
minimum size of memory required by CitectSCADA with the
[Memory]MinPhyK parameter. This parameter sets a value for the
minimum physical memory before CitectSCADA will generate this
error message.
317
318
319
320
21
322
323
324
325
326
327
Description
This error may also occur if your swap file is large (i.e. greater than
20Mb). Reduce the size of your swap file. The swap file is
configured with the Windows Control Panel (386 Enhanced icon).
Cannot free window The WinFree() function has been called but CitectSCADA has no
windows left. (Note that the last window and any child windows
owned by the last window cannot be removed.)
Font cannot be found The specified font cannot be found. Check the font name.
LAN Failure
CitectSCADA has detected a failure on the network.
Super Genie not
A Super Genie variable has not been associated correctly. This
Associated
error can occur if a variable passed to the Super Genie is the wrong
data type or the variable does not exist. The error will also occur if
the Ass() function has not been called for the variable.
Transparent IO
A transparent I/O Device has not been correctly associated. Either
Device not
the IODeviceControl() function was not called before the page (with
Associated
which the transparent device is associated) was displayed, or
incorrect data was passed to the I/O Device (such as the device
name or protocol).
Project is not
Changes have been made to the project while the system was
compiled
running. Either restart the system or shutdown and re-compile.
Could not run the
The CitectSCADA compiler could not be found. Either the computer
CitectSCADA
has run out of memory, or the compiler has been removed from its
compiler
directory.
User type not found An attempt was made to create a user of a type that has not been
defined in the users database.
Error title
328
329
336
337
338
339
342
343
344
345
346
347
354
355
356
357
358
359
Description
An attempt was made to create a new user with the same name as
an existing user.
Cannot have mixed An attempt was made to display both a periodic trend and an event
trends
trend in the same trend window. Check the project configuration
(Trend Tags and Page Trends databases) for mixed trends
displayed in a trend window.
Event type trend is
One of the arguments passed to this trend function is only valid for
expected
event type trends.
Trend in file does not The trend name inside the trend file does not exist in the trend
exist
database. It is likely that the trend file belongs to a trend which is
deleted from the system configuration.
Plot Functions
Plot functions are to be written in sequence since they depend on
Sequence Mismatch the data set up by other plot functions. Please refer to the
description section for each Plot Function for the order of plot
functions.
Plot Marker is not
An undefined plot marker symbol has been used. Use the
Defined
PlotSetMarker function before the PlotLine, PlotXYLine or
PlotMarker functions.
Debug break
The DebugBreak() Cicode function has been called. This indicates
an invalid condition detected in user written Cicode. Enable the
Cicode debugger to find the cause of the problem.
Foreground Cicode A breakpoint has been hit in foreground Cicode. Foreground
cannot break
Cicode cannot be blocked. You can disable this error message in
Debug Options, accessed through the Debug menu in the Cicode
Editor.
Format overflow
Trend data not ready
Dynamic Out of
The dynamic point count has exceeded the point limit. See
CitectSCADA Licence Point Count.
licence points
Assertion failed in
An assertion has failed in your Cicode, and the task terminated.
user Cicode
Assertions are made using the Assert() function. If you set the
[Code]DebugMessage parameter to 1, the assertion logged and
the operator prompted.
Unrecognized object
class
Object has no
interface
Object automation
exception
Too many arguments
Too few arguments
Named object already
exists
745
746
Error title
360
Unrecognized named
object
Page CTG/RDB
record mismatch
Object event queue
flooded
Incorrect number of
arguments
No 'this' argument
Date Time Conflict
A Date and/or time conflict has occurred. If you are attempting a
TrnAddHistory(), make sure that the file you are adding does not
have a conflicting time or date with existing trend files.
Page data / variable Page data / variable tag data mismatch with tag-based driver.
tag data mismatch
The code this queue/
semaphore was
waiting for exited due
to an error
Unsupported cicode
function in Citect Web
Client
Socket error
0WSAENETDOWN
Socket unreachable
Network reset
Connection aborted
Connection reset
No buffers available
Socket timeout
Connection refused
Name too long
Host down
Host unreachable
361
362
363
364
374
382
384
391
1280
133
1331
1332
1333
1334
1335
1340
1341
1343
1344
1345
Description
Using Parameters
Citect.ini File Parameter Categories
Using Parameters
You can set operating parameters in:
The citect.ini file (By default, CitectSCADA looks for the ini file in the
Citect\Bin directory. If it can't find it there, it searches the Windows
directory of each CitectSCADA computer.) The filename and location can be
changed by using the i"file_path.INI" option when calling the
CitectSCADA Explorer or Citect32 runtime.
Note: The citect.ini section has precedence over the project database if an INI is
defined in both.
See Also
Parameters set in the citect.ini file take precedence over parameters set in
the project database.
If you set (or change) parameters in the project database, you must recompile the project before the parameter settings are used.
If you set (or change) parameters in the citect.ini file, you must restart
CitectSCADA before the parameter settings are used.
748
Parameters set in the database are local to the specific Citect project.
Parameters set in the citect.ini file apply to all CitectSCADA projects (if
you are using multiple CitectSCADA systems).
Use a text Editor to Edit the citect.ini file (in the Windows directory).
See Also
Using parameters on a
network
Parameters dialog
749
750
Parameters dialog
Name - The name of the parameter for which you want to define a value.
Enter a value of 16 characters or less.
Value - The value of the parameter. Enter a value of 254 characters or less.
For example, to define the computer as an I/O Server, you would enter
IOSERVER as the Section Name, Server as the Name, and 1 as the Value. In the
citect.ini file, the parameter would appear as follows:
[IOSERVER]
Server=1
See Also
Alarm
CrashHandler
CrashMailer
DDE
DiskDrv
Internet
Lan
AlarmLog
CiNet (LLC)
CtAPI
Debug
DNS
Intl
Language
Animator
Client
CtCicode
Device
Event
IOServer
Memory
AnmCursor
Code
CtDraw.RSC
Dial
Font
Kernel
OID
Path
Report
Time
Privilege
Server
Trend
Protocol
Shutdown
Win
Proxi
SPC
Accumulator Parameters
The citect.ini file contains the following accumulator parameters:
See Also
[Accumulator]UpdateTi
me
See Also
[Accumulator]WatchTim
e
Accumulator Parameters
The time in seconds between each check of the accumulator trigger. You can set
this parameter to a large value to conserve CPU and PLC communication time. If
you set the WatchTime to a low value, CitectSCADA must poll the PLC more
often for the trigger value, using CPU and PLC communication bandwidth.
Ensure that all time and period-based events in the project are a direct multiple
of the WatchTime, otherwise they will not be checked.
Allowable Values: 1 to 36000 (seconds)
Default Value: 60
See Also
Accumulator Parameters
Alarm Parameters
The citect.ini file contains the following alarm parameters:
751
752
[Alarm]SavePeriod - The period for saving alarm and event data (to disk).
[Alarm]StartTimeout - Sets the timeout period for loading data from the
primary Alarms Server.
753
754
See Also
[Alarm]Ack
[Alarm]SummaryTolerance - This parameter allows for the fact that the two
alarms servers might not record an alarm event at exactly the same time, and
is used when one Alarms Server tells another server to perform some action
on a summary entry.
0 - (Don't acknowledge)
1 - (Acknowledge)
Default Value: 1
See Also
[Alarm]AckHold
Alarm Parameters
Determines whether alarms that have become inactive (and have been
acknowledged) remain in the OFF ACKNOWLEDGED alarm list. If you enable
this parameter, the alarms remain in the list until the operator clears them using
the AlarmClear() function.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 0
See Also
[Alarm]Active
Alarm Parameters
The period (in milliseconds) at which the display clients are advised of a change
in alarms. For example, if [Alarm}Active is set to 1000, the display clients are
[Alarm]AlarmDisable
Alarm Parameters
Enables/disables the processing of all alarms.
Allowable Values:
0 - (Enable)
1 - (Disable)
Default Value: 0
See Also
[Alarm]CacheLength
Alarm Parameters
The maximum number of alarms that can be held in the cache of a Display
Client. If the error message "Alarm not found in cache" displays, you must
increase the default value of this parameter.
You should set the cache size to the maximum number of different alarms that
will be displayed simultaneously. For example, if your alarm page can display 25
alarms and you want to display 4 pages simultaneously, set the CacheLength to
100. The CacheLength parameter is used by each Display Client.
Allowable Values: 10 to 200
Default Value: 150
See Also
[Alarm]DefDspFmt
Alarm Parameters
Specifies an Alarm display format to use if the Alarms Display Format field is
blank (in Alarm Categories).
If all your alarm display formats are the same, you can set your alarm display
format once in this parameter (instead of repeating the format many times in the
Alarm Categories database). You would then save memory and increase the
performance of your project.
Allowable Values: Any combination of alarm display fields
Default Value: {Time,12} {Tag,10} {Name,20} {Desc,32}
See Also
Alarm Parameters
755
756
[Alarm]DefSumFmt
See Also
[Alarm]DisplayDisable
Alarm Parameters
Changes the meaning of the [Alarm]AlarmDisable function. Normally (by
default), when an alarm is disabled it is no longer processed by the system. The
alarm is not displayed in the alarm displays (except the disabled list), is not
logged, and does not change state with the I/O device variable.
By setting this parameter, you change the meaning of Disable so that the alarm is
still processed and logged - but it is not displayed on the alarm display or
summary lists.
Allowable Values:
0 - (Disable completely)
Default Value: 0
See Also
[Alarm]EnableSmartCus
tomFilters
Alarm Parameters
Enables/disables the caching of custom alarm queries to facilitate later use of the
same filter.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 1
[Alarm]EventFmt
See Also
[Alarm]EventQue
Alarm Parameters
Enables/disables the Alarm event queue on the Alarms Server. Only set this
parameter if you are using the Alarm event queue, because it can increase CPU
loading and reduce the performance of the Alarms Server.
0 - (Disable)
1 - (Enable)
Default Value: 0
See Also
[Alarm]ExtendedDate
Alarm Parameters
Determines whether the short (dd/mm/yy) or extended (dd/mm/yyyy) date
format is used when interpreting the {DATE,n} alarm format.
Allowable Values:
Default Value: 1
See Also
[Alarm]HardHoldTime
Alarm Parameters
The time (in seconds) to hold a hardware alarm in its alarm state before it is
reset.
Allowable Values: 1 to 86400
Default Value: 30
See Also
[Alarm]HardReAlarm
Alarm Parameters
Determines whether to display the oldest or the most recent hardware alarm.
Allowable Values:
0 - (Multiple hardware alarms for a single device are queued so that only the
oldest alarm displays)
Default Value: 0
See Also
[Alarm]HardwareDisabl
e
Alarm Parameters
Enables/disables the processing of hardware alarms.
Allowable Values:
0 - (Enable)
1 - (Disable)
Default Value: 0
757
758
[Alarm]HighResOff
Alarm Parameters
Sets the precision of time-stamped alarms. You can specify millisecond accuracy
when alarms become active, or when alarms become active and when they
become inactive. This parameter is used with time stamped alarms only.
Allowable Values:
Default Value: 0
See Also
[Alarm]Hres24HrDeadB
and
Alarm Parameters
Determines how many seconds the PLC time can be ahead of CitectSCADA time
before the date field (if used) will show an alarm as occurring on the previous
day. This parameter is only relevant if you are using 24 hour time stamped
alarms. This is determined by [Alarm]HresType. (If [Alarm]HresType is in mode
5, 6, or 7, you are using 24 hour time stamped alarms.) If you are not using 24
hour time stamped alarms, this parameter has no effect.
Allowable Values: 0 to 65,535 (seconds)
Default Value: 60
See Also
[Alarm]HresType
Alarm Parameters
Determines the time format used to record time stamped alarms. When a time
stamped alarm is triggered, CitectSCADA reads the time of the alarm from the
PLC or RTU and stores it in one of the 10 formats listed below.
Allowable Values
0
1
2
3
4
5
6
7
8
Negative Millisecond Offset. The maximum history is 439 days from midnight
of the next day.
[Alarm]HwExclude
Alarm Parameters
Specifies a list of hardware alarms that the hardware alarm system will not
process.
Allowable Values: A comma-separated list of hardware error codes
Default Value: NONE
See Also
[Alarm]LastAlarmDispla
yMode
Alarm Parameters
Determines whether the last alarm is displayed by category or priority. This
parameter only affects the DisplayLastAlarm() Cicode function. For example, if
you set this parameter to Display by Priority, pages based on templates which
call DisplayLastAlarm() will be affected. Instead of displaying the current alarm,
the most recent of those alarms with the highest priority will be displayed.
Allowable Values:
0 - Display by category
1 - Display by priority
Default Value: 0
See Also
[Alarm]LastAlarmFmt
Alarm Parameters
Specifies the format of the last alarm as displayed on all the included templates.
Allowable Values: Any combination of Alarm Display Fields
Default Value: {Tag,16} {Name,32} {Desc,32}
See Also
[Alarm]MaxOptimisedQ
ueries
Alarm Parameters
Used when [Alarm]EnableSmartCustomFilters=1 is set. This is the number of
queries that the alarm server caches. When the 101st new query occurs, the
oldest query information is discarded. It is unlikely more queries than this will
need to be cached.
Allowable Values: 1 to 32000
Default Value: 100
759
760
[Alarm]Period
The period used to determine when a Rate of Change alarm will be triggered for
a variable tag. The Rate specified in Analog Alarm Properties is divided by this
period to determine the maximum rate at which the value of the variable tag
can change. At each Scan Time (see [Alarm]ScanTime), CitectSCADA checks the
value of the tag. If its rate of change is greater than the maximum rate, a Rate of
Change Alarm is triggered.
For example, to ensure that a tank does not fill too quickly, you might configure
a rate of change alarm, using an [Alarm]Period of 60 seconds, an
[Alarm]ScanTime of 1 second, and a Rate (see above) of 300 litres. This means
that the maximum allowable rate of change for the tank level is 5 l/sec (300 litres
/ 60 seconds). CitectSCADA calculates the actual rate of change at each
ScanTime. i.e. Every second, it checks the current level of the tank and compares
it to the level recorded a second earlier. If the actual rate of change is, say, 8 l/sec,
a Rate of Change Alarm is triggered immediately.
Allowable Values: 1 to 3600 (seconds)
Default Value: 60
See Also
[Alarm]Primary
Alarm Parameters
Determines if this Alarms Server is the Primary Alarms Server.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values:
Default Value: 1
See Also
[Alarm]SavePeriod
Alarm Parameters
The period for saving current alarm and event data to disk. You can save alarm
and event data periodically - to ensure that the data is restored after a system
crash or shutdown. Note that the smaller the period, the greater is the load on
the system. (This parameter has no bearing on the logging of data to a log
device.)
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values: 0 to 86400 (seconds) - 0 (zero) means data is not saved
Default Value: 600
See Also
[Alarm]SavePrimary
Alarm Parameters
The path to the primary save file. CitectSCADA uses two save files, usually one
for each of the two Alarms Servers. The SavePrimary path is the directory where
[Alarm]SaveSecondary
Alarm Parameters
The path to the secondary save file. The secondary save file is only used when
two Alarms Servers are active, and should point to the save file of the other
Alarms Server. To enable the Alarm save file, you must set the save period in the
[Alarm]SavePeriod parameter. (You should also set the path to the primary save
file with the [Alarm]SavePrimary parameter.)
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values: Any valid directory
Default Value: " " (none)
See Also
[Alarm]SaveStyle
Alarm Parameters
Determines whether alarms records are identified by their record number or
alarm tag. Normally, each record has a record number and type number that
identifies the alarm. If you are using two Alarms servers (each with different
Alarms databases) and if you rearrange or delete records, the record and type
numbers will differ. In this instance, you can use the alarm tag identifier to
identify the alarms.
If you use the alarm tag identifier, all alarm tags must be unique. By identifying
alarms with the alarm tag identifier, you use more disk space and larger data
packets (for client/server communication), and system performance is reduced.
Allowable Values:
Default Value: 3
See Also
[Alarm]ScanTime
Alarm Parameters
Determines the rate at which alarms are scanned and processed. A value of 500
(the default value) indicates that CitectSCADA tries to process the alarms every
500ms. However, if CitectSCADA cannot read all the alarm data from the I/O
761
762
[Alarm]Server
Alarm Parameters
Determines whether this computer is an Alarms Server.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values:
1 - (Alarms Server)
Default Value: 0
See Also
[Alarm]SetTimeOnAck
Alarm Parameters
Determines whether the {Time} field in your Alarm Display and Alarm Log
Device contains the time when an alarm is triggered, or the time when the alarm
is acknowledged.
When this parameter is enabled and the operator acknowledges an alarm, the
{Time} field on the alarm page (and associated with the alarm record) is changed
to the current time. If you want the {Time} field to remain at the time when the
alarm was triggered, set this parameter to 0.
Note: This parameter has no effect on the Alarm Summary Display and Alarm
Summary Device, which have separate {OnTime} and {AckTime} fields.
Allowable Values:
0 - (Set the alarm time to the time when the alarm is activated)
1 - (Set the alarm time to the time when the alarm is acknowledged)
Default Value: 1
See Also
Alarm Parameters
[Alarm]SetTimeOnOff
Determines whether the {Time} field in your Alarm Display and Alarm Log
Device contains the time when an alarm is triggered, or the time when the alarm
becomes inactive.
When this parameter is enabled and the alarm becomes inactive, the {Time} field
on the alarm page (and in the associated alarm record) is changed to the current
time. If you want the {Time} field to remain at the time when the alarm was
triggered, set this parameter to 0.
Note: This parameter has no effect on the Alarm Summary Display and Alarm
Summary Device, which have a separate {OffTime} field.
Allowable Values:
0: (Set the alarm time to the time when the alarm is activated)
1: (Set the alarm time to the time when the alarm becomes inactive)
Default Value: 1
See Also
[Alarm]Sort
Alarm Parameters
Determines the order in which alarms are displayed in the alarm list. Setting this
parameter to 0 lists the alarms in the order in which they are acknowledged.
Setting it to 1 lists the alarms in the order of their occurrence, or ON times.
Allowable Values: 0, 1
Default Value: 0
See Also
[Alarm]SortMode
Alarm Parameters
Determines the sort order for displaying alarms. The alarms are listed either in
ascending order (the oldest alarms at the top) or descending order (the most
recent alarms at the top).
Allowable Values:
0: (descending)
1: (ascending)
Default Value: 0
See Also
[Alarm]StartTimeout
Alarm Parameters
Sets the timeout period for loading data from the primary Alarms Server. When
a second Alarms Server starts, it tries to get the alarm current states from the
primary server. This parameter determines how long to wait for a reply from the
primary server. At the end of the timeout period, the Alarms Server either loads
the saved data or reads the alarm data (from the I/O devices).
763
764
[Alarm]SummaryLength
Alarm Parameters
The maximum number of alarm summary entries that can be held in memory.
You can view these alarm summary entries on the alarm summary page. Note
that each event requires 202 bytes of memory, plus the length of the comment.
32,000 events require at least 6.2 Mb of memory. If you use many events, you
should have enough memory to keep them in RAM.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values: 0 to 2147483647
Default Value: 1000
See Also
[Alarm]SummaryMode
Alarm Parameters
Specifies whether alarm summary events are logged to the Alarm Summary log
device in the order they went ON, or in the order they went OFF. For each mode,
the summary events can be removed from the screen after logging, or can
remain until they are removed with the AlarmSumDelete() function.
Allowable Values:
Default Value: 0
See Also
[Alarm]SummarySort
Alarm Parameters
This parameter allows you to customize the order in which alarms will be
displayed on the alarm summary page. It is important to use this parameter if
you have remote I/O devices in your system and you want to be certain that
alarms are listed according to the exact time they occurred as opposed to the
time they were reported by the alarms server.
You can choose to organize alarms according to the time each alarm was
activated (OnTime), inactivated (OffTime), or the time the alarm was
0 None
1 OnTime
2 OffTime
3 AckTime
Default Value: 0
See Also
[Alarm]SummarySortMo
de
Alarm Parameters
This parameter organizes alarms on the alarm summary page in ascending or
descending order. Changing this parameter at runtime will not affect the current
way alarms are displayed. It will only take affect at CitectSCADA start up and is
usually used in conjunction with the [Alarm]SummarySort parameter.
Allowable Values:
Default Value: 0
See Also
[Alarm]SummaryTimeo
ut
Alarm Parameters
The length of time that alarm summary entries remain in the alarm summary
queue.
You can disable this parameter by setting it to -1.
Note: This parameter is to be modified only by the Computer Setup Wizard
Allowable Values: 0 to 20000 (minutes)
Default Value: 60
See Also
[Alarm]SummaryTolera
nce
Alarm Parameters
This parameter allows for the fact that the two alarm servers might not record an
alarm event at exactly the same time, and is used when one Alarms Server tells
another server to perform some action on a summary entry. The first Alarms
Server sends its recorded summary time to the second Alarms Server, using that
time +/- the SummaryTolerance to find the corresponding alarm summary.
Allowable Values: 1 to 3600 (seconds)
765
766
[Alarm]SummaryShutdo
wnMode
Alarm Parameters
Specifies whether alarm summary entries (both complete and incomplete) that
have not been logged are logged at shutdown. Alarm summary entries may be
duplicated with redundant servers when one server is shutdown and restarted.
This parameter should only be changed from the default if you are NOT using
redundant alarm servers and/or alarm save files.
Allowable Values:
Default Value: 0
See Also
[Alarm]SumStartupCop
y
Alarm Parameters
Determines whether the alarm summary data is copied to the other Alarms
Server on startup. Normally, the second Alarms Server gets all the alarm and
summary data from the first server on startup. With this parameter, you can
disable the sending of the summary data.
Allowable Values:
1 - (Send data)
Default Value: 1
See Also
Alarm Parameters
See Also
[AlarmLog]DefaultSearc
hDays
See Also
[AlarmLog]Format
See Also
[AlarmLog]NumFiles
767
768
0 - (Disabled)
1 to 32767 - (Enabled)
Default Value: 0
See Also
Animator Parameters
The citect.ini file contains the following animator parameters:
[Animator]BoldWeight - The weight of a text font when bold is specified the larger the number, the heavier is the font.
[Animator]InvalidRegionQueueLength - The maximum number of nonoverlapping objects that will be individually re-drawn when a large number
of objects change simultaneously at runtime.
See Also
[Animator]BoldWeight
See Also
Animator Parameters
769
770
[Animator]ButtonCance
lMode
See Also
[Animator]CacheSize
Animator Parameters
The maximum number of symbols that can be held in the cache of a Display
Client. If you increase the cache size, you use Windows resources and could
cause problems with other software packages. Note that all symbols are actually
cached in memorythis cache is a secondary cache.
Note: Although this parameter is still valid, it is only used for V3.xx and V4.xx
animations.
Allowable Values: 10 to 200
Default Value: 50
See Also
[Animator]ConfigureMo
useCommand
Animator Parameters
Determines whether you can configure command keys for the mouse buttons
(left and right).
Allowable Values:
Default Value: 1
See Also
[Animator]EatMouseCli
ck
Animator Parameters
Determines whether CitectSCADA ignores (eats) the mouse click (left button
down or up, or right button down or up), if commands are defined for those
keys.
1 - (Ignore mouse)
Default Value: 0
See Also
[Animator]EatMouseFo
cus
Animator Parameters
Determines whether CitectSCADA ignores (eats) the left button down message
when you change the focus of a window with the mouse. Normally, if you have
two windows on the screen and you click with the mouse from one to the other
(to change the focus), any keyboard commands using the left mouse button
execute. In addition, if you click on a button, the button command executes.
If you set this option to 1, the left mouse button click is ignored when you
change the window focus.
Allowable Values:
1 - (Ignore mouse)
Default Value: 0
See Also
[Animator]FastDisplay
Animator Parameters
Determines whether CitectSCADA displays fast runtime graphics pages. If you
enable this parameter, the runtime system searches for a fast display image
when you display a page. If a fast display image is not found, the runtime
system searches for a normal display image.
If you disable this parameter, the runtime system does not search for a fast
display image and Graphics Builder will not save a fast display image. This
option may also be set using the Options dialog in Graphics Builder (change the
"Fast runtime display" option). If you want to save disk space, you can delete all
files with the extension CTF in your project when this parameter is disabled.
Note: On modern hardware, the fast display image may not be faster to display
a page unless disk performance is a problem, as fast display images are smaller
than normal display images, and will therefore take less time to load from disk.
Allowable Values:
Default Value: 1
See Also
Animator Parameters
771
772
[Animator]FlashTime
See Also
[Animator]FormFontWi
dth
Animator Parameters
Determines how the text field width for forms with text fields (Check Boxes,
Radio Buttons, Prompts, etc) is displayed. You should only use this parameter if
you are using CitectSCADA Version 2.00 (or earlier) to size the text fields
generated with the Cicode form functions.
Allowable Values:
Default Value: 1
See Also
[Animator]FullScreen
Animator Parameters
Determines whether pages will be displayed in full screen or restored state.
A page in full screen state takes up the entire display area (assuming this does
not affect its aspect ratio), and it cannot be resized. Also, a full screen page will
display without a title bar unless Title Bar is checked in Page Properties (or was
checked when the page was created). Resizing pages can result in degraded
picture quality. If this is unacceptable, you should re-design the page using the
desired resolution.
A page in restored state can be resized by clicking and dragging on the window
frame. If you resize a page, subsequent pages will, by default, be resized using
the same scale. Note, however, that if the [Page]DynamicSizing parameter is set
to FALSE, resizing the window will not change the page size.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values:
Default Value: 0
See Also
[Animator]InvalidRegio
nExpansion
Animator Parameters
Objects which are less than this distance apart will be re-drawn as a group if
they change simultaneously at runtime. This parameter is useful for improving
runtime page display times. For example, you could set this parameter to 64
pixels, and draw a group of 5 individual lights (driven by digital tags) with 50
[Animator]InvalidRegio
nQueueLength
Animator Parameters
The maximum number of non-overlapping objects (or objects that are further
apart than the distance specified by the [Animator]InvalidRegionExpansion
parameter) that will be individually re-drawn when a large number of objects
change simultaneously at runtime. For example, if you set this parameter to 30,
and you have a graphics page that contains 200 lights (driven by digital tags),
and all the associated tags change state at once, only 30 of the lights would be redrawn individually; the remaining lights would be re-drawn (as a group) in one
step.
Allowable Values: 1 to 32000
Default Value: 10
See Also
[Animator]LibraryError
Animator Parameters
Determines whether a dialog box displays for any symbol that cannot be found.
Allowable Values:
Default Value: 0
See Also
[Animator]LibraryLengt
h
Animator Parameters
The number of objects that will be held in the library cache.
Allowable Values: 1 to 100000
Default Value: 100
See Also
[Animator]LibraryTime
Animator Parameters
The period that imported symbols remain in the library cache.
Allowable Values:
0 to 864000 (seconds)
773
774
[Animator]MaxAn
Animator Parameters
The maximum number of animation points (ANs) on a graphics page. You
should avoid large values for this parameter. Each AN uses memory and a large
number of ANs will reduce the performance of your runtime system.
Note: Although this parameter is still valid, it is only used for V3.xx and V4.xx
animations.
Allowable Values: 256 to 1999
Default Value: 300
See Also
[Animator]PrintXScale
Animator Parameters
The X scaling factor applied when the WinPrint() function is called to print the
screen (on the printer).
Allowable Values: 1 to 10
Default Value: 4
See Also
[Animator]PrintYScale
Animator Parameters
The Y scaling factor applied when the WinPrint() function is called to print the
screen (on the printer).
Allowable Values: 1 to 10
Default Value: 4
See Also
[Animator]TabFactor
Animator Parameters
Controls the distance between tab stops on the graphics display. CitectSCADA
calculates the width of a tab stop by counting the number of characters, times
the average width, times the tab factor. Normally the average width, times the
number of characters makes the tab stops too wide. Therefore the tab factor is set
to 70 % to reduce the width. If you have wide characters, or use a lot of upper
case the default tab factor may be too narrow, and overlapping of the display
may result. (Increase up to 100% for the widest tab stops.)
Allowable Values: 10 to 100
Default Value: 70
See Also
[Animator]TemplateUpd
ate
Animator Parameters
Enables the update of linked pages to reflect template modifications.
Setting this parameter allows linked graphics pages to be updated if the
templates on which they are based have been modified. The update takes place
when you click Update Pages in the Tools menu of Graphics Builder.
[Animator]TooltipFont
Animator Parameters
Specifies the font to be used for tool tip text. This parameter is checked each time
you start CitectSCADA. (You can also use the function DspSetTooltipFont to set
the font.)
Unlike other parameters where only one value is supplied, you can enter up to
three values to set the tool tip font - the name of the font, the point size, and
formatting attributes. Only the name of the font is required. If you don't set
values for the other attributes, their default values are used.
Allowable Values: Name, PointSize, BIU
Default Values: 12 (PointSize)
"" (BIU)
See Also
[Animator]UseCTGIfNe
wer
B specifies Bold
I specifies Italics
U specifies Underline
Animator Parameters
When a page is opened and Fast Runtime Display is enabled, CitectSCADA
searches for both the CTF and the CTG files and uses whichever is newer. This
can be unnecessary in some situations, for example, it will cause the Internet
Display Client to copy both the CTG and CTF files for a page when only the CTF
is required. The UseCTGIfNewer parameter alters this behaviour so that the
CTG is only searched for if the CTF cannot be found.
Allowable Values:
0 - The CTG is located and loaded only if the CTF cannot be found
775
776
Animator Parameters
AnmCursor Parameters
The cursor is represented by a box with an internal and an external border.
Symbols and text have imaginary borders that represent the inside border. When
specifying cursor dimensions, you must specify the size of the external border.
See Also
[AnmCursor]Colour
[AnmCursor]Height - The distance (in pixels) from the top and bottom of
the inside border to the outside border (of the cursor).
[AnmCursor]Width - The distance (in pixels) from the left and right of the
inside border to the outside border (of the cursor).
0x000000 - (Black)
0x000080 - (Blue)
0x008000 - (Green)
0x008080 - (Cyan)
0x800000 - (Red)
0x800080 - (Magenta)
0x808000 - (Brown)
0xBFBFBF - (Grey)
0xFFFF00 - (Yellow)
0xFFFFFF - (White)
[AnmCursor]Height
AnmCursor Parameters
The distance (in pixels) from the top and bottom of the inside border to the
outside border (of the cursor).
Allowable Values: 1 to 20
Default Value: 1
See Also
[AnmCursor]InvertText
AnmCursor Parameters
Enables/disables the inversion of the color of the text within the cursor box.
Note: Although this parameter is still valid, it is only used for V3.xx and V4.xx
animations.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 0
See Also
[AnmCursor]MouseSna
pToCursor
AnmCursor Parameters
Specifies the behaviour of the Windows cursor in relation to the CitectSCADA
cursor.
When set to FALSE the Windows cursor and the CitectSCADA cursor behave
independently.
When set to TRUE the Windows cursor snaps to the centre of the CitectSCADA
cursor. In this case a page update will not result if the cursor position is
changing.
Allowable Values:
0 - (False)
1 - (True)
777
778
[AnmCursor]Thickness
AnmCursor Parameters
The thickness of the outside cursor border (in pixels).
Allowable Values: 1 to 20
Default Value: 1
See Also
[AnmCursor]Width
AnmCursor Parameters
The distance (in pixels) from the left and right of the inside border to the outside
border (of the cursor).
Allowable Values: 1 to 20
Default Value: 2
See Also
AnmCursor Parameters
Backup Parameters
The citect.ini file contains the following backup parameter:
See Also
[Backup]IncludeDBOn
1 - (Message displayed)
Default Value: 1
See Also
Backup Parameters
CrashHandler Parameters
The citect.ini file contains the following crashhandler parameter:
See Also
[CrashHandler]Enable
0 - Disabled
1 - Enabled
Default Value: 1
See Also
CrashHandler Parameters
[LLC]WatchTime - The frequency (in seconds) that the driver uses to check
the communications link to the I/O device.
Warning! The default value for these parameters has been set to the best value
for a CiNet network. Do not change these values except on the advice of Citect
Support.
See Also
779
780
[LLC]Block
The blocking constant is a trade-off between the time taken to make multiple
data requests and the time taken to read more data in a single request.
Allowable Values: 10 to 256
Default Value: 256
See Also
[LLC]Compress
See Also
[LLC]Delay
See Also
[LLC]MaxPending
See Also
[LLC]PollTime
See Also
[LLC]Retry
See Also
[LLC]Timeout
[LLC]WatchTime
See Also
Client Parameters
The citect.ini file contains the following client parameters:
See Also
[Client]Manager
0 - (Disable)
1 - (Enable)
Default Value: 0
See Also
[Client]Primary
Client Parameters
The name of the primary CitectSCADA server. This parameter is used by each
Display Client to indicate which server it should look for at startup. If the
781
782
[Client]ReadOnly
Client Parameters
Prevents the CitectSCADA client from writing to any I/O device. This includes
Disk and physical I/O devices. However, the client can still write to local
memory I/O devices.
This is useful when you want to prevent a client from modifying the online
system (e.g. when you are developing the client). When a write is made to a
physical I/O device, and this parameter is set to 1, the following hardware error
results: "Write location is protected".
Allowable Values:
0 - (Enable writes)
1 - (Disable writes)
Default Value: 0
See Also
[Client]Standby
Client Parameters
The name of the standby CitectSCADA server. The standby server is used if the
primary server cannot be accessed. Used by the Display Clients only.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values: Any server defined in [Server]Name.
See Also
Client Parameters
Code Parameters
The citect.ini file contains the following code parameters:
[Code]Stack - The size of the stack when CitectSCADA calls a user DLL
function through the Cicode function DLLCall().
[Code]TimeSlice - The period (in milliseconds) that a Cicode thread can run
- before it is swapped out.
783
784
[Code]AutoReRead
Default Value: 1
See Also
[Code]BackwardCompa
tibleErrHw
Code Parameters
Enables/Disables the backward compatibility of Cicode functions ErrGetHw and
ErrSetHw used after CitectSCADA Version 5.20
Note: Set this flag ONLY if you do not have greater than 511 I/O devices in your
project, AND you have used the ErrGetHw() or ErrSetHw() functions in that
project. This will allow you to mask the 'IODevNo' with the value of 512 in the
'Device' argument of those functions.
Allowable Values:
Default Value: 0
See Also
[Code]DebugMessage
Code Parameters
Enables/Disables the DebugMsg() function. Also controls the logging
functionality of the Assert() function. This parameter can be set and reset at
runtime with the DebugMsgSet() function.
Allowable Values:
0 - (Disable logging)
1 - (Enable logging)
Default Value: 0
See Also
[Code]DllCallErrorPopu
p
Code Parameters
Creates a popup and logs faults on calls to third-party DLLs via Cicode, but only
if the DllCallProtect parameter is set. The popup can be turned off by the global
[Debug]SysErrDsp=0 setting; however, the log data will be sent to the syslog.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 0
[Code]DllCallProtect
If, when calling an external DLL, the file has a software fault, this will cause
CitectSCADA to crash. You can protect CitectSCADA from a crash by setting the
[Code]DllCallProtect=1 value in your citect.ini file.
Setting [Code]DllCallErrorPopup=1 also logs the Cicode function and
arguments being used when the fault occurred.
Citect recommends that these parameters be set during commisioning.
As DLLs can use different languages and versions, if is possible for
CitectSCADA to falsely catch an exception using the DllCallProtect=1 setting.
We recommend a run is tried without the DllCallProtect setting, to see if a real
crash would happen in the called DLL.
Allowable Values:
0 - (Disable)
1 - (Enable protection)
Default Value: 0
[Code]EchoError
See Also
Code Parameters
785
786
[Code]Export
[Code]HaltOnError
Code Parameters
If an error occurs in some critical Cicode functions, your Cicode task will
generate a hardware error and will halt. You may stop your Cicode task from
being halted by using the ErrSet() function and checking for errors using the
IsError() function. You may also stop your Cicode from being halted by setting
this parameter to 0, however, the hardware error will still be generated. Setting
this parameter is global to all Cicode threads, so you do not have to set ErrSet()
for each Cicode tread.
The following functions can halt your current Cicode task when an error occurs:
FormNew, DevOpen, DevHistory, DevNext, DevPrev, DevSeek, DevFind,
DevFlush, DevRecNo, DevRead, DevReadLn, DevAppend, DevDelete, DevZap,
DevControl, DevPrint, DevModify, ErrTrap, FileOpen, FileClose, FileReadBlock,
FileWriteBlock, FileSeek, FileDelete, FileReName, FileSize, FileReadLn,
FileCopy, SQLConnect, SQLTraceOn, SQLTraceOff, SQLErrMsg.
Allowable Values: 0 (Do Not halt Cicode when and error occurs in a function
listed above).
Default Value: 1 (Halt Cicode when an error occurs in a function listed above).
See Also
[Code]IgnoreCase
Code Parameters
Controls whether CitectSCADA is case insensitive to string data in Cicode. Case
sensitivity is used when a string comparison operation is performed. For
example:
IF sStr1 = sStr2 THEN
Cicode is a case insensitive language and ignores the case of all variables,
functions and reserved words. You can also make CitectSCADA case sensitive to
strings within the just current thread, using the CodeSetMode() function.
Note: This parameter is global.
Allowable Values: 0 or 1
Default Value: 1 (Insensitive)
See Also
[Code]Queue
Code Parameters
The maximum number of elements in queues. Queue elements are allocated
from the dynamic memory pool. If you specify unlimited number (-1) and you
[Code]ScaleCheck
Code Parameters
Controls whether CitectSCADA checks for scaling over/under flow errors in
Cicode. When a variable tag is modified, Cicode checks the new value of the
variable against the Scales specified in the Variable Tags database. If the value of
the variable is out of scale, Cicode generates a hardware error, and does not
write to the I/O device. This parameter is global.
Allowable Values: 0 or 1
Default Value: 1 (Check)
See Also
[Code]Shutdown
Code Parameters
Can be used to specify a Cicode function that runs at shutdown. CitectSCADA
suspends the shutdown process until the function has finished running. The
function must complete execution within the time specified by the
[Code]ShutdownTime parameter, otherwise CitectSCADA will terminate it.
See Also
[Code]ShutdownTime
Code Parameters
Specifies the maximum time allowed for the execution of any Cicode functions
triggered by the [Code]Shutdown parameter. After the specified time passes,
CitectSCADA will terminate the function.
Allowable Values: 1 to 120 (seconds)
Default Value: 30
See Also
[Code]Stack
Code Parameters
The size of the Cicode stack. If a "Cicode stack overflow" hardware error is
displayed, increase the size of the Cicode stack. If CitectSCADA aborts with a
"General stack overflow" error, increase the value of the [General]Stack
parameter.
Allowable Values: 8196 to 30000
Default Value: 20000
See Also
Code Parameters
787
788
[Code]Startup
[Code]StrictArgumentC
heck
Code Parameters
Determines whether the compiler checks for calls to functions missing
parameters. The compiler will by default pass a 1 value or an empty string to
function calls that do not have a parameter, and no default defined.
Allowable Values:
Default Value: 1
Example
INT
FUNCTION
AddTwoNumbers(INT a, INT b)
RETURN a + b;
END
FUNCTION
CallFunction()
INT sum = AddToNumbers();
This will not compile by default, but will compile when
[CODE]StrictArgumentCheck=0.
See Also
[Code]Threads
Code Parameters
The number of Cicode threads (tasks) that can run concurrently. Note that each
report running simultaneously uses one thread, and each keyboard command
running simultaneously uses one thread. If the hardware error "Out of Cicode
threads" is displayed, increase the value of this parameter.
Allowable Values: 5 to 512
Default Value: 64
[Code]TimeData
Code Parameters
The period (in milliseconds) that a Cicode function assumes real-time data is
current (i.e. before the data is read again). If the function is called recursively,
this parameter determines if the data is re-read from the I/O device.
Allowable Values: 500 to 60000 (milliseconds)
Default Value: 3000
See Also
[Code]TimeSlice
Code Parameters
The period (in milliseconds) that a Cicode thread can run - before it is swapped
out. After all other threads have run, it is swapped back in. This parameter does
not apply to threads that update graphics pages.
Allowable Values: 20 to 5000 (milliseconds)
Default Value: 100
See Also
[Code]TimeSlicePage
Code Parameters
The period (in milliseconds) that a Cicode thread can run - before it is halted.
This parameter applies only to threads that are called from the Graphics
databases.
Allowable Values: 20 to 5000 (milliseconds)
Default Value: 500
See Also
[Code]Unsigned
Code Parameters
Note: This parameter is obsolete. CitectSCADA now supports unsigned integers
as a standard data type.
This parameter used to determine if 16 bit integers were interpreted as unsigned
or signed. But only the MODCELL and COMLI protocols supported this option,
and setting this parameter affected both protocols.
Signed integers can have values from -32768 to +32767. Unsigned integers can
have values from 0 to 65535.
Allowable Values:
0 - (Interpret as signed)
1 - (Interpret as unsigned)
Default Value: 0
See Also
[Code]VBASupport
Code Parameters
This parameter allows a user to disable CitectSCADA VBA support.
789
790
Default Value: 1
See Also
[Code]WriteLocal
Code Parameters
Controls whether CitectSCADA writes to a local run table in Cicode. Cicode
writes its local memory image of the I/O device whenever you write to the I/O
device. (Cicode assumes that most writes to the I/O device will be done
immediately). This local image might produce problems, or you might want to
verify that the data was actually written to the I/O device. If you disable this
check, Cicode does not write to the local memory image. This parameter is
global.
Allowable Values:
Default Value: 1
See Also
Code Parameters
Com Parameters
The citect.ini file contains the following com parameter:
See Also
[Com]StartTimeOut
[Com]StartTimeOut - The period to wait for all I/O devices to come online
before displaying any data.
See Also
Com Parameters
CrashMailer Parameters
The citect.ini file contains the following CrashMailer parameter:
[CrashMailer]Enable
0 - (Disable)
1 - (Enable)
Default Value: 1
CtAPI Parameters
The citect.ini file contains the following CtAPI parameters:
See Also
[CtAPI]Remote
791
792
Default Value: 1
See Also
[CtAPI]CpuLoadCount
CtAPI Parameters
Depending on the capability of your hardware, it is sometimes possible to
overload the server's CPU while making a Trend or Alarm query using
ctFindFirst(). To avoid this you can use CpuLoadCount in conjunction with
the CpuLoadSleepMS parameter.
CpuLoadCount allows you to control how often the request pauses (sleeps)
while it is collecting data. The load count corresponds approximately with the
number of rows of query data processed by the server before it pauses.
Decreasing this number means the request will pause more often and hence take
longer to complete. However the workload will be stretched over a longer time
period, decreasing the intensity of demand on the CPU.
Note: You will need to experiment to see which values are appropriate for
optimum performance on your system. When experimenting you should adjust
the value of CpuLoadSleepMS before CpuLoadCount.
Allowable Values: 0 to any valid INT
Default Value: 100
See Also
[CtAPI]CpuLoadSleepM
S
CtAPI Parameters
Depending on the capability of your hardware, it is sometimes possible to
overload the server's CPU while making a Trend or Alarm query using
ctFindFirst(). To avoid this you can use CpuLoadSleepMS in conjunction with
the CpuLoadCount parameter.
CpuLoadSleepMS allows you to control how long the request pauses (sleeps)
while it is collecting data. Pausing for longer periods will cause the request to
take longer but will decrease the intensity of the load on the CPU.
Note: You will need to experiment to see which values are appropriate for
optimum performance on your system. When experimenting you should adjust
the value of CpuLoadSleepMS before CpuLoadCount.
Allowable Values: 0 to any valid INT (milliseconds)
Default Value: 100
See Also
CtAPI Parameters
CtCicode Parameters
The citect.ini file contains the following CtCicode parameters:
See Also
[CtCicode]MLComment
Threshold
See Also
CtCicode Parameters
CtDraw.RSC Parameters
The citect.ini file contains the following CtDraw.RSC parameters:
See Also
[CtDraw.RSC]BitmapCo
mpression
0 - no compression used
Default Value: 5
See Also
CtDraw.RSC Parameters
793
794
[CtDraw.RSC]ColorDept
hWarning
Enables a dialog to display in Graphics Builder if the color is set to a value other
than 256 colors (e.g. 16-bit or True color). The dialog enables the operator to
change the color resolution if loss of color information is occurring. The dialog
displays initially when the computer is not currently using 256 colors, and this
parameter is set to 1.
The first time the dialog displays, if the operator chooses not to change to 256
colors, and does not check the "Don't show this dialog again" box, the dialog will
continue to pop up while the operator works in Graphics Builder.
The checkbox setting applies only until Citect is shutdown, at which time the
selection is cleared.
Allowable Values:
1 Dialog enabled
Default Value: 0
See Also
[CtDraw.RSC]PurgeGen
ieLists
CtDraw.RSC Parameters
This parameter is used if a modified genie is passing a substitution string that
was specific to the genie before it was modified, but is now invalid.
After you have restarted the Graphics Builder, perform an Update Pages on the
project.
Allowable Values:
Default Value: 1
See Also
CtDraw.RSC Parameters
CtEdit Parameters
The citect.ini file contains the following CtEdit parameters:
[CtEdit]Bin - The directory where the CitectSCADA binary files are located.
See Also
[CtEdit]ANSIToOEM
[CtEdit]Copy - Sets the COPY directory. Changes made in this directory will
be automatically copied to the RUN directory (see below).
[CtEdit]Data - The directory where the CitectSCADA data files are located.
[CtEdit]FTP - The location (on the Internet Server) of the runtime files
needed by the Internet Display Client.
Default Value: 0
795
796
[CtEdit]Backup
CtEdit Parameters
Note: This parameter is to be modified only by the Computer Setup Wizard
The backup directory that is used if a runtime database cannot be located (due to
a disk failure or file loss). Normally, the runtime database is located in the Run
directory. See the [CtEdit]Run parameter.
See Also
[CtEdit]Bin
CtEdit Parameters
Note: This parameter is to be modified only by the Computer Setup Wizard
The directory where the CitectSCADA binary files are located.
Allowable Values: Any valid directory
Default Value: \CITECT\BIN
See Also
[CtEdit]CompileErrorFo
rm
CtEdit Parameters
Determines whether the Compiler Errors form is displayed automatically (when
you compile a project). The form does not display if no errors are found.
Allowable Values:
Default Value: 1
See Also
[CtEdit]Copy
CtEdit Parameters
Sets the COPY directory. Changes made to runtime files in this directory will be
automatically copied to the RUN directory (set using the [CtEdit]Run
parameter). The COPY project must be compiled for the changes to appear in the
RUN project.
This feature is useful when you want to have a local copy of a network project,
but don't want to be continually checking that the local copy is the same as the
master on the server (i.e. manually copy changed files across to the local project
etc.). CitectSCADA takes care of this automatically.
For example, you could set up a Display Client so that instead of running the
server version of a project (F:\CITECT\USER\MYPROJ) across a slow RAS
connection, it runs a local copy (C:\CITECT\USER\MYPROJ). In this instance,
you would set your RUN directory to C:\CITECT\USER\MYPROJ, and your
COPY directory to F:\CITECT\USER\MYPROJ (where F: is mapped to the
remote File Server).
[CtEdit]Data
CtEdit Parameters
The directory where the CitectSCADA data files are located.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values: Any valid directory (Note however that CitectSCADA will
not allow data to be stored in any subdirectory of the ..\citect\user\
directory)
Default Value: \CITECT\DATA
See Also
[CtEdit]DbFiles
CtEdit Parameters
The maximum number of .DBF files that can be open simultaneously. The
CitectSCADA runtime system, the Project Editor, and the compiler all use this
parameter. Increase this parameter if a "No more free handles" error message is
displayed.
See Also
[CtEdit]FTP
Default Value: 80
CtEdit Parameters
The location (on the Internet Server) of the runtime files needed by the Internet
Display Client.
Allowable Values: Any valid directory
See Also
[CtEdit]MaxCicodeFunc
tions
CtEdit Parameters
The maximum number of user functions that can be defined in a project.
Increase this parameter if the "Too many Cicode functions" compile error occurs.
Allowable Values: 2700 to 10000
Default Value: 4500
Note: Increasing this parameter may affect system performance. Do not set this
parameter unless advised by Citect Support.
797
798
[CtEdit]MaxFields
CtEdit Parameters
The maximum number of fields that can display on a Citect Project Editor form.
Allowable Values: 1 to 100
Default Value: 36
See Also
[CtEdit]MaxHelpRec
CtEdit Parameters
The maximum number of items that may be contained in a drop-down list box.
This option is easily changed through the Options form - accessible through the
File menu.
Default Value: 2000
See Also
[CtEdit]Run
CtEdit Parameters
The directory where the runtime project is located. If you run the project from
the Citect Explorer, Project Editor, Graphics Builder, or Cicode Editor, this
parameter will be automatically set to the name of the current project. If you
want to run a project independently of these applications, you will need to set
this parameter manually.
Note: If you have set a COPY directory (using the [CtEdit]Copy parameter),
any changes made and compiled in that directory will be automatically copied
to the RUN directory. Any file with a name that matches one of the files changed
in the COPY directory will be overwritten during this process. This copy only
occurs when the files are accessed at runtime.
Allowable Values: Any valid directory
Default Value: No default value.
See Also
[CtEdit]ShowToolbar
CtEdit Parameters
Shows / hides the toolbar in the Citect Project Editor.
Allowable Values: 0 or 1
Default Value: 1
See Also
[CtEdit]SubtAnValue
CtEdit Parameters
A string to replace a Genie substitution string of %An%.
When upgrading CitectSCADA from versions 3.xx or 4.xx to version 5.20 or
higher, you need to rename any Genie substitution strings called %An%.
The substitution text will change during the upgrade if you enable
[CtEdit]UpdateAnPage. If [CtEdit]UpdateAnPage is enabled, but you do not
[CtEdit]SubtPageValue
CtEdit Parameters
A string to replace a Genie substitution string of %Page%.
When upgrading CitectSCADA from versions 3.xx or 4.xx to version 5.20 or
higher, you need to rename any Genie substitution strings called %Page%.
The substitution text will change during the upgrade if you enable
[CtEdit]UpdateAnPage. If [CtEdit]UpdateAnPage is enabled, but you do not
specify a new Genie substitution string, the string will be renamed to the default
value.
Allowable Values: New Genie substitution string (up to 256 characters)
Default Value: PageSubt
See Also
[CtEdit]UpdateAnPage
CtEdit Parameters
Allows genie substitution strings of %Page% or %An% to be renamed during
project upgrades from versions 3.xx or 4.xx to version 5.21 or higher.
Without setting this parameter, you will be unable to specify a value for the
substitution strings, as %Page% will automatically be set to the name of the
current page, and %An% will be set to the AN of the current page. You will also
be unable to change these values.
The substitution strings will be renamed during an upgrade if this parameter is
enabled. Use [CtEdit]SubtAnValue and [CtEdit]SubtPageValue to specify the
new substitution strings.
Allowable Values:
0 to disable
1 to enable
Default Value: 0
See Also
[CtEdit]UpdateAnPageV
er5
CtEdit Parameters
Allows genie substitution strings of %Page% or %An% to be renamed during
project upgrades from version 5.10.
Without setting this parameter, you will be unable to specify a value for the
substitution strings, as %Page% will automatically be set to the name of the
799
800
0 to disable
1 to enable
Default Value: 0
See Also
[CtEdit]User
CtEdit Parameters
Note: This parameter is to be modified only by the Computer Setup Wizard.
The directory where databases are located.
Allowable Values: Any valid directory
Default Value: \CITECT\USER
See Also
CtEdit Parameters
DDE Parameters
The citect.ini file contains the following DDE parameter:
See Also
[DDE]Timeout
See Also
DDE Parameters
Debug Parameters
The citect.ini file contains the following debug parameters:
See Also
[Debug]CrashOnError
0 - (Disable)
1 - (Enable)
Default Value: 0
See Also
Debug Parameters
801
802
[Debug]DisableWinTop
Allows you to disable windows or popups from being forced to the top of the
screen. This allows an engineer to perform Kernel debugging or to run Cicode
from the Kernel without windows appearing. This INI is intended for
commisioning when you need to use the "kernel".
Allowable Values:
0 - (Normal)
1 - (Disable win on top)
Default Value: 0
[Debug]DriverCheck
This parameter is intended for driver developers, or users who are experiencing
CitectSCADA crashes due to driver issues. When this parameter is set, the
structure used to talk to drivers is monitored for changes. If an error occurs, a
Kernel and syslog message is generated.
With [debug]drivercheck=1 set, the DCB is checksummed.
On return the checksum is checked as well as a flag at the end of the DCB buffer;
for example:
*** WARNING: DriverCheck=1 DCB->buffer overrun ***
or
*** WARNING: DriverCheck=1 DCB corrupted/changed ***
Not all instances of this may be fatal or an issue. If a driver cleared the whole
DCB buffer of 554 bytes, then expect this error.
If a driver modifies the point information, expect the DCB corruption message.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 0
[Debug] section of the CITECT.INI file, and are as follows (three INIs follow)
DriverTrace=[OFF | CMDS | VER[BOSE]]
where:
CMDS - Turns the DriverTrace on, but does not display the contents of the
pDcb->Buffer. Note that specific driver commands must be enabled with the
DriverTraceMask INI parameter (or associated Kernel command).
VER[BOSE] - Turns the DriverTrace on, and includes the contents of the
pDcb->Buffer in the display. Note that specific driver commands must be
Bit Position
CTDRV_INIT
CTDRV_OPEN
CTDRV_INIT_CHANNEL
CTDRV_INIT_UNIT
CTDRV_READ
CTDRV_WRITE
CTDRV_CONVERT
CTDRV_CANCEL
CTDRV_CPU
CTDRV_DATABASE
CTDRV_STOP_UNIT
CTDRV_STOP_CHANNEL
CTDRV_CLOSE
CTDRV_FORMAT
CTDRV_STATS
CTDRV_DEBUG
CTDRV_INFO
CTDRV_STATUS_UNIT
CTDRV_INIT_CARD
CTDRV_UPDATE_INFO
CTDRV_UI_READ
CTDRV_UI_WRITE
CTDRV_EXIT
CTDRV_LINE_STATUS
CTDRV_SEND_BREAK
CTDRV_REINIT_CHANNEL
CTDRV_SET_PARAM
CTDRV_GET_PARAM
00000001
00000002
00000004
00000008
00000010
00000020
00000040
00000080
00000100
00000200
00000400
00000800
00001000
00002000
00004000
00008000
00010000
00020000
00040000
00080000
00100000
00200000
00400000
00800000
01000000
02000000
04000000
08000000
803
804
Bit Position
CTDRV_OPEN_PORT
CTDRV_CLOSE_PORT
CTDRV_STATUS_DISCONNECT
10000000
20000000
40000000
[Debug]DrWatson
Starts DrWatson when CitectSCADA starts running (if DrWatson is not already
running). Note that DrWatson is not supplied with some versions of Windows.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 0
See Also
[Debug]Kernel
Debug Parameters
Determines whether the Kernel window is displayed when CitectSCADA starts
up.
Note the following:
You should only use the Kernel for diagnostics and debugging purposes,
and not for normal CitectSCADA operation.
You must restrict access to the Kernel. When you are in the Kernel, you can
execute any Cicode function with no privilege restrictions. You therefore
have total control of CitectSCADA (and subsequently your plant and
equipment).
Allowable Values:
[Debug]LogShutDown
Debug Parameters
This INI is only needed if ShutdownProtect is set to log the shutdown sequence.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 0
[Debug]Memory
Default Value: 0
See Also
[Debug]Menu
Debug Parameters
Note: This parameter is to be modified only by the Computer Setup Wizard.
Determines whether the Kernel option is displayed on the control menu of the
CitectSCADA runtime system. The Kernel option provides access to the Kernel
window when CitectSCADA is running.
Note the following:
You should only use the Kernel for diagnostics and debugging purposes,
and not for normal CitectSCADA operation.
You must restrict access to the Kernel. When you are in the Kernel, you can
execute any Cicode function with no privilege restrictions. You therefore
have total control of CitectSCADA (and subsequently your plant and
equipment).
Allowable Values:
805
806
Default Value: 0
See Also
[Debug]Shutdown
Debug Parameters
Note: This parameter is to be modified only by the Computer Setup Wizard.
Determines where the Shutdown option is displayed in the CitectSCADA
runtime system. The Shutdown option allows users to shut down the
CitectSCADA system from a graphics page. It can be set to display on the main
control menu (the parent graphics page), or only on graphics pages accessed
from the control menu (child graphics pages). You can also set the Shutdown
option to not display at all.
Allowable Values:
0 - (The Shutdown option is not displayed)
1 - (The Shutdown option is displayed on the control menu)
2 - (The Shutdown option is displayed only on child graphics pages)
Default Value: 1
See Also
[Debug]ShutDownProte
ct
Debug Parameters
Enables protection to veto a crash if the crash happens during shutdown. This
setting should only be used when recommended by Citect Support to diagnose
this type of issue.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 0
[Debug]SysErrDsp
Allows you to disable many system error logs and popup boxes. Users should
only disable this on a temporary basis if a popup is preventing CitectSCADA
from working.
Allowable Values:
1 - (Defaut)
Default Value: 1
[Debug]SysLogSize
Sets the size of the SYSLOG.DAT file. The SYSLOG.DAT file is a low-level
logging file used by CitectSCADA. This file is in the Windows directory.
CitectSCADA logs system-type errors and other debugging information to this
Debug Parameters
Device Parameters
The citect.ini file contains the following device parameters:
See Also
[Device]CreateHistoryFi
les
Default Value: 1
See Also
Device Parameters
807
808
[Device]DiscardSpoolO
nError
Discards or retains data in the spooling system. Normally, if a device fails, the
data in the spooling system is discarded. By disabling this option, the data is
retained.
Allowable Values:
0 - (Do not discard data)
1 - (Discard data)
Default Value: 1
See Also
[Device]ForceHistoryOp
enMode
Device Parameters
Determines whether device history files are maintained for data logged by
keyboard commands. By disabling this option, logged data associated with
keyboard commands will be appended to the current device file, irrespective of
the history setup of your device file.
Allowable Values:
Default Value: 1
See Also
[Device]FormLength
Device Parameters
The number of lines that are printed on a page before a new page (form feed) is
selected. This parameter only applies to a printer device.
Allowable Values: 0 to 512 (lines)
Default Value: 60
See Also
[Device]LptDosANSITo
OEM
Device Parameters
Indicates whether Windows ANSI characters are converted to OEM characters
when printing alarms and reports to LPTx.DOS. The conversion is required due
to differences between Windows and DOS character sets.
Allowable Values:
Default Value: 1
See Also
[Device]MaxSpool
Device Parameters
The maximum number of records that CitectSCADA retains in the spool buffer
for logging devices (before the log record is discarded).
[Device]SQLConnectOn
StartUp
Device Parameters
Keeps an SQL connection open after the first access. Normally when an SQL
device is opened, a connection is made that is closed after the report (or logging
action) has finished. Constantly opening and closing the SQL connection can
result in poor performance. Setting this parameter will cause CitectSCADA to
leave the channel open after the first connection. The connection is closed when
CitectSCADA is shut-down.
Allowable Values:
Default Value: 0
See Also
[Device]WatchTime
Device Parameters
The frequency (in milliseconds) that CitectSCADA checks devices for history
files and flushes logging data to disk.
Allowable Values: 1000 to 3600000 (milliseconds)
Default Value: 5000
See Also
Device Parameters
Dial Parameters
The citect.ini file contains the following dial parameters:
[Dial]CallerIDTimeout - The maximum time the I/O Server will wait for a
valid caller ID during dial in.
809
810
See Also
[Dial]CacheRefresh
[Dial]RingCount - The number of rings the I/O Server will wait before it
answers a call from a dialling I/O device.
[Dial]WatchTime - The period at which the I/O Server checks for I/O devices
to contact and checks for incoming calls from dialling I/O devices.
0 to disable
1 to enable
Default Value: 1
See Also
[Dial]CallerIDTimeout
Dial Parameters
The maximum time the I/O Server will wait for a valid caller ID during dial in.
Allowable Values: 1 to 43200 (secs)
Default Value: The value of MaxConnectionTime is converted to seconds and
inserted here
See Also
[Dial]ConnectionRetries
Dial Parameters
For PSTN connected devices - the number of times the I/O Server will try to dial
a dial-up I/O device before declaring that it is OFFLINE.
For non-PSTN connected devices - the number of times the I/O Server will try to
bring a device online before declaring that it is OFFLINE.
Note: If the modem is busy, the attempt will fail. If more than one modem is
configured on the I/O Server computer, a different one will be selected for the
[Dial]Debug
Dial Parameters
Enables/disables scheduled I/O device debugging.
Allowable Values:
0 - (Disable debugging)
1 - (Enable debugging)
Default Value: 0
See Also
[Dial]MaxConnectionTi
me
Dial Parameters
The maximum time a dial-up I/O device will stay connected (not including
permanent connections).
Allowable Values: 1 to 720 (mins)
Default Value: 20 (mins)
See Also
[Dial]MaxQueueTime
Dial Parameters
The maximum time a dial-up I/O device will remain in the dial queue, if no
modems (or physical ports in the case of non-PSTN connections) are available.
Allowable Values: 1 to 720 (mins).
Default Value: The value of MaxConnectionTime is inserted here.
See Also
[Dial]MaxTimeAfterDisc
onnect
Dial Parameters
The maximum number of seconds to wait following a disconnect request to
allow the dial system time to finish servicing requests. This setting allows time
for the dial up system to clear any outstanding requests, while ensuring a
connection does not remain open indefinetly if a problem is preventing queues
being emptied.
Allowable Values: 1 to 86400 (seconds)
Default Value: 120 (seconds)
See Also
[Dial]ModemRetryDelay
Dial Parameters
The minimum time to wait (in seconds) between disconnecting from a modem
and attempting to use the modem again.
811
812
[Dial]ReadThroughCach
e
Dial Parameters
Determines whether the I/O Server will read through the data cache while it is
connected to a remote I/O device.
Allowable Values: 0 or 1
Default Value: 0
See Also
[Dial]RingCount
Dial Parameters
The number of rings the I/O Server will wait before it answers a call from a
dialling I/O device.
Allowable Values: 1 to 10 (rings)
Default Value: 3
See Also
[Dial]WatchTime
Dial Parameters
The period at which the I/O Server checks for I/O devices to contact and checks
for incoming calls from dialling I/O devices. The WatchTime should be less than
your modem's inactivity timeout (if you are using dial back), otherwise the
modem will hang up and CitectSCADA will miss the call.
Allowable Values: 1 to 600 (seconds)
Default Value: 20
See Also
Dial Parameters
DisableIO Parameters
The citect.ini file contains the following DisableIO parameters:
See Also
[DisableIO]<Device
name>
[DisableIO]<Server
name>
DisableIO Parameters
Permanently disables all I/O devices associated with the named I/O Server for
the current session.
This means that the PLC Server I/O device off-line hardware error message
will not be seen for these devices when the I/O Server is not available.
The effect of this setting is therefore similar to issuing the Cicode function
IODevControl twice with Type set as 0 and 1 respectively and with the value of
the INI setting used as the Data argument (enable or disable).
<Server name> is the name of the server to be disabled.
Allowable Values: Valid I/O Server name
See Also
DisableIO Parameters
DiskDrv Parameters
The citect.ini file contains the following DiskDrv parameters:
See Also
[DiskDrv]UpDateTime
See Also
DiskDrv Parameters
DNS Parameters
The citect.ini file contains the following DNS parameter:
See Also
[DNS]<Server name>
813
814
D isp la y
C lie n t
S ITE _ S TB Y
A la rm R e p o rt
S e rv e r
A la rm R e p o rt
S e rv e r
Th re e S e rv e r se ssio n s
o n S ITE _ P R 1 :
S ITE _ P R 1 A la rm
S ITE _ P R 1 R e p o rt
S ITE _ P R 1 Tre n d
S in g le E n try
p o in t to
C ite c t S y ste m
In te rn e t D isp la y
C lie n t
In the example above, the three server sessions running on the Alarm Report
Server SITE_PR1 have standard names assigned by CitectSCADA (i.e. the server
name followed by 'Alarm', 'Report' or 'Trend').
The [DNS] entry of the Display Client's citect.ini file (below) contains entries
that associate the server session names with TCPIP addresses. This allows an
Internet Display Client access to the information from these sessions.
[DNS]:
SITE_PR1Alarm = 203.19.130.4
SITE_PR1Report = 203.19.130.4
SITE_PR1Trend = 203.19.130.4
DNS Parameters
Event Parameters
The citect.ini file contains the following event parameters:
See Also
[Event]InhibitEvent
[Event]WatchTime - The time (in seconds) between checks for due events.
See Also
[Event]Name
Event Parameters
The classes of events to be processed. If no Name is specified, all events that
have "Global" or nothing in the Event Name field are processed.
Note: This parameter is to be modified only by the Computer Setup Wizard
Allowable Values: List of events (comma separated)
See Also
[Event]Server
Event Parameters
Determines whether this computer is an Events Server.
This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values:
1 - (Events Server)
Default Value: 0
815
816
[Event]WatchTime
Event Parameters
The time (in seconds) between checks for due events. You can set this parameter
to a large value to conserve CPU time; however you should ensure that any Time
and Period-based events in the project are a direct multiple of the WatchTime,
otherwise they will not be checked.
Allowable Values: 1 to 36000 (seconds)
Default Value: 1
See Also
Event Parameters
Font Parameters
The citect.ini file contains the following font parameters:
See Also
[Font]Echo
[Font]Echo - The text font used to echo keyboard commands on the screen (if
they are set to echo).
[Font]General - The text font used for general text display (other than
keyboard commands, error messages, and prompt messages).
[Font]Print - The text font used to print data to the printer device.
See Also
[Font]Error
Font Parameters
The text font used to display an error message at an animation point.
Allowable Values: Any font that exists in the project.
Default Value: DefaultFont
See Also
[Font]General
Font Parameters
The text font used for general text display (other than keyboard commands,
error messages, and prompt messages).
[Font]Print
Font Parameters
The text font used to print data to the printer device.
Allowable Values: Any font that exists in the project.
Default Value: PrintFont
See Also
[Font]Prompt
Font Parameters
The text font used to display a prompt message at an animation point.
Allowable Values: Any font that exists in the project.
Default Value: DefaultFont
See Also
Font Parameters
General Parameters
The citect.ini file contains the following general parameters:
817
818
See Also
[General]AdvancedDDE
Poll
See Also
[General]BadOptimise
General Parameters
Determines whether strings are replaced with labels on compile (this only
applies to strings that are set to be converted to another type on compile, such as
strings passed to functions expecting INTs or REALs, strings assigned to
variables, etc.) In pre V5.10 versions of CitectSCADA, such strings were replaced
with labels if an equivalent label was defined. This problem has now been
resolved. Unfortunately, some users may have exploited this loophole. For
example, it was used to pass colors (e.g. "Black", "White", etc.) as function
arguments where an INT or a REAL was expected. Because previous versions of
CitectSCADA expanded the colors as labels, this caused no problems. Now,
however, these arguments would be regarded as strings.
This parameter allows you to specify that such strings are treated only as strings
or whether they are expanded as labels. Alternatively, you can specify that a
compile error is generated when one is found.
Note: When using this parameter you should turn off incremental compile in the
Citect Project Editor - Tools - Options Form.
Allowable Values:
Default Value: 0
See Also
[General]BufferIO
General Parameters
The size of the compiler's file buffer.
Allowable Values: 0 to 32000
819
820
[General]CheckAddress
Boundary
General Parameters
Determines whether the compiler checks for correctly-aligned I/O device
variables. Each analog variable in an I/O device usually occupies a word location
(16 bits wide). If the first word is V1, the next is V2, V3, V4, and so on. With some
I/O devices, you can access two words as a long or real value (32 bits wide). The
first long will be V1 and the next V3, V5, V7, and so on.
For CitectSCADA to read these variables correctly, all double-register variables
must be aligned on the same boundary, either an even or odd boundary. When
CitectSCADA compiles your project and finds a double-register variable, it
remembers which boundary it is on and checks that all other double register
variables are on the same boundary. So, if CitectSCADA finds a double register
variable on address V5, CitectSCADA checks that all other double register
variables are also on odd boundaries.
The CitectSCADA compiler displays the "Address on bad boundary" message if
the address of a long or real variable is not aligned correctly.
Allowable Values:
0 - (Disable checking)
1 - (Enable checking)
Default Value: 1
See Also
[General]CitectRunning
Check
General Parameters
Checks if a project is currently running on the local machine when a compile is
triggered. If a project contains a tag-based driver and is currently in runtime
when a compile is attempted, CitectSCADA will stop the compiler and generate
an error in the error database noting that Citect32.exe was still running. This is to
avoid circumstances that may lead to mismatched tags within a distributed
project.
Warning! Adjusting this parameter may lead to discrepancies in your tag data.
You need to consider and fully understand the issues raised in the topic
Validating distributed project data for tag-based drivers before you should
disable this feature.
Allowable Values:
Default Value: 1
See Also
General Parameters
[General]Ctl3D
Determines whether dialog boxes in the runtime system display with a threedimensional effect.
Allowable Values:
Default Value: 1
See Also
[General]DebugInfo
General Parameters
Determines whether symbolic information is included in the compiled Cicode.
Symbolic information is used to debug Cicode. The performance gained by
turning this option off is only about 1%.
Allowable Values:
Default Value: 1
See Also
[General]DisablePlotSet
upForm
General Parameters
The DisablePlotSetupForm parameter works in conjunction with the
DisplayForm argument of the TrnPrint() function. It determines whether the Plot
Setup form displays when TrnPrint() is called, but it will only take effect if
TrnPrint() is called, and the DisplayForm argument is set to -1.
This parameter can be set from the Plot Setup form, by clicking in the Do not
display this form next time check box.
Allowable Values:
Default Value: 0
See Also
[General]DisableRemot
eBlocking
General Parameters
Disables the blocking of remote I/O devices.
To optimize data transfer, multiple requests to an I/O device are blocked into one
single request. However, some blocked requests fail to be satisfied from the I/O
Server data cache, resulting in variable tags being displayed as #WAIT.
To disable blocking and send client requests for data individually, set this
parameter to 1.
Allowable Values:
821
822
Default Value: 0
See Also
[General]FormatCheck
General Parameters
Determines whether alarm values are truncated when they are longer than the
field they are to display in (as specified in Alarm Categories). For example, if, in
your Alarm Format, you allot 12 characters to the Analog Value field (i.e.
{Value,12} ), the alarm page will display up to 12 characters of the value. If the
value happens to be longer than 12 characters, it will be truncated or replaced
with the #OVR ("overflow of format width") error.
Allowable Values:
Default Value: 1
See Also
[General]InfoDestroy
General Parameters
Determines whether the VARIABLE.DBF file is closed automatically after a call
to the DspInfoField() function. You can disable this parameter for optimisation,
but you must call the DspInfoDestroy() function to close the VARIABLE.DBF
file. If the VARIABLE.DBF file is not closed, the CitectSCADA compiler will fail
to open VARIABLE.DBF file.
Allowable Values:
Default Value: 1
See Also
[General]LockDelay
General Parameters
Sets the time delay in millisecond between file operation retries. This parameter
is ignored if [General]LockRetry is set to 0. Note that if you set this parameter to
a high value, you could reduce performance.
Allowable Values: 0 to 100
Default Value: 0
See Also
[General]LockRetry
General Parameters
The number of times to retry an operation that fails because a file is locked.
Some networks do not unlock files as quickly as you would expect, causing the
[General]LongFilename
General Parameters
Enables long filename support. With this parameter set, CitectSCADA project
names and page names can be up to 64 characters in length, and filenames can
be up to 254 characters, including the path.
Allowable Values:
1 - (to enable)
0 - (to disable)
Default Value: 1
Note: If you disable long filename support, you must ensure that the path of the
directory where CitectSCADA is installed uses short filenames and does not
include any spaces. Long file names in the path will be invalid, and you will be
unable to create or save projects to the directory.
See Also
[General]OSErrors
General Parameters
Enables/disables CitectSCADA trapping of operating system errors.
CitectSCADA traps all disk, network, floating-point, and other system errors. If
you disable this parameter, CitectSCADA will not trap these errors and could
abort if an error occurs. Do not disable OSErrors unless advised to do so by
Citect support.
Allowable Values:
0 - (Disable checking)
1 - (Enable checking)
Default Value: 1
See Also
[General]PasswordExpi
ry
General Parameters
Determines how long your user and operator passwords will take to expire.
Whenever you create a user and assign a password, or edit an existing
password, CitectSCADA time and date stamps this change. A user will be
permitted to log in whilst the current time and date is not later than the stamped
time and date plus the Password Expiry number of days.
823
824
[General]PointLimitMsg
General Parameters
Determines whether CitectSCADA will shutdown when the I/O point limit is
exceeded. When set to 0 (zero), CitectSCADA will produce a hardware error and
stop the point limit from being exceeded - this is the recommended mode to use
on a running plant. When set to 1 (one), CitectSCADA will display a message
that the point limit has been exceeded and then shutdown - use this mode only
when testing.
Allowable Values:
Default Value: 0
See Also
[General]PrinterColour
Mode
General Parameters
The PrinterColourMode parameter works in conjunction with the iModeColour
argument of the TrnPrint() function. It determines whether the trends printed
using TrnPrint() will be black and white, or color, however, it will only take
effect if the iModeColour argument is set to -1.
Allowable Values:
0 - (color)
Default Value: 1
See Also
[General]RegionalNumb
ersFormat
General Parameters
Determines how CitectSCADA outputs data containing decimal numbers. When
set to 1, CitectSCADA uses the decimal separator from the Windows Regional
Numbers setting. When set to 0, the hard coded symbol (.) is used.
Allowable Values: 0, 1
Default Value: 1
See Also
[General]ServerMonitori
ngPeriod
General Parameters
Defines how often a Alarm Client will issue an additional transaction to its
server to monitor the health of the active server. If the transaction fails and
[General]ShareFiles
General Parameters
Enables/disables the opening of projects by the compiler in Shared Mode. If you
enable Shared Mode, you will increase the compilation time, but you are
allowed to compile while other users have the project open.
Allowable Values:
0 - (Exclusive)
1 - (Shared)
Default Value: 0
See Also
[General]ShowDriverErr
or
General Parameters
Determines whether an error dialog displays when an internal driver error
occurs.
Allowable Values:
Default Value: 0
See Also
[General]Stack
General Parameters
The size of the CitectSCADA general-purpose stack. Increase this parameter if
CitectSCADA aborts with a "General stack overflow" error. This stack is different
from the Cicode Stack. If a "Cicode stack overflow" hardware error is displayed,
increase the value of the Code Stack parameter.
Allowable Values: 5000 to 32000
Default Value: 32000
See Also
[General]StartDelay
General Parameters
Delays the startup of CitectSCADA for a specified period (in seconds). If the
CitectSCADA runtime application is started, it will not actually run until the
delay period ends. This allows you to delay CitectSCADA startup if it must wait
for some other process to start/complete.
825
826
[General]SymbolicInfo
General Parameters
Enables/disables AN help information. See the InfoForm() Cicode function for
information about AN help information. CitectSCADA will run faster and use
less memory if AN help information is disabled.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 1
See Also
[General]TagDB
General Parameters
Determines whether the Variable Tags database is loaded when the project is
compiled. The Variable Tags database must be loaded if you are using the
TagRead() and TagWrite() functions, if an external application will read or write
variable data at run time (using inbuilt DDE, not the DDE Cicode functions), or
if you want to use Super Genies.
If you do not need to use any of these features, you can save memory by
disabling this parameter. Because all the variable information must be loaded
into memory, this parameter can use a large amount of memory. The amount of
memory used by one tag is 30 bytes + the length of the name + 1. If you have
10,000 tags with an average name length of 16 characters, this parameter will use
(30 + 16 + 10) x 10,0000 = 470,000 bytes. This memory usage would only be a
problem if you are low on memory or have many variables.
The CitectSCADA Compiler also looks at this parameter to build the VARIABLE
runtime data. If you enable this parameter, you should force the compiler to do a
full compilation, i.e. you should turn off incremental compilation.
Allowable Values:
Default Value: 1
See Also
[General]TagStartDigit
General Parameters
Allows you to use tags that have a number as the first digit.
Using a number as the first digit of a tag is not a good engineering practice. Tags
starting with numbers are not supported by modern programming languages
and they are not allowed in the industrial control systems standard IEC 1131-3.
is hex number
is binary number
is octal number
is floating point number
When [General]TagStartDigit is set to 0 (zero), the above tags are treated as valid
numbers.
However, if you have [General]TagStartDigit set to 1, and you have these types
of numbers in your project, you must observe the following conventions:
Because of the above problems you cannot define tags which look like valid
numbers. For example 0x123 will be treated as a number, not a tag. You should
always use upper case for tags starting with a number and the tag must contain
at least one alpha (A..Z) or underscore (_) character.
Also you cannot define numbers which look like tags. When TagStartDigit=0,
then 0X123 will be treated as a hex number. When [General]TagStartDigit=1,
0X123 will be treated as a tag. This can cause problems if you have existing
cicode from older projects which has numbers defined this way. When you
switch this option on, you may find you will get the "Tag not found" compiler
827
828
Default Value: 0
See Also
[General]TrnPrinter
General Parameters
The default printer port used in the TrnPrint() function.
Allowable Values: Any valid printer port
Default Value: LPT1:
See Also
[General]Verbose
General Parameters
Enables/disables the display of the startup dialog box, which shows the opening
runtime databases and other information.
Allowable Values:
1 - (Display)
Default Value: 1
See Also
General Parameters
Internet Parameters
The citect.ini file contains the following internet parameters:
See Also
[Internet]Client
[Internet]LogFile - The file to which the FTP logs will be saved (used only by
the Internet Server).
[Internet]Port - The FTP port to be used for communicating with the FTP
server (when running your project over the Internet).
See Also
Internet Parameters
829
830
[Internet]Display
[Internet]FTPTimeout
Internet Parameters
The inactivity timeout on the FTP server. This is the amount of time the Internet
Display Client can be idle before the Internet Server disconnects it.
Allowable Values: 0 to 10000 (seconds)
Default Value: 900
See Also
[Internet]FTPWatchTime
Internet Parameters
CitectSCADA will monitor the status of the FTP server, so that a hardware alarm
can be raised if the server is terminated. This paramter determines how often the
status of FTP server is checked.
Allowable Values: 1 to 65535 (seconds)
Default Value: 60
See Also
[Internet]IPAddress
Internet Parameters
This parameter provides an Internet Display Client with the IP address of a
CitectSCADA Internet Server so that automatic connection can take place at
startup. To achieve this outcome, you will also need to set the parameters
[Internet]Password and [Internet]ShowSetupDialog.
Note: This parameter must be set in the citect.ini file of the IDC computer.
Allowable Values: a valid IP address
Default Value: (no default)
See Also
[Internet]LogFile
Internet Parameters
The file to which the FTP logs will be saved (used only by the Internet Server).
All data sent to the Internet Server by the Internet Display Client is logged to this
file.
Allowable Values: Any valid directory except for \DATA, \USER, \BIN, and
\ZIP directories.
Default Value: No log file
See Also
[Internet]Manager
Internet Parameters
The password for Manager Clients (when running your project over the
Internet).
[Internet]Password
Internet Parameters
This parameter provides an Internet Display Client with the required password
for a CitectSCADA Internet Server so that automatic connection can take place at
startup. To achieve this outcome, you will also need to set the parameters
[Internet]IPAddress and [Internet]ShowSetupDialog.
Note: This parameter must be set in the citect.ini file of the IDC computer.
Allowable Values: A valid password
Default Value: (no default)
See Also
[Internet]Port
Internet Parameters
The FTP port to be used for communicating with the FTP server (when running
your project over the Internet). This parameter must be set (to the same value) on
both the Internet Server and the Internet Display Client.
Although the standard FTP port is port 21, you can use any other port. However,
no matter which port you choose, the port before it must also be available. For
example, if you use port 3000, then port 2999 must also be available. Also, if you
are using a firewall, you must ensure that both these ports are unblocked.
Allowable Values: 21 or 1024 to 10000
Default Value: 21
See Also
[Internet]Redundancy
Internet Parameters
Controls whether the CitectSCADA Internet Display Client (IDC) downloads
information stored in the Primary Server's citect.ini file in order to configure
server redundancy settings.
FTP Server redundancy can be configured in the IDC by setting [DNS] and
[CLIENT] parameters in the citect.ini file on the Primary Server machine.
When this information is invalid however (for example when dealing with
multihomed machines with separate internal and external IP addresses), the
[INTERNET]Redundancy parameter should be set to 0 and the [DNS] and
[CLIENT] parameters manually configured.
Allowable Values:
0 - (IDC uses existing redundancy information)
1 - (IDC downloads redundancy information from the citect.ini file)
Default Value: 1
831
832
[Internet]RunFTP
Internet Parameters
Determines whether the CitectSCADA FTP server will be run.
Allowable Values:
0 - (FTP server will not be run)
1 - (FTP server will be run)
Default Value: 1 if the parameter [Internet]Server is set, otherwise 0.
See Also
[Internet]SearchCurrent
Path
Internet Parameters
This parameter determines where an Internet Display Client (IDC) will search
when looking for updated files on an CitectSCADA Internet Server. This search
occurs at a period defined by [Internet]UpdateTime.
By default, the IDC will only search the project directory. If you set this
parameter to 1, the Display Client will also search the bin directory looking for
the required files. Note, however, that this behaviour may affect the operation of
the functions DspFileSetName() and/or DspFile().
Allowable Values:
0 - the display client will only search the project directory for updated files
1 - the display client will not be restricted to the project directory when
searching for updated files on the Internet Server.
Default Value: 0
See Also
[Internet]Server
Internet Parameters
Determines whether the computer is an Internet Server.
Allowable Values:
0 - (Computer is not an Internet Server)
1 - (Computer is an Internet Server)
Default Value: 0
See Also
[Internet]ShowFileFTPD
lg
Internet Parameters
Determines whether to display the file transfer dialog when files are being
downloaded to the Internet Display Client during runtime.
Allowable Values:
0 - (file transfer dialog not displayed)
1 - (file transfer dialog displayed)
[Internet]ShowSetupDlg
Internet Parameters
Determines whether or not a setup dialog appears when an Internet Display
Client (IDC) is launched. By default, this dialog is displayed so that the user is
prompted to input the connection details for the CitectSCADA Internet Server
and the required login information. However, if you've configured your IDC to
automatically connect to a CitectSCADA Internet Server at startup (using the
parameters [Internet]IPAddress and [Internet]Password) you should switch this
feature off.
Note: This parameter must be set in the citect.ini file of the IDC computer.
Allowable Values:
0 - (setup dialog not displayed)
1 - (setup dialog displayed)
Default Value: 1
See Also
[Internet]UpdateTime
Internet Parameters
The period at which CitectSCADA compares the files on the Internet Server with
the downloaded files on the Internet Display Client. If a file has been changed
since the last update, it will be copied to the Internet Display Client.
Set this parameter on the Internet Display Client only.
Allowable Values: 0 to 10000 (minutes)
Default Value: 1440
See Also
[Internet]ZipFiles
Internet Parameters
Set this parameter on the Internet Display Client to specify whether files
downloaded to the Internet Display Client will be zipped before download.
Set this parameter to 0 (zero) if you are not using the CitectSCADA FTP server.
Allowable Values:
Default Value: 1
See Also
Internet Parameters
833
834
Intl Parameters
These parameters set the format of the time and date display. If you include
these settings, they will override the Windows default time and date display
(that are set using the Windows Control Panel).
See Also
[Intl]bDecimal
[Intl]s1159 - If a 12 hour clock is set (see [Intl]iTime), this parameter sets the
format of the morning extension.
[Intl]s2359 - If a 12 hour clock is set (see [Intl]iTime), this parameter sets the
format of the evening extension.
Default Value: 1
See Also
[Intl]iDate
Intl Parameters
Determines the order of months, days, and years in CitectSCADA dates. This
parameter does not control how many characters are displayed (this is done
through the control panel), it merely orders the display.
Allowable Values:
0 - (order = month, day, year)
1 - (order = day, month, year)
2 - (order = year, month, day)
[Intl]iTime
Intl Parameters
Sets the clock format.
Allowable Values:
[Intl]s1159
Intl Parameters
If a 12 hour clock is set (see [Intl]iTime), this parameter sets the format of the
morning extension.
Allowable Values: Any ASCII string
Default Value: AM
See Also
[Intl]s2359
Intl Parameters
If a 12 hour clock is set (see [Intl]iTime), this parameter sets the format of the
evening extension.
Allowable Values: Any ASCII string
Default Value: PM
See Also
[Intl]sDate
Intl Parameters
Sets the delimiter for date display.
Allowable Values: Any ASCII character
Default Value: /
See Also
[Intl]sDecimal
Intl Parameters
Sets the delimiter for the decimal separator.
Allowable Values: Any ASCII character
Default Value: . (period character)
See Also
[Intl]sTime
Intl Parameters
Sets the delimiter for time display.
Allowable Values: Any ASCII character
Default Value: colon (:) character
835
836
Intl Parameters
IOServer Parameters
The citect.ini file contains the following IOserver parameters:
See Also
[IOServer]AlwaysCallSt
opChannel
[IOServer]SaveFile - The indicative name and path of the local I/O device
persistence cache files on an I/O Server.
Default Value: 0
837
838
[IOServer]AlwaysCallSt
opUnit
Default Value: 0
Note: Setting this parameter will always force a StopUnit provided the InitUnit
function has been called at some stage prior.
See Also
[IOServer]AsyncConnec
t
IOServer Parameters
Determines whether CitectSCADA will follow its default behavour and attempt
to connect to all configured I/O servers on start-up.
When the AsynConnect parameter is set to 1, CitectSCADA will defer the
connection attempt for each I/O Server until that I/O Server is required.
This option may be required in order to speed up the start-up process on sites
which have many I/O Servers that do not yet exist.
Allowable Values:
Default Value: 0
See Also
[IOServer]BlockWrites
IOServer Parameters
Determines whether CitectSCADA will try to block optimize writes to I/O
devices. This includes blocking together writes to consecutive memory locations
into a single large write, and ignoring unnecessary writes to the same memory
location (i.e. when the data is the same).
Allowable Values:
0 - (Blocking OFF)
1 - (Blocking ON)
Default Value: 1
[IOServer]CacheDebug
IOServer Parameters
Enables/disables I/O Server cache debugging.
Allowable Values:
0 - (Disable debugging)
1 - (Enable debugging)
Default Value: 0
See Also
[IOServer]CacheIgnore
Driver
IOServer Parameters
Ignore the request from the protocol driver not to cache the remote I/O device.
Allowable Values:
Default Value: 0
See Also
[IOServer]CacheOptMo
de
IOServer Parameters
The intended use of this parameter is to reduce #COMs when using dialup or
scheduled devices. The #COM is often a result on how tags are blocked together
in the IOServer.
This is the global INI setting. This setting is allowed at a per device level by :
[<unitname>] CacheOptMode = x
By default, the IOServer only searches for tag data requests to be within or equal
to a single cached tag set; for example, cache has tag address points 1 to 10, and
then 11 to 20, and a request wants addresses 5 to 6, this is permitted. If, however,
the request was for items 9 to 11, the system would not return a match and
would request a read from the driver. For a disconnected dialup unit, this would
cause a #COM or #WAIT.
CacheOptMode Values are :
1 - First come first served - Tells the IOServer to search through all cached
ponts looking for the data, once it is found return.
2 - Scan all cache for latest entries - Forces the scan to look through ALL
cached items to find data which is the MOST recent.
+8 - Allow behaviour on all devices, by default the settings above only apply
to remote units.
839
840
+16 - Allow written data not to remove cache item and update value on
return, e.g. 1 to 10 in the cache, write to 8. The default behavior would be to
remove the whole cache item so that a fresh read of 1 to 10 would be needed
on a write to 8. With +16 added, then 1 to 10 stays in the cache, and item 8
would be updated on the REPLY from the driver.
[IOServer]CacheReadA
head
Determines if read ahead caching is enabled on the I/O Server. When read ahead
caching is enabled, the I/O Server will try to read any I/O device data which is
coming close to cache 'timeout' time. The I/O Server will only read this data if
the communication channel to the I/O device is idle - to give higher priority to
other read requests.
Allowable Values:
Default Value: 1
See Also
[IOServer]CancelTimeo
ut
IOServer Parameters
Determines how long the I/O server will wait on a reply from a driver before
giving up and canceling the request. This timeout can be used to diagnose driver
"not responding issues" as directed by Citect Support.
Allowable Values: 1 to 1000000 (in seconds)
Default Value: 300 (5 minutes)
[IOServer]DebugLogTag
Handshake
Enables detailed tag handshake logging during tag validation. This allows you
to view detailed individual results for each variable tag as they are validated by
system checks. The volume of tags that are processed per check request can be
configured via the parameter [IO Server]MaxTagHandshakeSize.
Allowable Values:
Default Value: 1
See Also
[IOServer]HeartTime
IOServer Parameters
The period at which the I/O Server sends out heartbeats (to the clients) on the
status of each I/O device.
[IOServer]HWAlarmOnD
eviceDisable
IOServer Parameters
Determines whether hardware alarms for disabled IO devices will be displayed
or suppressed.
Allowable Values:
Default Value: 1
Note the following:
See Also
[IOServer]InitMsg
On the Citect machine that is configured as a Display Client only, Citect will
display an initial hardware alarm once to indicate that the device state is
offline. Citect will not display additional hardware alarms for disabled
devices if the parameter [IOSERVER]HWAlarmOnDeviceDisable = 0 is set.
IOServer Parameters
Determines whether communication information is displayed in the Kernel (at
startup).
Allowable Values:
0 - (Disable)
Default Value: 0
See Also
IOServer Parameters
841
842
[IOServer]LogTagHands
hake
Default Value: 0
See Also
[IOServer]MaxTagHand
shakeSize
IOServer Parameters
Allows you to set the maximum size of bytes for a tag validation request when
handshaking.
Default Value: 4096
See Also
[IOServer]Name
IOServer Parameters
The name of the default I/O Server. The I/O Server will communicate with all of
its configured I/O devices.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values: Any valid name
Default Value: IOServer
See Also
[IOServer]Redundancy
Debug
IOServer Parameters
Enables/disables I/O device redundancy debugging.
Allowable Values:
0 - (Disable debugging)
1 - (Enable debugging)
Default Value: 0
See Also
[IOServer]SaveFile
IOServer Parameters
The indicative name and path of the local I/O device persistence cache files on an
I/O Server.
Allowable Values: Any valid directory.
Default Value: The current project directory.
See Also
[IOServer]SaveNetwork
IOServer Parameters
The UNC name of the Persistence Cache file on this I/O Server.
Allowable Values: Any valid UNC filename.
[IOServer]SavePeriod
IOServer Parameters
Determines how often the Persistence Cache is saved to hard disk. To disable
periodic saving of the cache, set this parameter to 0.
Allowable Values: 10 to 3600 (seconds)
Default Value: 600
When SavePeriod is set to 10 seconds or longer, the Persistence Cache for a given
device is saved according to the following rules:
If the device is not a scheduled device, the cache will be saved every
[IOServer]SavePeriod seconds.
These rules ensure that the cache is only saved to disk when new device data has
been read by the I/O Server.
See Also
[IOServer]SaveTime
IOServer Parameters
Determines how much of the data cache on the I/O Server will be saved to disk
as the Persistence Cache (i.e. which I/O devices data will be saved in the
Persistence Cache, and which wont). If the I/O device's cache time is greater
than the time entered here, the data cache for the I/O device is saved to disk. This
save occurs every [IOServer]SavePeriod.
Allowable Values: 1 to 3600 (seconds)
Default Value: 3
See Also
[IOServer]Server
IOServer Parameters
Determines whether this computer is an I/O Server.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values:
0 - (Not an IOServer)
1 - (IOServer)
Default Value: 0
843
844
[IOServer]TagAddressN
oCase
IOServer Parameters
Determines if case-sensitivity needs to be considered when validating tag
addresses for the implementation of Object IDs and the variables database.
Allowable Values:
Default Value: 0
See Also
[IOServer]WatchDog
IOServer Parameters
Determines whether CitectSCADA periodically checks the communication
connection to your standby I/O devices. If you set this parameter to 1,
CitectSCADA will check the Standby devices every watch time (as specified by
the WatchTime parameter of the device driver). If you set this parameter to 0,
this periodic checking is disabled, but CitectSCADA will still communicate with
the I/O device on startup to verify that the connection is valid.
Note: If you disable periodic checking, you will not receive a hardware error if
the standby I/O device fails when CitectSCADA is communicating with the
Primary.
Allowable Values:
Default Value: 1
See Also
[IOServer]WatchDogPri
mary
IOServer Parameters
Determines whether CitectSCADA periodically checks the communication
connection to your primary I/O devices. If you set this parameter to 1,
CitectSCADA will check the Primary devices every watch time (as specified by
the WatchTime parameter of the device driver). If you set this parameter to 0,
you will not be notified of a communication faliure until a read to the device is
attempted.
Note: If you disable periodic checking, and no read activity is occuring, you will
not receive a hardware error if the primary I/O device fails.
Allowable Values:
0 - disables Watch Dog functionality for primary I/O devices
1 - enables Watch Dog functionality for primary I/O devices
Default Value: 0
IOServer Parameters
Kernel Parameters
The citect.ini file contains the following kernel parameters:
See Also
[Kernel]BufPoolProtect
Default Value: 0
See Also
[Kernel]Idle
Kernel Parameters
Determines how many of the CitectSCADA Kernel tasks to run before releasing
the CPU to other Windows programs. CitectSCADA will release the CPU to
other Windows programs if it runs out of its own tasks. (Note that if you
increase this parameter, you will reduce CPU resources for all other Windows
programs running at the same time.)
Default Value: 10
See Also
[Kernel]Queue
Kernel Parameters
The number of Kernel queues. Increase this parameter if an "Out of Kernel
Queues" error message displays.
Allowable Values: Any value greater than or equal to 150
845
846
[Kernel]Retries
Kernel Parameters
The number of Kernel queues. Increase this parameter if an "Out of Kernel
Queues" error message displays.
Allowable Values: 1 to 10
Default Value: 3
[Kernel]Task
The number of Kernel tasks. Increase this parameter if you get an "Out of Kernel
Tasks" error message.
Allowable Values: Any value greater than or equal to 50
Default Value: 256
See Also
[Kernel]Watchdog
Kernel Parameters
When set a task checks if the CitectSCADA kernel is working (i.e., CitectSCADA
is not locked up) and terminates CitectSCADA runtime if the timeout
([Kernel]WatchdogTime) has been exceeded a number of retries
([Kernel]Retries).
This is a safety measure to allow redundancy from other I/O servers to be
enabled if the Primary I/O server gets locked (for example, by incorrect user
Cicode).
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 0
[Kernel]WatchdogTime
[Kernel]WinShutdown
Kernel Parameters
Keyboard Parameters
The citect.ini file contains the following keyboard parameters:
See Also
[Keyboard]ButtonOnlyL
eftClick
See Also
[Keyboard]ButtonRaw
Keyboard Parameters
Puts a string (ASCII character code) into the key command line when a button is
pressed.
847
848
[Keyboard]EchoPopUp
Keyboard Parameters
Determines whether the keyboard input on a graphical object is echoed in a tips
popup. This allows keyboard feedback local to the input point. Keyboard
commands are echoed to the prompt line regardless of the value of this
parameter.
Allowable Values:
Default Value: 1
See Also
[Keyboard]LogExtende
dDate
Keyboard Parameters
Determines whether the short (dd/mm/yy) or extended (dd/mm/yyyy) date
format is used (in command logs) when interpreting the {DATE,n} log format.
Allowable Values:
Default Value: 1
See Also
[Keyboard]NonPrint
Keyboard Parameters
Enables/disables the display of the non-print character (specified in the
[Keyboard]NonPrintChar parameter). If you enable this parameter, the nonprint character will be displayed when the key is pressed. If you disable this
parameter, the non-print character will not display.
Allowable Values:
0 - (Enable)
1 - (Disable)
Default Value: 0
See Also
[Keyboard]NonPrintCha
r
Keyboard Parameters
The ASCII character code to display when a key that does not have a displayable
character or Key Name is pressed.
Allowable Values: 0 to 255
Default Value: 63 ('?' character)
[Keyboard]Type
Keyboard Parameters
The keyboard type. CitectSCADA will use keys of this type in the project for all
commands. All other keys except Type 0 are ignored - Type 0 is used for all
keyboards.
Allowable Values: 0 to 255
Default Value: 0
See Also
Keyboard Parameters
LAN Parameters
The citect.ini file contains the following LAN parameters:
[LAN]LanA - Defines the protocol stack that CitectSCADA uses for NetBIOS
communication.
849
850
See Also
[LAN]BackOffTime
See Also
[LAN] Bridge
LAN Parameters
Determines the bridge level (in a CiNet network).
Allowable Values: 0 to 20
Default Value: 2
See Also
[LAN]CancelOnClose
LAN Parameters
Do not set this parameter unless advised by Citect Support. This parameter
should be set to 0 by users with Novell NetBIOS emulator problems.
0 - (Disable)
1 - (Enable)
Default Value: 1
See Also
[LAN]Delay
LAN Parameters
The period (in milliseconds) to wait to optimize a send message - before sending
the message. CitectSCADA will hold back the message for this delay time, so if
another message is to be sent, it can be sent in the same network packet. This
parameter adds a small delay, but it can reduce network traffic significantly, and
so make the total response time faster.
Allowable Values: 0 to 2000 (milliseconds)
Default Value: 10
See Also
[LAN]Disable
LAN Parameters
Enables/disables CitectSCADA from the LAN. If CitectSCADA is disabled, it
does not access the LAN. You can set this parameter if CitectSCADA is running
as a standalone computer on a network, or if a network is not used. If
CitectSCADA does not find NetBIOS, it displays the error message "NetBIOS
Not Found" at startup. You can disable the LAN to stop this error message.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values
0 - (Enable)
1 - (Disable)
Default Value: 0
Note: The citect.ini file supplied with CitectSCADA has the value for this
parameter set to 1 (disabled). The disabled setting is for use with non-networked
systems. To use CitectSCADA on a LAN, you must set this parameter to 0
(enabled).
See Also
[LAN]GroupName
LAN Parameters
Determines whether CitectSCADA uses the group name 'CITECT STATION50'
or the computer name specified by the [Lan]Node parameter. The name
specified by the [Lan]Computer parameter must be unique on a network,
otherwise you will get the error message "Cannot add Netbios Name <name>" if
two computers start up with the same name.
Allowable Values
851
852
Default Value: 1
See Also
[LAN]KillPiggyBackAck
LAN Parameters
Controls whether CitectSCADA will try to optimize network protocols which
support piggy back ack.
Piggy back ack is a feature used by some networks to improve the performance
and reduce the network bandwidth of file server based protocols. However, this
feature interferes with CitectSCADA's real time operation. When this parameter
in enabled (default) CitectSCADA will send extra data packets over the network
to disable the effect of piggy back ack.
Piggy back ack is a feature of all Microsoft's network protocols. If you know
your network protocol does not do piggyback ack you may disable this feature
to save a small amount of network bandwidth.
Allowable Values
0 - (Normal)
Default Value: 1
See Also
[LAN]LanA
LAN Parameters
Defines the protocol stack that CitectSCADA uses for NetBIOS communication.
This parameter can be used to enable LAN redundancy, as it allows you to
implement more than one protocol stack simultaneously. This includes using
more than one protocol on the same LAN, for example, when you want to run a
combination of CitectSCADA systems on a LAN and WAN.
The values you apply to this parameter need to reflect the combination of
protocol stacks you would like to use for NetBIOS communication. If the
computer has more than one network adapter available, they also need to
indicate which adapter you would like to use.
Windows defines all the possible protocol stack/adapter options a computer can
support as a series of LanA values. For example, if you have two network
adapters and two NetBIOS transports installed (e.g. IPX/SPX and NETBEUI),
your computer will have four LanA values.
To apply appropriate values to the CitectSCADA LanA parameter, you need to
determine what your computers LanA values represent. For Windows NT,
LanAs are configurable through the Control Panel. Choose the Network applet,
[LAN]LocalNet
LAN Parameters
Improves the performance of cluster switching on a client which is also a server.
Using the Cicode function ClusterSetName, a display client can switch from
displaying information from one CitectSCADA server to display information
from another CitectSCADA cluster server. If you want to do this on a client
which is also a server, set this parameter to 1.
This enables direct communication between client and server, bypassing the
network stack, and improving performance on a local connection. With this
parameter set to 0, CitectSCADA establishes client/server communication via
the network stack, even when the client and server are on the same computer.
Allowable Values
0 Establish communication via network stack
853
854
[LAN]NetBIOS
LAN Parameters
Determines whether the NetBIOS protocol is enabled.
Allowable Values
[LAN]NetTrace
LAN Parameters
Determines whether the NetBIOS window is enabled on startup. Note that when
you enable the NetBIOS window on startup, the focus switches from the startup
message box to the NetBIOS window. (The startup message box normally loses
the focus.)
Allowable Values
0 - (Disable)
1 - (Enable)
Default Value: 0
See Also
[LAN]NetTraceBuf
LAN Parameters
Sets the number of trace buffers. Under high network loading, the NetBIOS
Debug Window can drop network packets - the message 'Trace Short n' displays
at the top of the NetBIOS window, and the out of buffers error (with the pool
'Net.Trace') is logged to the SYSLOG.DAT file.
Allowable Values: 1 to 8096
Default Value: 48
See Also
[LAN]NetTraceErr
LAN Parameters
Enables the error mode of the NetBIOS window. This parameter enables the
error on startup when the option [Lan]NetTrace is used. You can toggle the error
mode while CitectSCADA is running (press E in the NetBIOS window). When
the Error mode is enabled, the NetBIOS window only traces NetBIOS
transactions with errors.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 0
See Also
[LAN]NetTraceLog
LAN Parameters
Enables the logging mode of the NetBIOS window. This parameter enables the
logging on startup when the option [Lan]NetTrace is used. You can toggle the
logging mode while CitectSCADA is running (press L in the NetBIOS window).
When the Logging mode is enabled, the NetBIOS window logs NetBIOS
transactions to the SYSLOG.DAT file.
Allowable Values
0 - (Disable)
1 - (Enable)
Default Value: 0
See Also
[LAN]Node
LAN Parameters
Note: This parameter is to be modified only by the Computer Setup Wizard.
The name of this CitectSCADA computer. Each computer should have a unique
name. This name is used by the MsgOpen() function to identify each computer.
If you leave the computer name blank, CitectSCADA sets the computer name to
the same name as the Windows Computer Name (as set up in the Network
section of the Windows Control Panel). The Computer name is only supported
by Windows for Workgroups.
If you have set the [Lan]GroupName parameter to 0, the Computer Name must
not be the same as the Windows Computer Name, or the names will clash. In
this case, CitectSCADA prefixes the computer name with "CT". For example, if
your Computer name is COMPUTER1, CitectSCADA uses CTCOMPUTER1.
Allowable Values: Any valid computer name
Default Value: Unknown
See Also
[LAN]Poll
LAN Parameters
Puts CitectSCADA LAN communications into polled mode. CitectSCADA
checks NetBIOS (at the specified poll rate) to send and receive network packets.
If you set this parameter to 0 (zero), CitectSCADA does not poll but uses
NetBIOS under interrupt. Only use this parameter if you have problems with
NetBIOS.
Allowable Values: 0 (Interrupt Mode) or 1 to 1000 (milliseconds)
Default Value: 0
855
856
[LAN]ReadPool
LAN Parameters
The number of receive message buffers used by CitectSCADA. If you get the
error message "Out of buffers" on a server or LAN device, increase this
parameter. You might also see the message in the CitectSCADA Kernel or the
SYSLOG.DAT file, "Out of buffers lan.read.pool" - if so, increase this parameter.
You should only need to increase this value if you have a large, heavily loaded
network system (typically greater than 10 CitectSCADA clients, with greater
than 10,000 I/O points). If you have a smaller system and you are getting the
above errors, you could have a problem with your LAN hardware or
configuration.
Allowable Values: 16 to 32760
Default Value: 1024
See Also
[LAN]RemoteTimeOut
LAN Parameters
The timeout period for remote I/O device write requests from a Display Client to
the I/O Server. If the Display Client does not receive a response from the I/O
Server within this period, it will retry (send another write request). It will do this
until it runs out of retries (see the [Lan]Retry parameter).
Allowable Values: 1000 to 300,000 (in milliseconds)
Default Value: 2000
See Also
[LAN]Retry
LAN Parameters
The number of times to retry establishing communications after a timeout before an error message is generated. This parameter controls retries from the
Client to the I/O Server for I/O device communications.
Allowable Values: 0 to 10
Default Value: 1
See Also
[LAN]SendTimeout
LAN Parameters
The timeout to send a network packet across the network. If, after this time,
CitectSCADA cannot send the packet, the session is aborted. If you set this
parameter to 0, no timeout occurs and CitectSCADA tries to send the packet
indefinitely.
Allowable Values: 0 to 30000 (milliseconds)
Default Value: 15000
See Also
LAN Parameters
[LAN]SesRecBuf
The number of receive NetBIOS Control Blocks (NCBs) that CitectSCADA uses
for all sessions. If you increase buffers, you use more memory but you could
improve performance.
As you increase this parameter, CitectSCADA uses more NCBs. NCBs are a
scarce resource (particularly if you are using a Real Mode protocol driver). If you
exhaust the supply of NCBs, the networking performance is degraded and fails.
If you run out of NCBs, CitectSCADA can fail to start up correctly (with errors
such as "Out of NCBs" or "Cannot Open Server"), or can fail while running.
If you tune this parameter, be careful. Only change the parameter by small
amounts.
Allowable Values: 1 to 256
Default Value: 32
See Also
[LAN]SesSendBuf
LAN Parameters
The number of send NetBIOS control blocks that CitectSCADA uses for all
sessions. If you increase buffers, you use more memory but you could improve
performance.
As you increase this parameter, CitectSCADA uses more NCBs. NCBs are a
scarce resource (particularly if you are using a Real Mode protocol driver). If you
exhaust the supply of NCBs, the networking performance is degraded and fails.
If you run out of NCBs, CitectSCADA can fail to start up correctly (with errors
such as "Out of NCBs" or "Cannot Open Server"), or can fail while running.
If you tune this parameter, be careful. Only change the parameter by small
amounts.
Allowable Values: 1 to 1024
Default Value: 2 (128 for Windows NT)
See Also
[LAN]Sessions
LAN Parameters
The maximum number of connections across the LAN, i.e. servers x clients. If
you get an "Out Of Sessions" or "Out of Msg Instance, Increase[LAN]Sessions"
error, increase the value of this parameter.
A CitectSCADA client uses 3 sessions for the servers (Alarms, Trends, Reports) +
1 session for each of your I/O Servers, so the default parameter setting is good
for Clients.
A Server uses 1 session for each client attached, for each type of server it is. So if
a computer is a Alarms, Trends, Reports, and I/O Server and you have 20 clients,
the server uses 4 x 20 = 80 sessions. You should also allow 50% extra sessions,
because during a redundant changeover you get an extra peak loading. So in the
example, allow a total of 80 + 40 = 120 sessions.
857
858
[LAN]TCPIP
LAN Parameters
Enables the support of TCP/IP protocol. This version of TCP/IP has performance
limitations and it must not be used for local LAN support. TCP/IP support
should only be used when you are running your system over the Internet.
CitectSCADA uses sockets 2072 to 2079 for its client/server communication. If
CitectSCADA is communicating through a firewall, you may have to ask your
system administrator to allow these sockets to pass through the firewall.
Allowable Values:
[LAN]TimeOut
LAN Parameters
The timeout period (in milliseconds) for I/O device requests from the
CitectSCADA Client to the I/O Server. If the CitectSCADA Client does not get a
response from the I/O Server within this time, it retries until it runs out of retries,
and then causes a hardware error "Request Timeout from I/O Server". If you
have slow PLC communications or a heavily loaded I/O Server, this parameter
could cause timeouts unnecessarily, and you should increase the value.
Each time this parameter times out, the TimeOut counter in the Probe Kernel
window is incremented.
Allowable Values: 1000 to 300000 (milliseconds)
Default Value: 8000 or 60000 if using CiNet
See Also
[LAN]WaitBufTime
LAN Parameters
The time CitectSCADA waits for a write message buffer before aborting the
session. Note that this wait is a hard wait - CitectSCADA hangs while it waits for
this buffer - so be careful if you use this parameter.
Allowable Values: 0 to 30000 (milliseconds)
Default Value: 20
See Also
[LAN]WritePool
LAN Parameters
The maximum number of send message buffers used by CitectSCADA. If you
get the error message "Out of buffers" on a server or LAN device, increase this
LAN Parameters
Language Parameters
Defines whether CitectSCADA recognizes differences in case in text marked for
automatic language change.
See Also
[Language]CaseSensiti
ve
1 - (Case sensitive)
Default Value: 0
859
860
[Language]CharSet
Language Parameters
Defines the character set to be used when the LOCAL translation is displayed at
runtime. If you do not specify this parameter, the runtime text may be garbled (if
the local language character set differs from the default character set of the
Windows installation).
Allowable Values:
0 - ANSI
1 - Default
161 - Greek
162 - Turkish
163 - Vietnamese
177 - Hebrew
178 - Arabic
186 - Baltic
204 - Russian
222 - Thai
Default Value: 1
See Also
[Language]ClientTransl
ateFile
Language Parameters
Specifies whether the Reports Server is used for translating reports containing
multi-language text. If the Reports Server does not translate a report, the Display
Client viewing the report must use the LanguageFileTranslate() function to
perform translation.
Note: This parameter is used by the Reports Server. It applies only to reports
configured using ASCII devices. Any other logging device will have the report
translated into the local language of the Reports Server - regardless of the value
of this parameter.
Default Value: 0
See Also
[Language]DisplayError
Language Parameters
Defines whether or not an error message (#MESS) will display when a local
translation of a particular native string cannot be found in the language
database. If you decide not to display the error message, the native string will
display at runtime instead.
Allowable Values:
Default Value: 0
See Also
[Language]LocalLangu
age
Language Parameters
Sets the language database from which the local translations of all native strings
in the project will be drawn when the project is run. Native strings are those that
are preceded by a @, and enclosed in brackets (e.g. @(Motor Overload)). It
determines the language of runtime text items such as alarm descriptions,
button text, keyboard/alarm logs, graphic text, Cicode strings etc.
If you enter French here, CitectSCADA will create/update a language database
called French.dbf when it compiles the project. This database would contain two
fields, one for native text strings, the other for the French translations, as entered
by the user. When the project is run, these translations will automatically display
in place of the native text strings.
Allowable Values: Any string
Default Value: English
861
862
Language Parameters
Memory Parameters
The citect.ini file contains the following memory parameters:
See Also
[Memory]Free
Default Value: 1
See Also
[Memory]MinPhyK
Memory Parameters
Sets the minimum physical memory before CitectSCADA generates the error
message "Citect low on Physical memory" and the hardware alarm "Low
physical memory".
The way Windows calculates the available free memory can be unreliable under
some conditions. The error message can display when you do in fact have
enough free physical memory, and you might want to disable this error by
setting this parameter to 0. However, you should check that you really do have
enough free memory to run CitectSCADA before disabling this parameter running out of memory can cause a severe degradation in system performance.
You should also use an 8Mb Permanent swap file to give you some virtual
memory. Set up the swap file in the 386 Enhanced section of the Windows
[Memory]PageLock
Memory Parameters
Determines whether CitectSCADA locks the memory it uses. Locking memory
can cause Windows to abort with a paging error. Do not set this parameter
unless advised by Citect support.
Allowable Values:
Default Value: 0
See Also
[Memory]Segment
Memory Parameters
Controls how CitectSCADA allocates memory from Windows. If you set this
parameter to 1, CitectSCADA allocates memory in 64K segments - a faster and
more efficient use of memory. If you set this parameter to 0, CitectSCADA
allocates many small blocks of memory. Do not disable this parameter unless
advised by Citect support.
Allowable Values:
0 - (Allocate as required)
Default Value: 1
See Also
Memory Parameters
OID Parameters
The citect.ini file contains the following OID parameter:
See Also
[OID]Reset
863
864
Even if you add a tag and delete it immediately, its OID is not released. The
next tag will still be assigned a higher OID. This means the OID count can
increase quickly, and cannot be reduced by deleting tags. The OID count
determines the maximum number of tags. If you add and delete a lot of tags,
you may reach the maximum. If you do, a compile error will advise you to
set this parameter to 1.
If you manually edit the variable tags database, and move tags into different
positions, the OIDs will become out of order. When you compile, you'll be
instructed to set this parameter to 1.
Allowable Values:
Default Value: 0
See Also
OID Parameters
Page Parameters
The citect.ini file contains the following page parameters:
865
866
See Also
[Page]Alarm
[Page]Tip - The AN where tool tips are displayed on each graphics page.
[Page]TipTimeOut - The time delay between when the mouse pointer stops
within an AN area (i.e. over an object) and a tool tip displays (if the object at
the AN has text configured for a tool tip).
[Page]Title - The AN where the Page Title of the graphics page is displayed.
See Also
[Page]AnmDelay
Page Parameters
When animating symbols, CitectSCADA switches between frames at the
frequency specified in AnmDelay. See the DspSymAnm() Cicode function for
information about animating symbols.
Allowable Values: 100 to 10000 (milliseconds)
Default Value: 500
See Also
Page Parameters
[Page]BackgroundColo
ur
This parameters specifies the color used to fill in the background when a page
being displayed is smaller than the minimum width of a window.
The minimum width for a window is 132 pixels. The minimum page width
required to fill this window therefore becomes 132 pixels - 2 * <border width in
pixels>. In CitectSCADA, the border width of a Window is determined by the
function WinNewAt, which specifies the window type used via the Mode
argument. The following table shows the minimum page width supported by
each different display mode:
WinNewAt (Mode)
0 = Normal window
4 = No resize
8 = No icons
16 = No caption
Border size
4
3
3
1
If a page you are trying to display is smaller than the relevant width above, it
will display left aligned with the remaining space filled by the color specified by
this parameter.
Note: This parameter should only be used for existing pages that cannot be
redrawn. All new pages should be made larger than these minimum widths.
Allowable Values: 0x000000 to 0xFFFFFF
Colors defined as an RGB value. For example:
0x000000 - (Black)
0x000080 - (Blue)
0x008000 - (Green)
0x008080 - (Cyan)
0x800000 - (Red)
0x800080 - (Magenta)
0x808000 - (Brown)
0xBFBFBF - (Grey)
867
868
0xFFFF00 - (Yellow)
0xFFFFFF - (White)
[Page]ComBreak
Page Parameters
Determines whether an error status is displayed on the screen if a
communication error occurs. The following is a list of communication errors that
can occur:
#COM
#RANGE
#DIV/0
#STACK
#ASS
#ERR
#MEM
Warning! If you disable this parameter, the value of data displayed on the screen
could be inaccurate.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 1
See Also
[Page]ComBreakText
Page Parameters
Determines the display of text objects if a communication error occurs that
affects the text. Text objects can be displayed as #COM type errors, or as the text
overlaid with a dithered pattern. The #COM type error messages tell you about
the error associated with the text, while the dither pattern is more consistent
with the other "Com Break" displays. See the [Page]ComBreak parameter for a
list of errors.
Allowable Values:
0 - (Display a value)
Default Value: 1
See Also
[Page]Date
Page Parameters
Note: This parameter is not used for this version of CitectSCADA. It is included
for backward compatibility with versions prior to v3.00.
[Page]Delay
Page Parameters
This parameter has been superseded by the [Page]ScanTime parameter.
See Also
[Page]DelayRenderAdv
ancedAnimation
Page Parameters
Note: If you have not changed the [Page]DelayRenderAll parameter from its
default (TRUE), then you should not need to change this parameter.
Delays the re-drawing of graphics objects that have been changed by code in a
Cicode Object. This delay will continue until the code in all Cicode Objects has
been executed. The associated graphics objects will then be re-drawn together.
This delay will occur every time the page is updated (see the [Page]ScanTime
parameter).
Allowable Values:
[Page]DelayRenderAll
Page Parameters
Delays the re-drawing of graphics objects so that all graphics objects on a page
are re-drawn at once (CitectSCADA pauses to wait for all underlying Cicode to
execute before re-drawing the graphics objects). This delay will occur every time
the page is updated. This parameter is intended to enhance page update times
(for pages with numerous or complex objects). Be careful not to mistake this
delay for inactivity during runtime.
Allowable Values:
[Page]DisabledAlarm
Page Parameters
Note: This parameter is not used for this version of CitectSCADA. It is included
for backward compatibility with versions prior to v3.00.
The AN where the disabled alarms message is displayed on each graphics page.
869
870
[Page]DynamicComBre
akColour
Page Parameters
Sets the color of the ComBreak dithering.
Allowable Values: 0x000000 to 0xFFFFFF
Color defined as an RGB value, for example:
0x000000 - (Black)
0x000080 - (Blue)
0x008000 - (Green)
0x008080 - (Cyan)
0x800000 - (Red)
0x800080 - (Magenta)
0x808000 - (Brown)
0xBFBFBF - (Grey)
0xFFFF00 - (Yellow)
0xFFFFFF - (White)
[Page]DynamicComBre
akDensity
Page Parameters
Sets the density of the ComBreak dithering.
Allowable Values:
1 - (Highest Density)
4 - (Lowest Density)
[Page]DynamicSizing
Page Parameters
Determines whether pages can be resized at runtime. This option overrides the
resolution specified for the page.
If dynamic sizing is enabled, you can resize any page by:
You can use the [Page]InheritParentScale parameter to specify that each page
automatically uses the same scale as its parent. For example, if you increase the
size of Page A by 10%, then call Page B, Page B will automatically become 10%
larger than it was when it was configured.
Note the following:
Even if you disable dynamic page resizing, CitectSCADA windows can still
be made smaller - if the window is smaller than the page, scroll bars will
display to allow you to view the whole page.
If you have the [Animator]FullScreen parameter set, your page will take up
the entire screen, and it will have no title bar. In this mode, you cannot resize
the window.
Allowable Values:
[Page]HwAlarm
Page Parameters
Note: This parameter is not used for this version of CitectSCADA. It is included
for backward compatibility with versions prior to v3.00.
The AN where the hardware alarms message is displayed on each graphics
page.
Allowable Values: 0 (Do not display) or 1 to 8192
Default Value: 6
871
872
[Page]InheritParentScal
e
Page Parameters
Specifies that each page automatically uses the same scale as its parent window
(i.e. the window it was called from). This applies even if the parent window has
already been dynamically resized. For example, if you increase the size of Page
A by 10%, then call Page B, Page B will automatically become 10% larger than it
was when it was configured.
Allowable Values:
FALSE (Pages will default to the resolution specified for the page)
[Page]KeyEcho
Page Parameters
The AN where keyboard commands are echoed.
Allowable Values: 1 to 2000
Default Value: 1
See Also
[Page]LastAlarm
Page Parameters
Note: This parameter is not used for this version of CitectSCADA. It is included
for backward compatibility only.
The AN where the last alarm is displayed.
Allowable Values: 1 to 8192
Default Value: 11
See Also
[Page]MaintainAspectR
atio
Page Parameters
This parameter is a boolean, defaulting to 1 (true). When this parameter is set to
1, all CitectSCADA windows will maintain their aspect ratios during resizing.
When set to 0, all windows ignore aspect ratios during resizing, allowing the
window to change to the exact required dimensions.
There is also a new page mode which can be specified when you call the Cicode
function WinNewAt to create a new window. This new mode will be ignored if
[page]MaintainAspectRatio has been set to 0, every page will not maintain its
aspect ratio on resizing. But when [page]MaintainAspectRatio is set to 1, this
new mode is taken into account. In this situation, if 4096 is added to your mode
argument passed into WinNewAt, the new window will NOT maintain the
aspect ratio during resizing.
Allowable Values: 0 or 1
Default Value: 1
[Page]MaxInt
[Page]MaxLast
Page Parameters
The maximum number of pages that can be placed on the last page stack. See the
PageLast() Cicode function for information about displaying pages from the last
page stack.
Allowable Values: 1 to 100
Default Value: 10
See Also
[Page]MaxRecursion
Page Parameters
Allows the specified number of recursions on PageGoto, PageDisplay, PageNext,
PagePrev, PageCreate, and PageLast functions.
Allowable Values: 1 to 30
Default Value: 5
See Also
[Page]MaxStr
Page Parameters
The maximum number of page-based strings that can be stored in an array.
Page-based variables are stored in an array, local to each display page. See the
PageSetStr() Cicode function.
Allowable Values: 0 to 100
Default Value: 2
See Also
[Page]MenuDisable
Page Parameters
Determines whether the standard menu page is displayed on startup.
Allowable Values:
0 - (Display)
Default Value: 0
See Also
[Page]MenuShutdown
Page Parameters
Determines whether the shutdown button is displayed on the standard menu
page.
873
874
Default Value: 1
See Also
[Page]Name
Page Parameters
Note: This parameter is not used for this version of CitectSCADA. It is included
for backward compatibility only.
The AN where the Page Name is displayed.
Allowable Values: 0 (Do not display) or 1 to 8192
Default Value: 13
See Also
[Page]Prompt
Page Parameters
The AN where prompt and error messages are displayed. See the Prompt() and
DspError() Cicode functions for information about displaying prompts and
errors.
Allowable Values: 1 to 2000
Default Value: 2
See Also
[Page]RangeCheck
Page Parameters
The Page RangeCheck parameter determines if range errors are displayed. If this
flag is set, the range errors are displayed as per the [Page]Combreak and
[Page]ComBreakText parameters.
Allowable Values:
Default Value: 0
Note: If this parameter is disabled , the value of the data displayed may be
inaccurate.
See [Page]ComBreak for a list of errors.
See Also
[Page]ScaleTextToMax
Page Parameters
If [Page]ScaleTextToMax is set to 0, pages by default will have their text scaled to
the minimum of the x and y page scales. If 8192 is added to the mode argument
of the WinNewAt Cicode call that created the page, the page will have its text
scaled to the maximum of the x and y page scales.
[Page]ScanTime
See Also
[Page]Startup
You can dynamically change this value (for this computer) by calling
PageSetInt(-2, <scantime>). You can also find out what the current scan time
is, by calling PageGetInt(-2).
You can set this value (for this computer) using the Computer Setup Wizard.
You can set the Page ScanTime for individual graphics pages, using the Page
Properties (from the File menu in the Graphics Builder).
Page Parameters
Note: This parameter is to be modified only by the Computer Setup Wizard.
The Page Name of the graphics page to display when CitectSCADA starts up.
Allowable Values: Any valid Page Name or Page Number.
875
876
[Page]StartUpCancel
Page Parameters
Note: This parameter is to be modified only by the Computer Setup Wizard.
Determines whether the Cancel button displays on the Startup message Box. The
cancel button allows an operator to cancel the startup of CitectSCADA. (With
the cancel button disabled, an operator is unable to cancel CitectSCADA as it
starts up.)
Allowable Values:
0 - (Disable display)
1 - (Enable display)
Default Value: 1
See Also
[Page]Time
Page Parameters
Note: This parameter is not used for this version of CitectSCADA. It is included
for backward compatibility only.
The AN where the system time is displayed on each graphics page.
Allowable Values: 0 (Do not display) or 1 to 8192
Default Value: : 9
See Also
[Page]Tip
Page Parameters
Note: This parameter is not used for this version of CitectSCADA. It is included
for backward compatibility only.
The AN where tool tips are displayed on each graphics page. To control the
display of tool tips (on the page), set the [Page]TipHelp parameter.
Allowable Values: 0 (Do not display) or 1 to 8192
Default Value: 14
See Also
[Page]TipHelp
Page Parameters
Determines whether tool tips are displayed. To control the pause delay of the
pop-up windows for tool tips, set the [Page]TipTimeOut parameter.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 1
[Page]TipTimeOut
Page Parameters
The time delay between when the mouse stops within an AN area and a tool tip
displays (if the object at the AN has text configured for a tool tip). If the mouse
pointer is within an AN area (over the object) for the Time Out period, without
an event occurring, the tool tip pop-up displays. The operator can then move the
mouse from AN to AN, and tool tips display for each AN. If an event other then
a mouse movement occurs, or if the mouse is outside an AN area for a period of
time, the tool tips boxes do not display.
Allowable Values: 200 to 20000 (milliseconds)
Default Value: 1000
See Also
[Page]Title
Page Parameters
Note: This parameter is not used for this version of CitectSCADA. It is included
for backward compatibility only.
The AN where the Page Title of the graphics page is displayed.
Allowable Values: 0 (Do not display) or 1 to 8192
Default Value: 12
See Also
[Page]Windows
Page Parameters
The maximum number of windows that can be open simultaneously. This
parameter sets the maximum number of windows supported by CitectSCADA.
You might not be able to open this number of windows - Windows could run out
of system resources before you reach this limit.
Allowable Values: 1 to 100
Default Value: 4
See Also
[Page]WinTitle
Page Parameters
The format of the window title banner. If you use the WinTitle() function, set this
parameter to * (asterisk).
Allowable Values: The following field names: {Name} {Title} {Time} {Date}
{Window} or the asterisk ( * ) character. if you are using the WinTitle() function.
Default Value: {Title,32}
See Also
Page Parameters
Path Parameters
The citect.ini file contains the following path parameter:
877
878
See Also
[Path]"PathName"
See Also
Path Parameters
Privilege Parameters
The citect.ini file contains the following privilege parameter:
See Also
[Privilege]Exclusive
0 - (Hierarchical)
1 - (Not hierarchical)
Default Value: 1
See Also
Privilege Parameters
Protocol Parameters
The citect.ini file contains the following protocol parameters:
Block - The blocking constant is a trade-off between the time taken to make
multiple data requests and the time taken to read more data in a single
request.
PollTime - The interrupt or polling service time (in milliseconds). Setting the
polling time to 0 puts the driver in interrupt mode.
WatchTime - The frequency (in seconds) that the driver uses to check the
communications link to the I/O device.
Note: The default and allowable values of these parameters are specific to the
protocol. To set the parameters for your protocol, select your manufacturer and
protocol from Help topics finder, and then select the Protocol Parameters topic
for that protocol.
See Also
Proxi Parameters
A proxy I/O Server is used for the optimisation of Citect network traffic for I/O
requests. The citect.ini file contains the following proxi parameters:
See Also
[Proxi]<I/O Server
name>
If all I/O requests are to go to a single proxi I/O Server, the shorthand syntax can
be used as follows:
879
880
This will send all client requests to the proxi I/O Server IOP.
To setup a proxi I/O Server you only have to enable the following parameters:
// This is set only on the I/O Server. It enables and names it.
[IOSERVER]
Name=MyProxi
Server=1
// This is set on the I/O Server and the Display Client to redirect
all I/O Servers to this proxi.
[PROXI]
All=MyProxi
You do not need to add a record in the I/O Server form, so you do not need to
modify the project files to create a proxi I/O Server.
See Also
Proxi Parameters
RemoteDB Parameters
The citect.ini file contains the following remoteDB parameters:
See Also
[RemoteDB]DefaultCom
ment
[RemoteDB]DefaultEng
Full
RemoteDB Parameters
Specifies the default string to be used for the Comment field of linked or
imported variable tags. If you do not specify a default here, the field will be left
blank.
Allowable Values: 0 to 99999999 (including reals) or blank.
Default Value: No default (the field is left blank).
See Also
[RemoteDB]DefaultEng
Zero
RemoteDB Parameters
Specifies the Default Value: to be used for the Eng Zero Scale field of linked or
imported variable tags. If you do not specify a value here, the field will be left
blank.
Allowable Values: 0 to 99999999 (including reals) or blank.
Default Value: No default (the field is left blank).
See Also
[RemoteDB]DefaultEU
RemoteDB Parameters
Specifies the Default Value: to be used for the Engineering Units field of linked
or imported variable tags. If you do not specify a value here, the field will be left
blank.
Allowable Values: Any string or blank
Default Value: No default (the field is left blank).
See Also
[RemoteDB]DefaultRaw
Full
RemoteDB Parameters
Specifies the Default Value: to be used for the Raw Full Scale field of linked or
imported variable tags. If you do not specify a value here, the field will be left
blank.
Allowable Values: 0 to 9999999999 (including reals) or blank
Default Value: No default (the field is left blank).
See Also
[RemoteDB]DefaultRaw
Zero
RemoteDB Parameters
Specifies the Default Value: to be used for the Raw Zero Scale field of linked or
imported variable tags. If you do not specify a value here, the field will be left
blank.
Allowable Values: 0 to 9999999999 (including reals) or blank
Default Value: No default (the field is left blank).
See Also
RemoteDB Parameters
881
882
Report Parameters
The citect.ini file contains the following report parameters:
See Also
[Report]ComBreak
1 - (Do not run reports if there is a communication error associated with this
report trigger)
Default Value: 1
See Also
[Report]Disable
Report Parameters
Enables/disables the Reports Server.
0 - (Enable)
1 - (Disable)
Default Value: 0
See Also
[Report]HeartBeat
Report Parameters
Determines whether the Reports Servers send out heartbeats to each other.
When enabled on the Primary Reports Server, heartbeat signals are sent to the
Redundant Reports Server, informing it that the Primary Reports Server is
controlling reports. If the Redundant Reports Server has been controlling
reports, it will cease doing so upon receiving this message. The heartbeat signal
is sent out every [Report]HeartBeatTime.
When enabled on the Redundant Reports Server, heartbeat signals are sent to the
Primary Reports Server to establish its presence (i.e. a response is required). If
the Redundant Reports Server does not receive a response from the Primary
Reports Server during the [Report]HeartBeatTime, it will assume control of
reports.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 1
See Also
[Report]HeartBeatTime
Report Parameters
On the Primary Reports Server - The Primary Reports Server will send out a
heartbeat signal once each HeartBeatTime.
On the Redundant Reports Server - After sending out a heartbeat message to
the Primary Reports Server, the Redundant Reports Server will wait this long for
a response. If a response is not received during this time, it will assume the
Primary Reports Server is down, and will take control of reports. (If a response is
received, control of reports will remain with the Primary Reports Server.)
Allowable Values: 500 to 60000 (milliseconds)
Default Value: 30000
See Also
[Report]InhibitEvent
Report Parameters
Note: This parameter is to be modified only by the Computer Setup Wizard.
Inhibits event-type reports on startup. For example, you might have a report that
is triggered off the rising edge of a bit on startup. The Reports Server notices the
883
884
1 - (Inhibit)
Default Value: 1
See Also
[Report]Primary
Report Parameters
Note: This parameter is to be modified only by the Computer Setup Wizard.
Determines if this Reports Server is the Primary Reports Server.
Allowable Values:
Default Value: 1
See Also
[Report]RunStandby
Report Parameters
Note: This parameter is to be modified only by the Computer Setup Wizard.
Enables or disables tandem processing of reports. If this Server is the Standby
Reports Server, it can process all reports in tandem with the Primary Server, or it
can remain idle until called.
Allowable Values:
Default Value: 1
See Also
[Report]Server
Report Parameters
Determines whether this computer is a Reports Server.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values:
1 - (Reports Server)
Default Value: 0
See Also
Report Parameters
[Report]Startup
The report to run when CitectSCADA starts up. This parameter is only
applicable if this CitectSCADA computer is a Reports Server.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values: Any configured report.
Default Value: "Startup".
See Also
[Report]WatchTime
Report Parameters
The period at which CitectSCADA checks for reports to run. The shorter the
period, the faster the Reports Server checks if a report is due to run. The faster
the Reports Server must check for reports to run, the more I/O requests are made
(to the I/O Server) for reports that are triggered from the I/O devices, and an
increased CPU loading on the Reports Server results. You can slow the period
(this parameter) to reduce CPU and I/O Server loading.
Note that, if a report is triggered off a bit, the bit must remain high for at least
twice this period to ensure the Reports Server notices it. For example, if this
parameter is set to 1000, a bit should remain on for 2000 msec to ensure the
Reports Server notices that it goes on and off. The exact period depends on how
fast the data can be read from the I/O devices. For example, if it takes 2000 msec
to read all the data for the report triggers (this is slow), the reports are checked
every (1000 + 2000) = 3 seconds.
Allowable Values: 100 to 60000 (milliseconds)
Default Value: 1000
See Also
Report Parameters
Server Parameters
The citect.ini file contains the following server parameter:
See Also
[Server]Name
See Also
Server Parameters
885
886
Shutdown Parameters
The citect.ini file contains the following shutdown parameters:
See Also
[Shutdown]NetworkIgn
ore
0 - (Enable).
Default Value: 0
See Also
[Shutdown]NetworkStar
t
Shutdown Parameters
Enables network shutdown and restart from this computer.
Allowable Values:
Default Value: 0
See Also
[Shutdown]Phase
Shutdown Parameters
The shutdown phase for this computer.
Allowable Values:
Default Value: 0
See Also
Shutdown Parameters
SPC Parameters
The citect.ini file contains the following parameters:
[SPC]XFreak - The number of data points required to set the SPC XFreak
type alarm
887
888
[SPC]AlarmBufferSize
See Also
[SPC]XFreak
SPC Parameters
The number of consecutive data points required to set the SPC XFreak type
alarm.
Allowable Values: 1 to 10
Default Value: 1
See Also
[SPC]PartialSubgroup
SPC Parameters
Allowable Values:
Default Value: 0
Enables masking of subgroups from being included in calculations if the
subgroup data is incomplete. Subgroups that are not complete will have an
effect on the accuracy of SPC calculations. The magnitude of this effect is relative
to the number of subgroups on screen.
See Also
[SPC]RAboveUCL
SPC Parameters
Sets the number of consecutive data points required to set the RAboveUCL SPC
alarm. The alarm is triggered when consecutive subgroup range values are
above the upper control limit (UCL).
Allowable Values: 1 to 20
[SPC]RBelowLCL
SPC Parameters
Sets the number of consecutive data points required to set the RBelowLCL SPC
alarm. The alarm is triggered when consecutive subgroup range values are
below the lower control limit (LCL).
Allowable Values: 1 to 20
Default Value: 3
See Also
[SPC]ROutsideCL
SPC Parameters
Sets the number of consecutive data points required to set the ROutsideCL SPC
alarm. The alarm is triggered when consecutive subgroup range values are
outside the control limits (UCL and LCL).
Allowable Values: 1 to 20
Default Value: 3
See Also
[SPC]XAboveUCL
SPC Parameters
Sets the number of consecutive data points required to set the XAboveUCL SPC
alarm. The alarm is triggered when consecutive subgroup mean values are
above the upper control limit (UCL).
Allowable Values: 1 to 20
Default Value: 3
See Also
[SPC]XBelowLCL
SPC Parameters
Sets the number of consecutive data points required to set the XBelowLCL SPC
alarm. The alarm is triggered when consecutive subgroup mean values are
below the lower control limit (LCL).
Allowable Values: 1 to 20
Default Value: 3
See Also
[SPC]XDownTrend
SPC Parameters
Sets the number of consecutive data points required to set the XDownTrend SPC
alarm. The alarm is triggered when consecutive subgroup mean values are
gradually descending.
Allowable Values: 1 to 20
Default Value: 5
See Also
SPC Parameters
889
890
[SPC]XErratic
Sets the number of consecutive data points required to set the XErratic SPC
alarm. The alarm is triggered when consecutive subgroup mean values are
erratic in behaviour.
Allowable Values: 1 to 20
Default Value: 3
See Also
[SPC]XGradualDown
SPC Parameters
Sets the number of consecutive data points required to set the XGradualDown
SPC alarm. The alarm is triggered when consecutive subgroup mean values are
below the centre line (CL).
Allowable Values: 1 to 20
Default Value: 8
See Also
[SPC]XGradualUp
SPC Parameters
Sets the number of consecutive data points required to set the XGradualUp SPC
alarm. The alarm is triggered when consecutive subgroup mean values are
above the centre line (CL).
Allowable Values: 1 to 20
Default Value: 8
See Also
[SPC]XMixture
SPC Parameters
Sets the number of consecutive data points required to set the XMixture SPC
alarm. The alarm is triggered when consecutive subgroup mean values are both
above and below the centre line (CL).
Allowable Values: 1 to 20
Default Value: 8
See Also
[SPC]XOutsideCL
SPC Parameters
Sets the number of consecutive data points required to set the XOutsideCL SPC
alarm. The alarm is triggered when consecutive subgroup mean values are
outside the control limits (UCL and LCL).
Allowable Values: 1 to 20
Default Value: 3
See Also
[SPC]XOutsideWL
SPC Parameters
Sets the number of consecutive data points required to set the XOutsideWL SPC
alarm. The alarm is triggered when consecutive subgroup mean values are
outside the warning limits.
[SPC]XStratification
SPC Parameters
Sets the number of consecutive data points required to set the XStratification
SPC alarm. The alarm is triggered when consecutive subgroup mean values are
constant.
Allowable Values: 1 to 20
Default Value: 15
See Also
[SPC]XUptrend
SPC Parameters
Sets the number of consecutive data points required to set the XUptrend SPC
alarm. The alarm is triggered when consecutive subgroup mean values are
gradually ascending.
Allowable Values: 1 to 20
Default Value: 5
SQL Parameters
The citect.ini file contains the following SQL parameters:
See Also
[SQL]QueryTimeout
[SQL]TextColWidth - Sets the column width for text columns returned from
SQL queries.
See Also
[SQL]TextColWidth
SQL Parameters
Sets the maximum number of text characters retrieved from a database record.
This parameter only needs to be set if the SQL query returns text columns longer
than 256 characters.
891
892
SQL Parameters
Time Parameters
See Also
[Time]Deadband
[Time]PollTime - The period that the Time Server uses to synchronize all
other CitectSCADA computers on the network.
See Also
[Time]Disable
Time Parameters
Enables/disables the processing of time messages from the Time Server. If you
disable the Time Server, the time on this computer is not updated from the Time
Server.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values:
0 - (Enable)
1 - (Disable)
Default Value: 0
See Also
[Time]PollTime
Time Parameters
The period that the Time Server uses to synchronize all other CitectSCADA
computers on the network.
[Time]RTsync
Time Parameters
Determines whether the Time Server will synchronize with the hardware clock.
Allowable Values:
Default Value: 0
See Also
[Time]Server
Time Parameters
Determines whether this computer is a Time Server. The Time Server must be
defined in the same computer as an I/O Server.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values:
1 - (Time Server)
Default Value: 0
See Also
Time Parameters
Trend Parameters
The citect.ini file contains the following trend parameters:
893
894
See Also
[Trend]AllFiles
[Trend]ReadWatchTime - Determines how long the trend server will wait (in
milliseconds) between each file read of trend samples.
[Trend]WriteWatchTime - The trend write task writes out trend data to disk,
and then sleeps for the time specified in this parameter (before writing the
next trend file).
895
896
Default Value: 1
See Also
[Trend]BlockByIODevic
e
Trend Parameters
Communication problems (e.g. with hardware, the I/O device, or the
communications link) can cause a trend tag to miss samples and create gaps in
the trend file and graph.
Setting this parameter to 1 ensures that if I/O problems result in gaps for one
trend tag, other trend tags remain unaffected.
Note: Leaving this parameter set to 0 means that one trend tag with gaps can
cause gaps for all trend tags.
Allowable Values:
0 Gaps caused for one trend tag will cause gaps for all trend tags
1 Gaps caused for one trend tag will leave other trend tags unaffected
Default Value: 1
See Also
[Trend]BytesReadBefor
eSleep
Trend Parameters
Increasing the value of this parameter allows more data to be read from the
trend archive before the trend server has to sleep. This may improve the read
performance of trend requests on the trend server.
Note: Increasing this value may also increase the CPU usage on the trend server.
Allowable Values: 1 to 2147483647
Default Value: 65536
See Also
[Trend]BytesWrittenBef
oreSleep
Trend Parameters
This parameter specifies how many bytes of trend data are written to file by the
TrendWriteTask, before it sleeps for the amount of time specified by the
WriteWatchTime parameter.
Note: Do not set this parameter unless advised by Citect support.
Allowable Values: 1 to 1000000 (bytes)
Default Value: 4096
[Trend]CacheSize0
Trend Parameters
Determines the number of samples that can be stored in the cache of trends with
sample period < 50ms.
Allowable Values: any integer between 1 and 65536 inclusive (trend samples)
Default Value: 8188
If your sample period is >= 50ms, CitectSCADA uses a different parameter to set
the number of samples the cache can store. See the following table:
See Also
[Trend]CacheSize1
[Trend]Parameter
Sample Period
[Trend]CacheSize0
[Trend]CacheSize1
[Trend]CacheSize2
[Trend]CacheSize3
[Trend]CacheSize4
[Trend]CacheSize5
[Trend]CacheSize6
[Trend]CacheSize7
[Trend]CacheSize8
< 50 ms
>= 50 ms and < 250 ms
>= 250 ms and < 1 second
>= 1 second and < 5 seconds
>= 5 seconds and < 10 seconds
>= 10 seconds and < 20 seconds
>= 20 seconds and < 50 seconds
>= 50 seconds and < 100 seconds
>= 100 seconds
Trend Parameters
Determines the number of samples that can be stored in the cache of trends with
sample period >= 50ms and < 250ms.
Allowable Values: any integer between 1 and 65536 inclusive (trend samples)
Default Value: 2044
897
898
See Also
[Trend]CacheSize2
[Trend]Parameter
Sample Period
[Trend]CacheSize0
[Trend]CacheSize1
[Trend]CacheSize2
[Trend]CacheSize3
[Trend]CacheSize4
[Trend]CacheSize5
[Trend]CacheSize6
[Trend]CacheSize7
[Trend]CacheSize8
< 50 ms
>= 50 ms and < 250 ms
>= 250 ms and < 1 second
>= 1 second and < 5 seconds
>= 5 seconds and < 10 seconds
>= 10 seconds and < 20 seconds
>= 20 seconds and < 50 seconds
>= 50 seconds and < 100 seconds
>= 100 seconds
Trend Parameters
Determines the number of samples that can be stored in the cache of trends with
sample period >= 250ms and < 1 second.
Allowable Values: any integer between 1 and 65536 inclusive (trend samples)
Default Value: 1020
If your sample period is <250 ms or >= 1 second, CitectSCADA uses a different
parameter to set the number of samples the cache can store. See the following
table:
See Also
[Trend]CacheSize3
[Trend]Parameter
Sample Period
[Trend]CacheSize0
[Trend]CacheSize1
[Trend]CacheSize2
[Trend]CacheSize3
[Trend]CacheSize4
[Trend]CacheSize5
[Trend]CacheSize6
[Trend]CacheSize7
[Trend]CacheSize8
< 50 ms
>= 50 ms and < 250 ms
>= 250 ms and < 1 second
>= 1 second and < 5 seconds
>= 5 seconds and < 10 seconds
>= 10 seconds and < 20 seconds
>= 20 seconds and < 50 seconds
>= 50 seconds and < 100 seconds
>= 100 seconds
Trend Parameters
Determines the number of samples that can be stored in the cache of trends with
sample period >= 1 second and < 5 seconds.
Allowable Values: any integer between 1 and 65536 inclusive (trend samples)
See Also
[Trend]CacheSize4
[Trend]Parameter
Sample Period
[Trend]CacheSize0
[Trend]CacheSize1
[Trend]CacheSize2
[Trend]CacheSize3
[Trend]CacheSize4
[Trend]CacheSize5
[Trend]CacheSize6
[Trend]CacheSize7
[Trend]CacheSize8
< 50 ms
>= 50 ms and < 250 ms
>= 250 ms and < 1 second
>= 1 second and < 5 seconds
>= 5 seconds and < 10 seconds
>= 10 seconds and < 20 seconds
>= 20 seconds and < 50 seconds
>= 50 seconds and < 100 seconds
>= 100 seconds
(No. of samples)
8188
2044
1020
764
508
380
252
192
128
Trend Parameters
Determines the number of samples that can be stored in the cache of trends with
sample period >= 5 seconds and < 10 seconds.
Allowable Values: any integer between 1 and 65536 inclusive (trend samples)
Default Value: 508
If your sample period is <5 seconds or >= 10 seconds, CitectSCADA uses a
different parameter to set the number of samples the cache can store. See the
following table:
See Also
[Trend]CacheSize5
[Trend]Parameter
Sample Period
[Trend]CacheSize0
[Trend]CacheSize1
[Trend]CacheSize2
[Trend]CacheSize3
[Trend]CacheSize4
[Trend]CacheSize5
[Trend]CacheSize6
[Trend]CacheSize7
[Trend]CacheSize8
< 50 ms
>= 50 ms and < 250 ms
>= 250 ms and < 1 second
>= 1 second and < 5 seconds
>= 5 seconds and < 10 seconds
>= 10 seconds and < 20 seconds
>= 20 seconds and < 50 seconds
>= 50 seconds and < 100 seconds
>= 100 seconds
Trend Parameters
Determines the number of samples that can be stored in the cache of trends with
sample period >= 10 seconds and < 20 seconds.
Allowable Values: any integer between 1 and 65536 inclusive (trend samples)
899
900
See Also
[Trend]CacheSize6
[Trend]Parameter
Sample Period
[Trend]CacheSize0
[Trend]CacheSize1
[Trend]CacheSize2
[Trend]CacheSize3
[Trend]CacheSize4
[Trend]CacheSize5
[Trend]CacheSize6
[Trend]CacheSize7
[Trend]CacheSize8
< 50 ms
>= 50 ms and < 250 ms
>= 250 ms and < 1 second
>= 1 second and < 5 seconds
>= 5 seconds and < 10 seconds
>= 10 seconds and < 20 seconds
>= 20 seconds and < 50 seconds
>= 50 seconds and < 100 seconds
>= 100 seconds
Trend Parameters
Determines the number of samples that can be stored in the cache of trends with
sample period >= 20 seconds and < 50 seconds
Allowable Values: any integer between 1 and 65536 inclusive (trend samples)
Default Value: 252
If your sample period is < 20 seconds or >= 50 seconds, CitectSCADA uses a
different parameter to set the number of samples the cache can store. See the
following table:
See Also
[Trend]CacheSize7
[Trend]Parameter
Sample Period
[Trend]CacheSize0
[Trend]CacheSize1
[Trend]CacheSize2
[Trend]CacheSize3
[Trend]CacheSize4
[Trend]CacheSize5
[Trend]CacheSize6
[Trend]CacheSize7
[Trend]CacheSize8
< 50 ms
>= 50 ms and < 250 ms
>= 250 ms and < 1 second
>= 1 second and < 5 seconds
>= 5 seconds and < 10 seconds
>= 10 seconds and < 20 seconds
>= 20 seconds and < 50 seconds
>= 50 seconds and < 100 seconds
>= 100 seconds
Trend Parameters
Determines the number of samples that can be stored in the cache of trends with
sample period >= 50 seconds and < 100 seconds.
See Also
[Trend]CacheSize8
[Trend]Parameter
Sample Period
[Trend]CacheSize0
[Trend]CacheSize1
[Trend]CacheSize2
[Trend]CacheSize3
[Trend]CacheSize4
[Trend]CacheSize5
[Trend]CacheSize6
[Trend]CacheSize7
[Trend]CacheSize8
< 50 ms
>= 50 ms and < 250 ms
>= 250 ms and < 1 second
>= 1 second and < 5 seconds
>= 5 seconds and < 10 seconds
>= 10 seconds and < 20 seconds
>= 20 seconds and < 50 seconds
>= 50 seconds and < 100 seconds
>= 100 seconds
(No. of samples)
8188
2044
1020
764
508
380
252
192
128
Trend Parameters
Determines the number of samples that can be stored in the cache of trends with
sample period >= 100 seconds.
Allowable Values: any integer between 1 and 65536 inclusive (trend samples)
Default Value: 128
If your sample period is < 100 seconds, CitectSCADA uses a different parameter
to set the number of samples the cache can store. See the following table:
See Also
[Trend]ClientRequestTi
me
[Trend]Parameter
Sample Period
[Trend]CacheSize0
[Trend]CacheSize1
[Trend]CacheSize2
[Trend]CacheSize3
[Trend]CacheSize4
[Trend]CacheSize5
[Trend]CacheSize6
[Trend]CacheSize7
[Trend]CacheSize8
< 50 ms
>= 50 ms and < 250 ms
>= 250 ms and < 1 second
>= 1 second and < 5 seconds
>= 5 seconds and < 10 seconds
>= 10 seconds and < 20 seconds
>= 20 seconds and < 50 seconds
>= 50 seconds and < 100 seconds
>= 100 seconds
Trend Parameters
The interval between Display Client requests for trend data from the Trends
Server. For instance, if you set this value to 500ms, any trends with a display
period of 300ms will only be updated with new data every 500ms. You can set
901
902
[Trend]CopyFilesMessa
ge
Trend Parameters
Determines whether the redundant Trends Server displays a warning message if
it cannot find any trend files. Failure to locate trend files can occur when the
redundant Trends Server starts up for the first time, or if files have been deleted.
If the projects being run by both Trends Servers are not identical, the redundant
copy may fail, displaying a warning message. For example, if trend tags are
missing or in a different order.
Allowable Values:
Default Value: 1
See Also
[Trend]CursorColour
Trend Parameters
Specifies the trend cursor color.
Allowable Values: 0x000000 to 0xFFFFFF
Color defined as an RGB value, for example:
0x000000 - (Black)
0x000080 - (Blue)
0x008000 - (Green)
0x008080 - (Cyan)
0x800000 - (Red)
0x800080 - (Magenta)
0x808000 - (Brown)
0xBFBFBF - (Grey)
0xFFFF00 - (Yellow)
0xFFFFFF - (White)
[Trend]DeleteIfIncompat
ible
Trend Parameters
Causes automatic deletion of incompatible history files at start-up.
Allowable Values:
Default Value: 0
See Also
[Trend]Disable
Trend Parameters
Enables/disables the Trends Server.
Allowable Values:
0 - (Enable)
1 - (Disable)
Default Value: 1
See Also
[Trend]EnableBackfill
Trend Parameters
Allows users to disable trend backfill at startup and server re-connection.
Allowable Values:
0 - (Disable)
1 - (Enable)
Default Value: 1
[Trend]FileNameType
Specifies whether your trend file names will be long or short. There are three
options: Compatible file names, Long file names, and Short file names.
Compatible File Names - All new trend files will have long file names if
supported by the operating system. Existing short file names will be
unaffected. The trend system will check for short file names, so
CitectSCADA startup may take longer.
903
904
Long File Names - All new and existing trend files will be assigned long file
names. Existing short file names will not be deleted, but the trend system
will be unable to use them.
Short File Names - All new and existing trend files will be assigned short
file names. Existing long file names will not be deleted, but the trend system
will be unable to use them.
Allowable Values:
Default Value: 0
See Also
[Trend]GapFillMode
Trend Parameters
Determines the method used to fill gaps in a trend file and graph caused by
missing trend samples. You can choose either the Step or Ratio method.
If you choose Step, CitectSCADA will fill the gap with a sample of the same
value as the last real sample.
If you choose Ratio, CitectSCADA will fill the gap with a sample which is
calculated using the ratio of sample times and values immediately before and
after the gap. The gap in the trend graph will then be filled with a straight line.
Note: For gaps to be filled, you must also set the parameter [Trend]GapFillTime
or [Trend]GapFillSamples.
If you want to fill gaps left by missing trend samples on the trend graph only
(and not in the trend's file), you must use TrnSetDisplayMode() instead of this
parameter.
Allowable Values:
0 - Step
1 - Ratio
Default Value: 0
See Also
[Trend]GapFillSamples
Trend Parameters
Determines how CitectSCADA processes missing trend samples (i.e. gaps in the
trend file and graph). If the number of missing samples is less than the value you
enter here, the gap will be filled. Gaps larger than or equal to this value will not
be filled.
If you enter 0, no gaps will be filled - the gaps will actually appear on your trend
graphs.
[Trend]GapFillTime
Trend Parameters
Determines how CitectSCADA processes missing trend samples (i.e. gaps in the
trend file and graph). Any gaps equal to or shorter than the time you enter here
will be filled with values calculated by CitectSCADA. If you enter 0, no gaps will
be filled - the gaps will actually appear on your trend graphs.
Note: To use samples (instead of time) to determine which gaps will be filled, set
[Trend]GapFillSamples to a value greater than or equal to 0, [Trend]GapFillTime
will then be ignored.
The method used to fill the gap is specified by the [Trend]GapFillMode
parameter.
To fill gaps left by missing trend samples on the trend graph only (and not in the
trend's file), use TrnSetDisplayMode() instead of this parameter.
Allowable Values: 0 to 60000 (milliseconds)
Default Value: 10000
See Also
[Trend]InhibitEvent
Trend Parameters
Inhibits event trends on startup. For example, you might have a trend that is
triggered off the rising edge of a bit on startup. The Trends Server notices the bit
come on, and displays the trend. If this parameter is enabled, the Trends Server
does not display this trend until it has read the I/O devices a second time.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values:
1 - (Disable)
Default Value: 1
See Also
Trend Parameters
905
906
[Trend]MaxBackfillsAtO
nce
See Also
[Trend]MaxRdnSamples
Trend Parameters
Determines the maximum samples to be requested for a trend at a time.
Allowable Values: N/A
Default Value: 500
See Also
[Trend]MaxRequestLen
gth
Trend Parameters
The maximum trend sample requests allowed per trend in one go.
Allowable Values: 1 to 100000000
Default Value: 4000
[Trend]MaxSetTableQue
[Trend]MaxSetTableStn
byPending
[Trend]MissedSamples
AlarmTime
Controls the amount of trend data that can be missed before a hardware alarm is
triggered. A value of 0 disables the alarm. If the value is > 0, an alarm will be
raised if a gap occurs which is larger than this value.
Allowable Values: 0 to 60000 (milliseconds)
[Trend]RangeCheck
Trend Parameters
CitectSCADA checks for trend values that have fallen outside their full scale and
zero scale range. The RangeCheck parameter allows you to specify the action
that CitectSCADA should take when such values are detected.
Allowable Values:
0 - (Clamp values to limits)
1 - (Invalidate values - <NA> is displayed)
2 - (Clamp values to limits for Scaled [2-byte] storage method.
Leave values outside the range for Floating Point [8-byte] storage method)
3 - (Invalidate values for Scaled [2-byte] storage method. Leave values outside
the range for Floating Point [8-byte] storage method)
Default Value: 1
See Also
[Trend]ReadWatchTime
Trend Parameters
Determines how long the trend server will wait (in milliseconds) between each
read of trend samples.
Setting this parameter to 0 (zero) causes the read thread to give up the rest of its
current CPU time slice.
If this value is -1, there will be no delay between reads. You should avoid setting
this parameter to -1 if you have many clients. In extreme cases of many clients
doing many trend read requests, it may be necessary to increase the value of
ReadWatchTime to make sure that the main CitectSCADA thread still gets all its
work done.
Note: Do not set this parameter unless advised by Citect support.
Allowable Values: -1 to 60 000 (milliseconds)
Default Value: 1
See Also
[Trend]Redundancy
Trend Parameters
Note: This parameter is to be modified only by the Computer Setup Wizard.
Enables/disables trend redundancy action. If this parameter is enabled, when a
Trends Server starts up, it tries to access any other running Trend Servers to
obtain logging data that it has missed.
Allowable Values:
0 - (Disable)
907
908
1 - (Enable)
Default Value: 1
See Also
[Trend]Server
Trend Parameters
Determines whether this computer is a Trends Server.
Note: This parameter is to be modified only by the Computer Setup Wizard
Allowable Values:
1 - (Trends Server)
Default Value: 0
See Also
[Trend]ShowCacheSize
s
Trend Parameters
Determines whether the currently set values and sample period ranges for
[Trend] parameters CacheSize0. . .CacheSize8 are displayed in the CitectSCADA
Kernel.
Allowable Values:
1 - (Information is displayed)
Default Value: 0
See Also
[Trend]StaggerRequest
Subgroups
Trend Parameters
This parameter reduces peak loading on I/O Servers by spacing out trend
sample requests. If you set this parameter to 1, all trends with the same sample
period and on the same I/O device will request samples from the I/O Server at
once - each sample period.
For values > 1, the trends will be divided into that number of sub-groups. The
sub-groups will request samples at different times. Their sample period will
remain the same, but their requests will be staggered. The stagger time is
determined by dividing the sample period by the value of this parameter.
Example 1
Suppose your project contains 400 trends with 1 minute sample periods. If you
accept the Default Value: for this parameter (1), the trend system will send 400
requests to the I/O Server every minute.
Time
3:00
No. of requests made 400
3:01
400
3:00:00
150
3:01:15
3:00:30
3:00:45
3:01:00
3:01:15
150
3:01:30
3:01:45
Example 2
Suppose your project contains 600 trends with 5 minute sample periods. If you
accept the Default Value: for this parameter (1), the trend system will send 600
requests to the I/O Server five minutes.
Time
3:00
No. of requests made 600
3:05
600
If you set this parameter to 4, the trends will be divided into 4 sub-groups of 150
trends, and the requests of each sub-group will be staggered by 1min 15 seconds
(5 min / 4):
Time
No. of requests
3:00:00
150
3:00:15
3:00:30
3:00:45
3:01:00
3:01:15
150
3:01:30
3:01:45
If the number of trends (of a particular sample period and I/O device) is less than
the value you set for this parameter, the value will be ignored - but only for that
group. A sub-group will be created for each trend, and the stagger period will be
calculated accordingly. Each trend will then request samples at a different time.
If the number of trends (of a particular sample period and for a particular I/O
device) is divisible by the value of this parameter, the number of trends in each
subgroup will be exactly the number of trends divided by this parameter.
If the number of trends (of a particular sample period and for a particular I/O
device) is not divisible by the value of this parameter, the number of trends in
the last subgroup will be fewer than all other subgroups.
Note that this parameter is also used by the compiler. If the value is changed
from 1 to greater than 1, or reduced from greater than 1 to 1, all projects using
this parameter must be recompiled. You should also be aware that enabling
trend staggering will disable compiler request blocking and may result in
decreased network performance. This functionality will only be useful if the
decrease in peak loading on the I/O Server results in overall performance gains
when weighed against the increase in network traffic.
Allowable Values: 1 to 32767
Default Value: 1
See Also
[Trend]TrendDebug
Trend Parameters
Used to establish problems with the trend system during commissioning.
Options values are :
909
910
1 - Logs the client, server, and redundancy message types and also the
samples being written in the trend server from normal acquisition.
2 - Logs detailed information about the currently active backfill process. This
will include the redundant samples written to the archive.
These settings can be added together to have combinations of logging levels. For
example:
[Trend]
TrendDebug=6! 4 + 2
[Trend]WatchTime
The interval between Trends Server requests for data from the I/O devices. This
parameter is ignored if you have a trend in your system that requests data at a
higher rate - the Trends Server will request data as often as the trends in your
system demand. For instance, if you set this value to 500ms, and a trend in your
system has a sampling period of 300ms, the Trends Server will cater for this
sampling period.
Note: The parameter value is not altered when the interval is automatically set
for fast trends.
You can set this parameter to any value, but the lower the value, the more
frequent the requests to the I/O devices, and this will cause an increased CPU
load.
Allowable Values: 100 to 60000 (milliseconds)
Default Value: 500
See Also
[Trend]WriteWatchTime
Trend Parameters
Note: Do not set this parameter unless advised by Citect support.
There are two uses for this parameter. The trend write task writes out trend data
to disk, and then sleeps for the time specified in this parameter (before writing
the next trend file). This small delay stops the trend write task from using too
much CPU time when it is writing out a large number of files. If this parameter
Trend Parameters
Win Parameters
The citect.ini file contains the following Win parameters:
See Also
[Win]AltEsc
Default Value: 1
See Also
Win Parameters
911
912
[Win]AltSpace
Default Value: 1
See Also
[Win]AltTab
Win Parameters
Determines whether the Windows key command [Alt]+[Tab] can be used in the
runtime system (to cycle through open applications).
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values:
Default Value: 1
See Also
[Win]Configure
Win Parameters
Determines whether the Project Editor and Graphics Builder options are
displayed on the control menu of the CitectSCADA runtime system.
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values:
1 - (Display options)
Default Value: 1
See Also
[Win]CtrlEsc
Win Parameters
Determines whether the Windows key command [Ctrl]+[Esc] can be used in the
runtime system (to display the task list).
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values:
Default Value: 1
[Win]ScreenSaver
Win Parameters
Determines whether the Windows screen saver is active when CitectSCADA is
running. The screen saver changes the image on the screen to a random image (if
it is not changed within a certain period).
Note: This parameter is to be modified only by the Computer Setup Wizard.
Allowable Values:
Default Value: 1
913
914
Index
Symbols
[Accumulator]UpdateTime parameter, 751
[Accumulator]WatchTime parameter, 751
[Alarm]Ack parameter, 754
[Alarm]AckHold parameter, 754
[Alarm]Active parameter, 754
[Alarm]AlarmDisable parameter, 755
[Alarm]CacheLength parameter, 755
[Alarm]DefDspFmt parameter, 755
[Alarm]DefSumFmt parameter, 756
[Alarm]DisplayDisable parameter, 756
[Alarm]EnableSmartCustomFilters parameter, 756
[Alarm]EventFmt parameter, 756
[Alarm]EventQue parameter, 756
[Alarm]ExtendedDate parameter, 757
[Alarm]HardHoldTime parameter, 757
[Alarm]HardReAlarm parameter, 757
[Alarm]HardwareDisable parameter, 757
[Alarm]HighResOff parameter, 758
[Alarm]Hres24HrDeadBand parameter, 758
[Alarm]HresType parameter, 758
[Alarm]HwExclude parameter, 759
[Alarm]LastAlarmDisplayMode parameter, 759
[Alarm]LastAlarmFmt parameter, 759
[Alarm]MaxOptimisedQueries parameter, 759
[Alarm]Period parameter, 760
[Alarm]Primary parameter, 760
[Alarm]SavePeriod parameter, 760
[Alarm]SavePrimary parameter, 760
[Alarm]SaveSecondary parameter, 761
[Alarm]SaveStyle parameter, 761
[Alarm]ScanTime parameter, 761
[Alarm]Server parameter, 762
[Alarm]SetTimeOnAck parameter, 762
[Alarm]SetTimeOnOff parameter, 763
[Alarm]Sort parameter, 763
[Alarm]SortMode parameter, 763
[Alarm]StartTimeout parameter, 763
[Alarm]SummaryLength parameter, 764
[Alarm]SummaryMode parameter, 764
[Alarm]SummaryShutdownMode parameter, 766
916
Index
[Code]DebugMessage parameter, 784
[Code]DllCallErrorPopup parameter, 785
[Code]DllCallProtect parameter, 785
[Code]EchoError parameter, 785
[Code]Export parameter, 786
[Code]HaltOnError parameter, 786
[Code]IgnoreCase parameter, 786
[Code]Queue parameter, 786
[Code]ScaleCheck parameter, 787
[Code]Shutdown parameter, 787
[Code]ShutdownTime parameter, 787
[Code]Stack parameter, 787
[Code]Startup parameter, 788
[Code]StrictArgumentCheck parameter, 788
[Code]Threads parameter, 788
[Code]TimeData parameter, 789
[Code]TimeSlice parameter, 789
[Code]TimeSlicePage parameter, 789
[Code]Unsigned parameter, 789
[Code]VBASupport parameter, 789
[Code]WriteLocal parameter, 790
[Com]StartTimeOut parameter, 790
[CrashHandler]Enable parameter, 778
[CrashMailer]Enable parameter, 791
[CtAPI]CpuLoadCount parameter, 792
[CtAPI]CpuLoadSleepMS parameter, 792
[CtAPI]Remote parameter, 791
[CtCicode]MLCommentThreshold parameter, 793
[CtDraw.RSP]BitmapCompression parameter, 793
[CtDraw.RSP]ColorDepthWarning parameter, 794
[CtDraw.RSP]PurgeGenieLists parameter, 794
[CtEdit]ANSIToOEM parameter, 795
[CtEdit]Backup parameter, 796
[CtEdit]Bin parameter, 796
[CtEdit]CompileErrorForm parameter, 796
[CtEdit]Copy parameter, 796
[CtEdit]Data parameter, 797
[CtEdit]DbFiles parameter, 797
[CtEdit]FTP parameter, 797
[CtEdit]MaxCicodeFunctions parameter, 797
[CtEdit]MaxFields parameter, 798
[CtEdit]MaxHelpRec parameter, 798
[CtEdit]Run parameter, 798
[CtEdit]ShowToolbar parameter, 798
[CtEdit]SubtAnValue parameter, 798
Index
[Font]Error parameter, 816
[Font]General parameter, 816
[Font]Print parameter, 817
[Font]Prompt parameter, 817
[General]AdvancedDDEPoll parameter, 819
[General]BadOptimise parameter, 819
[General]BufferIO parameter, 819
[General]CheckAddressBoundary parameter, 820
[General]Ctl3D parameter, 821
[General]DebugInfo parameter, 821
[General]DisablePlotSetupForm parameter, 821
[General]DisableRemoteBlocking parameter, 821
[General]FormatCheck parameter, 822
[General]InfoDestroy parameter, 822
[General]LockDelay parameter, 822
[General]LockRetry parameter, 822
[General]LongFilename parameter, 823
[General]OSErrors parameter, 823
[General]PasswordExpiry parameter, 823
[General]PointLimitMsg parameter, 824
[General]PrinterColourMode parameter, 824
[General]RegionalNumbersFormat parameter, 824
[General]ShareFiles parameter, 825
[General]ShowDriverError parameter, 825
[General]Stack parameter, 825
[General]StartDelay parameter, 825
[General]SymbolicInfo parameter, 826
[General]TagDB parameter, 826
[General]TagStartDigit parameter, 826
[General]TrnPrinter parameter, 828
[General]Verbose parameter, 828
[Internet]Client parameter, 829
[Internet]Display parameter, 830
[Internet]FTPTimeout parameter, 830
[Internet]FTPWatchTime parameter, 830
[Internet]IPAddress parameter, 830
[Internet]LogFile parameter, 830
[Internet]Manager parameter, 830
[Internet]Password parameter, 831
[Internet]Port parameter, 831
[Internet]Redundancy parameter, 831
[Internet]RunFTP parameter, 832
[Internet]SearchCurrentPath parameter, 832
[Internet]Server parameter, 832
[Internet]ShowFileFTPDlg parameter, 832
917
918
Index
[Keyboard]ButtonOnlyLeftClick parameter, 847
[Keyboard]ButtonRaw parameter, 847
[Keyboard]EchoPopUp parameter, 848
[Keyboard]LogExtendedDate parameter, 848
[Keyboard]NonPrint parameter, 848
[Keyboard]NonPrintChar parameter, 848
[Keyboard]Type parameter, 849
[LAN]BackOffTime parameter, 850
[LAN]Bridge parameter, 850
[LAN]CancelOnClose parameter, 850
[LAN]Delay parameter, 851
[LAN]Disable parameter, 851
[LAN]GroupName parameter, 851
[LAN]KillPiggyBackAck parameter, 852
[LAN]LanA parameter, 852
[LAN]LocalNet parameter, 853
[LAN]NetBIOS parameter, 854
[LAN]NetTrace parameter, 854
[LAN]NetTraceBuf parameter, 854
[LAN]NetTraceErr parameter, 854
[LAN]NetTraceLog parameter, 855
[LAN]Node parameter, 855
[LAN]Poll parameter, 855
[LAN]ReadPool parameter, 856
[LAN]RemoteTimeOut parameter, 856
[LAN]Retry parameter, 856
[LAN]SendTimeout parameter, 856
[LAN]SesRecBuf parameter, 857
[LAN]SesSendBuf parameter, 857
[LAN]Sessions parameter, 857
[LAN]TCPIP parameter, 858
[LAN]TimeOut parameter, 858
[LAN]WaitBufTime parameter, 858
[LAN]WritePool parameter, 858
[Language]CaseSensitive parameter, 859
[Language]CharSet parameter, 860
[Language]ClientTranslateFile parameter, 860
[Language]DisplayError parameter, 861
[Language]LocalLanguage parameter, 861
[LLC]Block parameter, 780
[LLC]Compress parameter, 780
[LLC]Delay parameter, 780
[LLC]MaxPending parameter, 780
[LLC]PollTime parameter, 780
[LLC]Retry parameter, 780
Index
[Page]WinTitle parameter, 877
[Path]PathName parameter, 878
[Privilege]Exclusive parameter, 878
[Protocol]Block parameter, 878
[Protocol]Delay parameter, 879
[Protocol]MaxPending parameter, 879
[Protocol]PollTime parameter, 879
[Protocol]Retry parameter, 879
[Protocol]Timeout parameter, 879
[Protocol]WatchTime parameter, 879
[Proxi]<I/O Server name> parameter, 879
[RemoteDB]DefaultComment parameter, 880
[RemoteDB]DefaultEngFull parameter, 881
[RemoteDB]DefaultEngZero parameter, 881
[RemoteDB]DefaultEU parameter, 881
[RemoteDB]DefaultRawFull parameter, 881
[RemoteDB]DefaultRawZero parameter, 881
[Report]ComBreak parameter, 882
[Report]Disable parameter, 882
[Report]HeartBeat parameter, 883
[Report]HeartBeatTime parameter, 883
[Report]InhibitEvent parameter, 883
[Report]Primary parameter, 884
[Report]RunStandby parameter, 884
[Report]Server parameter, 884
[Report]Startup parameter, 885
[Report]WatchTime parameter, 885
[Server]Name parameter, 885
[Shutdown]NetworkIgnore parameter, 886
[Shutdown]NetworkStart parameter, 886
[Shutdown]Phase parameter, 886
[SPC]AlarmBufferSize parameter, 888
[SPC]PartialSubgroup parameter, 888
[SPC]RAboveUCL parameter, 888
[SPC]RBelowLCL parameter, 889
[SPC]ROutsideCL parameter, 889
[SPC]XAboveUCL parameter, 889
[SPC]XBelowLCL parameter, 889
[SPC]XDownTrend parameter, 889
[SPC]XErratic parameter, 890
[SPC]XFreak parameter, 888
[SPC]XGradualDown parameter, 890
[SPC]XGradualUp parameter, 890
[SPC]XMixture parameter, 890
[SPC]XOutsideCL parameter, 890
919
920
Index
[Trend]StaggerRequestSubgroups parameter, 908
[Trend]TrendDebug parameter, 909
[Trend]WatchTime parameter, 910
[Trend]WriteWatchTime parameter, 910
[Win]AltEsc parameter, 911
[Win]AltSpace parameter, 912
[Win]AltTab parameter, 912
[Win]Configure parameter, 912
[Win]CtrlEsc parameter, 912
[Win]ScreenSaver parameter, 913
_ObjectCallMethod Cicode function, 145
_ObjectGetProperty Cicode function, 146
_ObjectSetProperty Cicode function, 146
A
Abs Cicode function, 147
AccControl Cicode function, 147
accumulator parameters, 751
ActiveX Cicode functions, 115
alarm Cicode functions, 116
Alarm logging parameters, 766
Alarm parameters, 751
AlarmAck Cicode function, 148
AlarmAckRec Cicode function, 150
AlarmActive Cicode function, 151
AlarmClear Cicode function, 152
AlarmClearRec Cicode function, 153
AlarmComment Cicode function, 154
AlarmDelete Cicode function, 155
AlarmDisable Cicode function, 156
AlarmDisableRec Cicode function, 158
AlarmDsp Cicode function, 159
AlarmDspLast Cicode function, 160
AlarmDspNext Cicode function, 162
AlarmDspPrev Cicode function, 163
AlarmEnable Cicode function, 163
AlarmEnableRec Cicode function, 165
AlarmEventQue Cicode function, 166
AlarmFirstCatRec Cicode function, 167
AlarmFirstPriRec Cicode function, 168
AlarmFirstTagRec Cicode function, 169
AlarmGetDelay Cicode function, 170
AlarmGetDelayRec Cicode function, 170
AlarmGetDsp Cicode function, 171
AlarmGetFieldRec Cicode function, 173
Index
AssChainPopUp Cicode function, 210
AssChainWin Cicode function, 210
AssChainWinFree Cicode function, 212
Assert Cicode function, 214
Assert function, 112
AssInfo Cicode function, 215
AssPage Cicode function, 216
AssPopUp Cicode function, 217
AssScaleStr Cicode function, 218
AssTag Cicode function, 220
AssTitle Cicode function, 220
AssVarTags Cicode function, 221
AssWin Cicode function, 222
B
background tasks, 75
Backup parameters, 778
bit operators, 64
Breakpoint window, 84
breakpoints, 93
C
calculations
variables in, 6
CallEvent Cicode function, 225
caret (^) character, 17
ChainEvent Cicode function, 233
CharToStr Cicode function, 233
Cicode Editor
toolbar options, 84
Cicode errors, 737
CitectColourToPackedRGB Cicode function, 234
CitectInfo Cicode function, 228
CitectVBA Watch window, 87
Client parameters, 781
Clipboard Cicode functions, 117
ClipCopy Cicode function, 234
ClipPaste Cicode function, 234
ClipReadLn Cicode function, 235
ClipSetMode Cicode function, 235
ClipWriteLn Cicode function, 236
cluster Cicode functions, 117
ClusterGetName Cicode function, 236
ClusterSetName Cicode function, 237
code debugging, 91
Code parameters, 782
CodeSetMode Cicode function, 238
CodeTrace Cicode function, 240
cohesion, 106
color Cicode functions, 118
Com parameters, 790
ComClose Cicode function, 241
comments, 29
formatting, 101
communication Cicode functions, 118
ComOpen Cicode function, 242
Compile Errors window, 87
ComRead Cicode function, 244
ComReset Cicode function, 245
ComWrite Cicode function, 245
constants, 97
controlling tasks, 75
converting integers to strings, 57
copying
variables, 6
Cos Cicode function, 247
coupling, 107
CrashHandler parameters, 778
CreateControlObject Cicode function, 247
CreateObject Cicode function, 249
CtAPI parameters, 791
CtCicode parameters, 793
CtDraw.RSC parameters, 793
CtEdit parameters, 794
D
data
displaying, using expressions, 11
logging expression, 12
returning, 19
data operators, 63
Date Cicode function, 251
date functions, 23
DateAdd Cicode function, 252
DateDay Cicode function, 252
DateInfo Cicode function, 253
DateMonth Cicode function, 254
DateSub Cicode function, 255
DateWeekDay Cicode function, 256
921
922
Index
DateYear Cicode function, 256
DDE Cicode functions, 118
DDE parameters, 800
DDEExec Cicode function, 257
DDEhExecute Cicode function, 258
DDEhGetLastError Cicode function, 259
DDEhInitiate Cicode function, 260
DDEhPoke Cicode function, 261
DDEhReadLn Cicode function, 261
DDEhRequest Cicode function, 262
DDEhSetMode Cicode function, 263
DDEhTerminate Cicode function, 263
DDEhWriteLn Cicode function, 264
DDEPost Cicode function, 265
DDERead Cicode function, 266
DDEWrite Cicode function, 267
Debug parameters, 800
DebugBreak Cicode function, 267
debugging, 94
error trapping, 111
debugging breakpoints, 93
debugging code, 91
debugging functions, 30
DebugMsg Cicode function, 268
DebugMsg function, 111
DebugMsgSet Cicode function, 269
decision-making, 12
declaration standards, variable, 96
declaration, function, 35
declarations, formatting, 98
default values for arguments, 42
default variable values, 48
defensive programming, 108
DegToRad Cicode function, 270
DelayShutdown Cicode function, 269
DevAppend Cicode function, 270
DevClose Cicode function, 271
DevControl Cicode function, 271
DevCurr Cicode function, 272
DevDelete Cicode function, 272
DevDisable Cicode function, 273
DevEOF Cicode function, 274
DevFind Cicode function, 274
DevFirst Cicode function, 275
DevFlush Cicode function, 276
Index
DspCol Cicode function, 305
DspDel Cicode function, 305
DspDelayRenderBegin Cicode function, 306
DspDelayRenderEnd Cicode function, 307
DspDirty Cicode function, 308
DspError Cicode function, 308
DspFile Cicode function, 309
DspFileGetInfo Cicode function, 310
DspFileGetName Cicode function, 310
DspFileScroll Cicode function, 311
DspFileSetName Cicode function, 312
DspFont Cicode function, 312
DspFontHnd Cicode function, 314
DspFullScreen Cicode function, 315
DspGetAnBottom Cicode function, 316
DspGetAnCur Cicode function, 316
DspGetAnExtent Cicode function, 317
DspGetAnFirst Cicode function, 317
DspGetAnFromPoint Cicode function, 318
DspGetAnHeight Cicode function, 319
DspGetAnLeft Cicode function, 319
DspGetAnNext Cicode function, 320
DspGetAnRight Cicode function, 320
DspGetAnTop Cicode function, 320
DspGetAnWidth Cicode function, 321
DspGetEnv Cicode function, 321
DspGetMouse Cicode function, 322
DspGetNearestAn Cicode function, 322
DspGetParentAn Cicode function, 323
DspGetSlider Cicode function, 323
DspGetTip Cicode function, 324
DspGrayButton Cicode function, 324
DspInfo Cicode function, 325
DspInfoDestroy Cicode function, 327
DspInfoField Cicode function, 328
DspInfoNew Cicode function, 329
DspInfoValid Cicode function, 330
DspIsButtonGray Cicode function, 330
DspKernel Cicode function, 331
DspMarkerMove Cicode function, 332
DspMarkerNew Cicode function, 332
DspMCI Cicode function, 333
DspPlaySound Cicode function, 334
DspPopupMenu Cicode function, 335
DspRichText Cicode function, 337
E
EngToGeneric Cicode function, 361
EnterCriticalSection Cicode function, 361
ErrCom Cicode function, 362
ErrDrv Cicode function, 362
ErrGetHw Cicode function, 363
ErrHelp Cicode function, 365
ErrInfo Cicode function, 365
ErrLog Cicode function, 366
ErrMsg Cicode function, 366
error Cicode functions, 123
error handling, 109
error messages, 737
error trapping, 111
errors
Cicode, 737
general, 737
Hardware Cicode errors, 737
923
924
Index
ErrSet Cicode function, 367
ErrSetHw Cicode function, 368
ErrSetLevel Cicode function, 369
ErrTrap Cicode function, 370
escape sequence character, 17
escape sequences, 60
evaluating functions, 15
event Cicode functions, 124
Event parameters, 815
events
handling, 73
triggering, 12
Exec Cicode function, 371
ExecuteDTSPkg Cicode function, 372
execution, code, 74
Exp Cicode function, 373
expression data, logging, 12
expressions, 11
decision-making and, 12
decision-making with, 12
triggering events using, 12
expressions, formatting, 100
F
Fact Cicode function, 374
file Cicode functions, 124
file headers, 28
FileClose Cicode function, 374
FileCopy Cicode function, 375
FileDelete Cicode function, 376
FileEOF Cicode function, 376
FileExist Cicode function, 376
FileFind Cicode function, 377
FileGetTime Cicode function, 378
FileMakePath Cicode function, 378
FileOpen Cicode function, 379
FilePrint Cicode function, 380
FileRead Cicode function, 380
FileReadBlock Cicode function, 381
FileReadLn Cicode function, 381
FileRename Cicode function, 382
FileRichTextPrint Cicode function, 382
files
include, 7
using, 2
Files window, 88
FileSeek Cicode function, 383
FileSetTime Cicode function, 384
FileSize Cicode function, 384
FileSplitPath Cicode function, 385
FileWrite Cicode function, 385
FileWriteBlock Cicode function, 386
FileWriteLn Cicode function, 387
FmtClose Cicode function, 416
FmtFieldHnd Cicode function, 416
FmtGetField Cicode function, 417
FmtGetFieldHnd Cicode function, 418
FmtOpen Cicode function, 418
FmtSetField Cicode function, 419
FmtSetFieldHnd Cicode function, 419
FmtToStr Cicode function, 420
Font parameters, 816
foreground tasks, 75
form Cicode functions, 125
FormActive Cicode function, 387
FormAddList Cicode function, 388
format Cicode functions, 126
format operator (
), 57
formatting
comments, 101
expressions, 100
function headers, 104
functions, 101
simple declarations, 98
text strings, 59
formatting statements, 99
FormButton Cicode function, 388
FormCheckBox Cicode function, 389
FormComboBox Cicode function, 391
FormCurr Cicode function, 392
FormDestroy Cicode function, 393
FormEdit Cicode function, 393
FormField Cicode function, 394
FormGetCurrInst Cicode function, 396
FormGetData Cicode function, 397
FormGetInst Cicode function, 397
FormGetText Cicode function, 398
FormGoto Cicode function, 399
FormGroupBox Cicode function, 399
Index
FormInput Cicode function, 400
FormListAddText Cicode function, 401
FormListBox Cicode function, 402
FormListDeleteText Cicode function, 403
FormListSelectText Cicode function, 404
FormNew Cicode function, 405
FormNumPad Cicode function, 406
FormOpenFile Cicode function, 407
FormPassword Cicode function, 408
FormPosition Cicode function, 409
FormPrompt Cicode function, 409
FormRadioButton Cicode function, 410
FormRead Cicode function, 411
FormSaveAsFile Cicode function, 412
FormSelectPrinter Cicode function, 413
FormSetData Cicode function, 413
FormSetInst Cicode function, 414
FormSetText Cicode function, 414
FormWndHnd Cicode function, 415
FTP Cicode functions, 126
FTPClose Cicode function, 420
FTPFileCopy Cicode function, 421
FTPFileFind Cicode function, 421
FTPOpen Cicode function, 422
FullName Cicode function, 423
function headers, 104
function libraries, 27
functions
arguments and, 16
Assert, 112
debugging, 30
DebugMsg, 111
declaration, 35
evaluating, 15
event handling, 73
formatting, 101
groups, 27
keyboard, 23
libraries, 27
miscellaneous, 23
page, 22
report, 23
returning values, 43
scope of, 33
structure of, 25
syntax, 32
table, 55
time and date, 23
FuzzyClose Cicode function, 423
FuzzyGetCodeValue Cicode function, 423
FuzzyGetShellValue Cicode function, 424
FuzzyOpen Cicode function, 425
FuzzySetCodeValue Cicode function, 426
FuzzySetShellValue Cicode function, 426
FuzzyTech Cicode functions, 126
FuzzyTrace Cicode function, 427
G
General errors, 737
General parameters, 817
GetArea Cicode function, 427
GetBlueValue Cicode function, 428
GetEnv Cicode function, 428
GetEvent Cicode function, 428
GetGreenValue Cicode function, 431
GetPriv Cicode function, 432
GetRedValue Cicode function, 432
Global variable window, 85
group Cicode functions, 127
groups of functions, 27
GrpClose Cicode function, 433
GrpDelete Cicode function, 433
GrpFirst Cicode function, 434
GrpIn Cicode function, 434
GrpInsert Cicode function, 435
GrpMath Cicode function, 435
GrpName Cicode function, 436
GrpNext Cicode function, 437
GrpOpen Cicode function, 437
GrpToStr Cicode function, 438
H
Halt Cicode function, 439
handling events, 73
handling, error, 109
hardware alarms, 737
Hardware Cicode errors, 737
headers, file, 28, 103
headers, function, 104
925
926
Index
HexToStr Cicode function, 439
HighByte Cicode function, 440
HighWord Cicode function, 440
I
I/O device Cicode functions, 127
I/OServer parameters, 836
include files, 7
InfoForm Cicode function, 441
InfoFormAn Cicode function, 441
Input Cicode function, 442
input, runtime operator, 8
integers, 57
Internet parameters, 828
Intl parameters, 834
IntToReal Cicode function, 443
IntToStr Cicode function, 443
IODeviceControl Cicode function, 444
IODeviceInfo Cicode function, 447
IODeviceStats Cicode function, 451
IsError Cicode function, 451
K
KerCmd Cicode function, 452
kernel parameters, 845
KeyAllowCursor Cicode function, 452
keyboard Cicode functions, 128
keyboard functions, 23
keyboard parameters, 847
KeyBs Cicode function, 453
KeyDown Cicode function, 454
KeyGet Cicode function, 454
KeyGetCursor Cicode function, 455
KeyLeft Cicode function, 456
KeyMove Cicode function, 456
KeyPeek Cicode function, 457
KeyPut Cicode function, 457
KeyPutStr Cicode function, 458
KeyReplay Cicode function, 458
KeyReplayAll Cicode function, 459
KeyRight Cicode function, 459
KeySetCursor Cicode function, 460
KeySetSeq Cicode function, 460
KeyUp Cicode function, 461
L
labels, 97
LAN parameters, 849
language parameters, 859
LanguageFileTranslate Cicode function, 461
LeaveCriticalSection Cicode function, 462
libraries of functions, 27
LLC parameters, 779
LLClose Cicode function, 290
Ln Cicode function, 463
Log Cicode function, 463
logging expression data, 12
logic, 12
logical operators, 65
Login Cicode function, 464
LoginForm Cicode function, 464
Logout Cicode function, 465
LogoutIdle Cicode function, 465
LowByte Cicode function, 466
LowWord Cicode function, 466
M
mail Cicode functions, 128
MailError Cicode function, 467
MailLogoff Cicode function, 467
MailLogon Cicode function, 467
MailRead Cicode function, 468
MailSend Cicode function, 469
MakeCitectColour Cicode function, 470
math/trigonometry Cicode functions, 129
mathematical operators, 63
Max Cicode function, 471
memory parameters, 862
Message Cicode function, 471
messages, error, 737
Min Cicode function, 472
miscellaneous Cicode functions, 130
miscellaneous functions, 23
modular programming, 105, 106, 107
module variables, 49
MsgBrdcst Cicode function, 473
MsgClose Cicode function, 473
MsgGetCurr Cicode function, 474
MsgOpen Cicode function, 474
MsgRead Cicode function, 476
Index
MsgRPC Cicode function, 477
MsgState Cicode function, 479
MsgWrite Cicode function, 480
multiple argumentsarguments
multiple, 18
multiple statements, 6
multitasking, 74, 76
N
Name Cicode function, 480
naming standards, variables, 97
O
ObjectAssociateEvents Cicode function, 481
ObjectAssociatePropertyWithTag Cicode function,
482
ObjectByName Cicode function, 483
ObjectHasInterface Cicode function, 483
ObjectIsValid Cicode function, 484
ObjectToStr Cicode function, 484
OID parameters, 863
OLEDateToTime Cicode function, 485
one-dimensional variable arrays, 53
OnEvent Cicode function, 485
operator precedence, 66
operator, format, 57
operators
bit, 64
logical, 65
relational, 64
operators, data, 63
Output window, 85
P
PackedRGB Cicode function, 489
PackedRGBToCitectColour Cicode function, 489
page Cicode functions, 131
page functions, 22
page parameters, 864
PageAlarm Cicode function, 490
PageDisabled Cicode function, 490
PageDisplay Cicode function, 491
PageFile Cicode function, 492
PageFileInfo Cicode function, 493
927
928
Index
PrintLn Cicode function, 529
privilege parameters, 878
processing, 74
programming standards, 95
programming, modular, 105
ProjectRestartGet Cicode function, 530
ProjectRestartSet Cicode function, 531
ProjectSet Cicode function, 531
Prompt Cicode function, 532
protocol parameters, 878
proxi parameters, 879
pseudocode, 28
public scopeprivate scope, 33
Pulse Cicode function, 532
Q
QueClose Cicode function, 533
QueLength Cicode function, 533
QueOpen Cicode function, 534
QuePeek Cicode function, 535
QueRead Cicode function, 536
QueryFunction Cicode function, 537
QueWrite Cicode function, 538
R
RadToDeg Cicode function, 539
Rand Cicode function, 539
RealToStr Cicode function, 540
relational operators, 64
RemoteDB parameters, 880
RepGetControl Cicode function, 540
Report Cicode function, 541
report Cicode functions, 132
report functions, 23
report parameters, 882
RepSetControl Cicode function, 542
ReRead Cicode function, 544
returning data from functions, 19
returning values from functions, 43
Round Cicode function, 545
rules, parameter, 747
runtime operator input, 8
runtime operator input triggering, 15
S
scope, 48, 96
scope, function, 33
security Cicode functions, 132
SemClose Cicode function, 545
SemOpen Cicode function, 546
SemSignal Cicode function, 546
SemWait Cicode function, 547
SendKeys Cicode function, 548
sequences, escape, 60
SerialKey Cicode function, 550
server parameters, 885
ServerInfo Cicode function, 550
SetArea Cicode function, 552
SetEvent Cicode function, 553
SetLanguage Cicode function, 555
setting
parameters, 747
variables, 5
Shutdown Cicode function, 557
shutdown parameters, 886
ShutdownForm Cicode function, 559
ShutdownMode Cicode function, 560
Sign Cicode function, 557
Sin Cicode function, 557
Sleep Cicode function, 560
SleepMS Cicode function, 561
source file headers, 103
SPC Cicode functions, 133
SPC parameters, 887
SPCAlarms Cicode function, 562
SPCClientInfo Cicode function, 563
SPCGetHistogramTable Cicode function, 565
SPCGetSubgroupTable Cicode function, 566
SPCPlot Cicode function, 567
SPCProcessXRSGet Cicode function, 568
SPCProcessXRSSet Cicode function, 569
SPCSetLimit Cicode function, 570
SPCSpecLimitGet Cicode function, 571
SPCSpecLimitSet Cicode function, 572
SPCSubgroupSizeGet Cicode function, 572
SPCSubgroupSizeSet Cicode function, 573
SQL Cicode functions, 133
SQL parameters, 891
SQLAppend Cicode function, 574
Index
SQLBeginTran Cicode function, 575
SQLCommit Cicode function, 576
SQLConnect Cicode function, 577
SQLDisconnect Cicode function, 580
SQLEnd Cicode function, 580
SQLErrMsg Cicode function, 581
SQLExec Cicode function, 582
SQLFieldInfo Cicode function, 585
SQLGetField Cicode function, 587
SQLInfo Cicode function, 587
SQLNext Cicode function, 588
SQLNoFields Cicode function, 589
SQLNumChange Cicode function, 589
SQLRollBack Cicode function, 590
SQLSet Cicode function, 590
SQLTraceOff Cicode function, 591
SQLTraceOn Cicode function, 592
Sqrt Cicode function, 592
Stack window, 86
standards, 97
standards, naming, for variables, 97
standards, programming, 95
statements
using multiple, 6
statements, executable, 99
stepping through code, 94
StrClean Cicode function, 592
StrFill Cicode function, 593
StrFormat Cicode function, 593
StrGetChar Cicode function, 594
string arguments, 16
string Cicode functions, 134
strings, 57
strings, formatting, 59
StrLeft Cicode function, 594
StrLength Cicode function, 595
StrLower Cicode function, 595
StrMid Cicode function, 596
StrPad Cicode function, 596
StrRight Cicode function, 597
StrSearch Cicode function, 597
StrSetChar Cicode function, 598
StrToChar Cicode function, 599
StrToDate Cicode function, 599
StrToFmt Cicode function, 600
T
table (array) Cicode functions, 136
TableLookup Cicode function, 610
TableMath Cicode function, 611
TableShift Cicode function, 612
TagDebug Cicode function, 613
TagInfo Cicode function, 613
TagRamp Cicode function, 615
TagRead Cicode function, 616
TagScaleStr Cicode function, 617
TagWrite Cicode function, 618
Tan Cicode function, 619
task Cicode functions, 136
TaskGetSignal Cicode function, 620
TaskHnd Cicode function, 620
TaskKill Cicode function, 621
TaskNew Cicode function, 622
TaskResume Cicode function, 623
tasks
controlling, 75
tasks, foreground and background, 75
TaskSetSignal Cicode function, 624
TaskSuspend Cicode function, 624
TestRandomWave Cicode function, 625
TestSawWave Cicode function, 625
929
930
Index
TestSinWave Cicode function, 626
TestSquareWave Cicode function, 627
TestTriangWave Cicode function, 628
text files, 7
text strings, formatting, 59
Thread window, 86
threads, 74, 75
time and date Cicode functions, 137
Time Cicode function, 628
time functions, 23
time parameters, 892
TimeCurrent Cicode function, 629
TimeHour Cicode function, 630
TimeInfo Cicode function, 630
TimeMidNight Cicode function, 631
TimeMin Cicode function, 632
TimeSec Cicode function, 633
TimeSet Cicode function, 633
TimeToOLEDate Cicode function, 635
TimeToStr Cicode function, 635
TimeUTCOffset Cicode function, 637
Toggle Cicode function, 637
TraceMsg Cicode function, 637
trapping, error, 111
trend Cicode functions, 138
trend parameters, 893
TrendDspCursorScale Cicode function, 698
TrendDspCursorTag Cicode function, 698
TrendDspCursorTime Cicode function, 698
TrendDspCursorValue Cicode function, 699
TrendGetAn Cicode function, 700
TrendPopUp Cicode function, 700
TrendRun Cicode function, 701
TrendSetDate Cicode function, 701
TrendSetScale Cicode function, 702
TrendSetSpan Cicode function, 702
TrendSetTime Cicode function, 703
TrendSetTimebase Cicode function, 703
TrendWin Cicode function, 704
TrendZoom Cicode function, 706
triggering
runtime operator input, 15
triggering events, 12
TrnAddHistory Cicode function, 638
TrnClientInfo Cicode function, 639
Index
TrnScroll Cicode function, 686
TrnSelect Cicode function, 687
TrnSetCursor Cicode function, 688
TrnSetCursorPos Cicode function, 689
TrnSetDisplayMode Cicode function, 689
TrnSetEvent Cicode function, 691
TrnSetPen Cicode function, 691
TrnSetPenFocus Cicode function, 692
TrnSetPeriod Cicode function, 693
TrnSetScale Cicode function, 694
TrnSetSpan Cicode function, 695
TrnSetTable Cicode function, 695
TrnSetTime Cicode function, 697
U
UserCreate Cicode function, 706
UserCreateForm Cicode function, 707
UserDelete Cicode function, 707
UserEditForm Cicode function, 708
UserInfo Cicode function, 708
UserPassword Cicode function, 709
UserPasswordExpiryDays Cicode function, 710
UserPasswordForm Cicode function, 710
using
files, 2
multiple statements, 6
parameters, 747
V
variable arrays
functions, 55
one-dimensional, 53
variable scope, 48
variable tags, 97
variables, 4760
copying, 6
declaration standards, 96
default values for, 48
in calculations, 6
module, 49
naming standards, 97
scope standards, 96
setting, 5
Version Cicode function, 711
W
WhoAmI Cicode function, 724
Win parameters, 911
WinCopy Cicode function, 711
WinFile Cicode function, 712
WinFree Cicode function, 713
WinGetFocus Cicode function, 713
WinGetWndHnd Cicode function, 714
WinGoto Cicode function, 714
WinMode Cicode function, 715
WinMove Cicode function, 716
WinNew Cicode function, 716
WinNewAt Cicode function, 717
WinNext Cicode function, 719
WinNumber Cicode function, 720
WinPos Cicode function, 720
WinPrev Cicode function, 721
WinPrintCicode function, 721
WinPrintFile Cicode function, 722
WinSelect Cicode function, 723
WinSize Cicode function, 724
WinTitle Cicode function, 724
WndFind Cicode function, 725
WndGetFileProfile Cicode function, 726
WndGetProfile Cicode function, 726
WndHelp Cicode function, 727
WndInfo Cicode function, 729
WndPutFileProfile Cicode function, 730
WndPutProfile Cicode function, 731
WndShow Cicode function, 731
WndViewer Cicode function, 732
writing functions, 27
931
932
Index