citectscada csv include

130
CSV_Include Citect Pty. Limited 3 Fitzsimons Lane PO Box 174 Pymble NSW 2073 Australia Telephone: 61 2 9496 7300 Fax: 61 2 9496 7399

Upload: michael-adu-boahen

Post on 19-Jan-2016

399 views

Category:

Documents


29 download

DESCRIPTION

csv

TRANSCRIPT

Page 1: CitectSCADA CSV Include

CSV_Include

Citect Pty. Limited

3 Fitzsimons LanePO Box 174

Pymble NSW 2073Australia

Telephone: 61 2 9496 7300Fax: 61 2 9496 7399

Page 2: CitectSCADA CSV Include

DISCLAIMERCitect Corporation makes no representations or warranties with respect to this manual and, to the maximum extent permitted by law, expressly limitsits liability for breach of any warranty that may be implied to the replacement of this manual with another. Further, Citect Corporation reserves the rightto 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.

TRADEMARKSCitect 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, Exceland 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 NOTICESome product names used in this manual are used for identification purposes only and may be trademarks of their respective companies.

<insert month and year> edition for CitectSCADA Version 6.0

Manual Revision Version 6.0.

Printed in Australia.

Page 3: CitectSCADA CSV Include

Contents

Introducing CSV_IncludeWhere to Find Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Chapter 1 Using Pages and TemplatesNormal Page Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Alarm Page Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Common functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Trend Page Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Common functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6File Page Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Admin Tools Page Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10Common Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Navigation Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Alarms Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Chapter 2 Creating a New ProjectCreating a Privileged User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Running the Computer Setup Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Setting Up Instant Trending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Displaying a Project on Multiple Monitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Implementing Audible Alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Creating Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Creating new pages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Creating Custom Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

Menu Configuration tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Building custom menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Editing an item. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

Creating an Alarms Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Creating a Trends Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27Using Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

Chapter 3 CSV_Include ReferenceCitect.ini Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29[Alarm] Section Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30[MultiMonitors] Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32[Page] Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

Page 4: CitectSCADA CSV Include

Contentsiv

[Navigation] Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33[TrendX] Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37[Privilege] Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38CSV_Include Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Chapter 4 CSV_Example ProjectFilter page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115Filter Page (Engineers Notes) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116Loop Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116Loop Page (Engineers Notes) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116Recipe Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117Recipe Page (Engineers Notes) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117Genies Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118Genies Page (Engineers Notes) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118Operator Input Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119Dynamic Objects Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

Page 5: CitectSCADA CSV Include

Introducing CSV_Include

The CSV_Include Project is a preconfigured project that is installed with CitectSCADA Version 5.5 or later. Designed to reduce the amount of time required to configure a new project, it includes a set of templates and pages styled for the Windows XP environment.

When a new CitectSCADA project is created, the CSV_Include project is automatically incorporated as an included project. This means all the project's templates and associated content are available for implementation when creating your graphics pages in Graphics Builder.

Alongside a standard graphics page template for the creation of plant mimics, the project includes predefined trend and alarm display pages, an administration tools page, a file page for displaying text and Rich Text Format files, and a selection of popup windows. All feature common navigation and alarm menus for consistent functionality and appearance across an entire project. The project even supports multi monitor display, allowing a number of graphics pages to be simultaneously displayed across several computer screens.

Note: You should not modify the CSV_Include project for use as a runtime project, you should keep it set aside only for use as a template for new projects. This is because a future upgrade to CitectSCADA will install a new version of the CSV_Include project, and you will lose any changes you have saved when this happens.

Where to Find InformationThis information describes the preconfigured content in the CSV_Include Project:

Predefined pages and templates. See Using Pages and Templates.

Common toolbars. See Common Toolbars.

It also describes the processes used to create a project based on CSV_Include:

Creating a new project. See Creating a New Project.

Creating pages. See Creating Pages.

Creating custom menus. See Creating Custom Menus.

Creating an alarm group. See Creating an Alarms Group.

Creating a trend group. Creating a Trends Group.

Page 6: CitectSCADA CSV Include

Introducing CSV_Include2

Reference material is also included, describing the Citect.INI parameters and Cicode functions available to customize a project.

Page 7: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates

When you create a new project based on CSV_Include, the following templates and pages are available for you to use as you create your graphics pages. This section describes the pages and their features (buttons, menus, and tools)

The CSV_Include project has the following templates:

The project also includes the following preconfigured pages:

See Also Creating a New ProjectCreating Pages

Template Name DescriptionNormal Standard graphics pageAlarm Active alarm pageDisabled Disabled alarm pageSummary Summary alarm pageHardware Hardware alarm pageTrend Trend page (8 pens)Double Trend Split-page trend page (16 pens)File Displays a fileAdmin Tools Engineering tools pagePoptrend Popup trendInstanttrend Instant trendPopup_Small Small popup windowPopup_Mid Medium popup windowPopup_Large Large popup windowPopup_Xlarge Extra large popup window

Page Name DescriptionCSV_AdminTools Engineering tools pageCSV_Alarm Active alarm pageCSV_AlarmDisabled Disabled alarm pageCSV_AlarmSummary Summary alarm pageCSV_AlarmHardware Hardware alarm pageCSV_Trend Trend page (8 pens)CSV_TrendDouble Split-page trend page (16 pens)CSV_File File page

Page 8: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates4

Normal Page TemplateA template designed for the creation of user-required content and plant mimics. This page contains the standard navigation and alarm toolbars featured on all CSV_Include templates. If you are creating a project based on CSV_Include, use this template for all your standard graphics pages.

The Normal template creates a page in 1024 x 768 display format without a title bar, the default size for all pages in the CSV_Include project.

See Also Creating Pages

Alarm Page TemplatesTemplates are included for the following types of alarm displays:

Active Alarm Page (Alarm): Used to create a page displaying all of the audible alarms that are unacknowledged or acknowledged and still in alarm state. The preconfigured page CSV_Alarm is based on this template.

Hardware Alarm Page (Hardware): Used to create a page displaying details of any system errors that are unacknowledged or acknowledged and still in alarm state, for example, if a communication fault occurs, if Cicode can't execute, if a graphics page is not updating correctly, or if a server fails, this page will alert you to the problem. The preconfigured page CSV_AlarmHardware is based on this template.

Disabled Alarm Page (Disabled): Used to create a page displaying all of the alarms that are presently disabled in the system. The preconfigured page CSV_AlarmDisabled is based on this template. The alarms will appear on this page when they have been disabled from the normal alarm system due to a maintenance shutdown, nuisance tripping etc.

Alarm Summary Page (Summary): Used to create a page displaying a historical log of alarms that have occurred. The preconfigured page CSV_AlarmSummary is based on this template. This page can be used for trouble shooting purposes.

Common functionality The alarm page templates all share panels to the left of the alarms list that support the following functionality.

Acknowledge Tasks

Offers the option to acknowledge all alarms on the current page, to acknowledge just the selected alarm, or to silence the audible alarm. It is featured on the Active Alarms page and the Hardware Alarms page.

Page 9: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates 5

Alarm Page Tasks

Allows the user to navigate through the list of alarms a page at a time. The blue box indicates if more than one page is available to view.

Alarm List Filter Tasks

Allows the user to filter the current list based on plant area or by alarm category. To apply a particular filter, you firstly must configure an alarm group.

Trend Page TemplatesThe CSV_Include project includes templates for the four following types of trend display:

Trend: An eight-pen trend display. The preconfigured page CSV_Trend is based on this template.

DoubleTrend: A 2 x 8-pen trend display spread across a divided screen. The preconfigured page CSV_TrendDouble is based on this template.

PopTrend: A four-pen pop-up display that can be launched from other graphics pages.

InstantTrend: A popup window for instant display of a variable tag.

Page 10: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates6

The Trend, Double Trend and PopTrend displays allow you to select and display trend tags from your CitectSCADA project on a color-coded linear chart. Being based on information coming from the CitectSCADA trend server, these displays are supported by stored historical data that can be recalled if required.

The Instant Trend display is unique as it allows the selection of up to four variable tags for display. This allows you to visually monitor a tag without having to set it up within your CitectSCADA project as a trend tag. You can even load tags directly into the display by hovering the mouse over a tag value on a graphics page and keying in a plus sign (see the parameter [TrendX]KeySeq).

There are limitations to this feature, however, as data is only available from the time the display is launched and is lost when the display is closed. The Instant Trend feature has a duration setting that limits the amount of time the display can remain open, you can adjust the default setting for this via the parameter [TrendX]Duration.

For details on implementing instant trending, see Setting Up Instant Trending.

Common functionality The trend display templates share common controls that support the following functionality.

Selected Trend FieldDisplays information relating to the trend tag(s) currently being mapped in the trend chart, including a name, the current value and the scale range.

The field is color coded to match the graphical display, hence the colorful nature of the listed fields.

To load a trend into a Selected Trend field, right-click the field. A menu appears allowing you to select a trend or clear the field. Once you have loaded all your selected trends, you can make a particular pen the focus of the graph by clicking this field. An arrow to the left of the field indicates it is currently the focus trend.

Note that this field appears slightly different when using instant trending, as the graph will be displaying current data for a variable tag, not a trend tag. In this case, the selection field appears as below, with the tag name, current value, description and sample period displayed.

Page 11: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates 7

Range/Scale markersThese markers appear along the vertical axis and show the scale of the display for the currently selected pen, highlighting the lowest to highest values for the scale range.

Span markersThese markers appear along the horizontal axis, and show the span of the trend display in time. The left hand marker shows the current start time and date, the right shows the current end time and date. Typically the right hand marker will show the current time, however, this can be affected by zooming or displaying in Historical mode.

Set span buttonThis button allows you to call up an input dialog that sets the span of the current display. When you input a unit of time, the display will cover the defined period ending with the current time.

Trend cursorThe trend cursor allows you to select a location on the graphical trend display and determine the time and date for that particular point. The arrows to the left end of the popup display allow you to move the cursor to the left or right. The Exit icon to the right closes the trend cursor.

History modeHistory mode allows you to scroll back and forth through a graphical representation of a trend tag's history. To switch into History Mode, check the

Page 12: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates8

Display History Mode checkbox. The display changes to lower version of the control shown to the left.

The four buttons allow you to progress backwards and forwards through the trend graph, with the two outer buttons shifting a page at a time, and the two inner buttons shifting half a page. The clock icon allows you to edit the end time for the historical display.

Deselecting the box returns to the normal trend view.

ZoomThese buttons zoom in and out on the current display. Zoom in (+) increases the focus of the display, and continues zooming in on subsequent clicks. Zoom out (-) returns to the default.

AutoscaleThis button allows you to autoscale the current view, which means the scale will adjust to the lowest and highest values reached.

Scale defaultsThis buttons returns the scale for the display to the default for the currently selected trend.

Export to fileClick this button to export the data for the currently displayed trend to a file. A Save As dialog will appear, allowing you to save the data as a D Base III file (.DBF file), a comma separated value file (.CSV file) or a text file (.TXT).

Page 13: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates 9

Paste to clipboardClick this button to send the data for the currently displayed trend to the Windows clipboard.

Plot trendClick this button to plot the trend to a printer. You should use this button for printing a trend graph instead of the Print Page button. A dialog will appear allowing you to configure the printer setup.

Trend groupThe folder icon allows you to load a trend group. A dialog will appear listing all the currently configured groups. It also allows you to clear all currently displayed variable tags. See Creating a Trends Group.

File Page TemplatesThis template is used to create a page that can display text (.txt) or rich format text (.rtf) files.

To understand how a file page works, you must distinguish between the file page and the file that is presented on the page; for the file page merely acts as a blank palette to a variety of files.

The file page is displayed whenever the function CSV_Nav_File is called. When executed, CSV_Nav_File determines the file that is to be displayed on the file page, its location, the title applied to the page, and whether or not the file is editable.

For example, you may configure a menu item that calls up the following:

?CSV_Nav_File(MyPageTitle,[Run]:\file.txt,2)

This would call up the file page, put the title "MyPageTitle" on the title bar, load the file called File.txt from the Run directory, and allow the file to be edited (with the last argument set to 2, the file can be saved).

The parameter [Navigation]FilePage determines the page that's used as the palette for this process. The preconfigured page CSV_File is the default. You can change the setting for Navigation[FilePage], however, you must ensure that

Page 14: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates10

any page you specify for this parameter is based on the CSV_File template, otherwise CSV_Nav_File will not be able to execute properly.

Admin Tools Page TemplateThis template is used to create a page that features network and local machine statistics, and allows the user to launch Citect configuration tools and Windows applications. The preconfigured page CSV_AdminTools is based on this template.

The panels to the left of this page launch the following configuration tools:

Windows applications: Allows the user to launch the listed Windows Applications from within the runtime environment.

Citect Configuration: Allows the user to launch the listed Citect configuration tools from within the runtime environment. This includes viewing and editing the Citect.INI file, running the Computer Setup Wizard, creating alarm groups, trend groups, and launching the Menu Configuration tool.

Citect Kernel: Launches the various components of the Citect Kernel, allowing the system to be debugged from within the runtime environment.

System / Hardware: I/O Device Stats launches a dialog displaying IO device statistics. The Next and Previous buttons allow you to step through the IO devices connected to the system, while the Search button allows you to view statistics for a particular device.

The Tag Debug tool allows you to browse a list of available tags and read the current value for a selected tag. Depending on your access privileges, you may also be able to write a new value to the tag.

The right-hand side of this page displays statistics about the CitectSCADA system:

System Information: Provides details of the CPU usage, memory usage and available disk space for the current runtime machine.

Citect Information: Provides information about the CitectSCADA system including version information and the number of trend, alarm and report clients currently connected

I/O Server: Provides information about the status of the CitectSCADA IO Server your system is connected to. The name of the IO Server machine appears in the title bar of this panel. The information displayed includes: Maximum - the overall maximum response time (ms)

Average: Overall average response time (ms).

Minimum: Overall minimum response time (ms).

Page 15: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates 11

Read Request: Total read requests per second.

Read Physical: Total physical read requests per second.

Write Request: Total write requests per second.

Write Physical: Total physical write requests per second.

The Reset button allows you to clear the current values and recalculate them.

Timekeeping: The Set Date and Set Time fields function as buttons that call up an input dialog for entering a new date and time for the local computer. The Set Master Time field sends the local time to the CitectSCADA time server, which in turn sends the date and time to all CitectSCADA machines on the current network.

Common ToolbarsAll the pages in the CSV_Include project include common toolbars that provide easy navigation and access to key functionality, as well as a consistent appearance.

The following three toolbars remain on screen during operation:

Navigation toolbar: Provides navigation buttons and direct access to key pages such as the Trends page and Admin Tools page.

Alarm toolbar: Provides access to Alarms pages and displays the last three active alarms.

Custom Menus toolbar: Provides menus capable of navigating to a specific page or calling a Cicode function. The content of the menus is generated at runtime using a lookup table.

Page 16: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates12

See Also Navigation ToolbarAlarms ToolbarCreating Custom Menus

Navigation ToolbarThe Navigation toolbar includes buttons that allow the user to move between a project’s pages. If the current user has insufficient privilege or there is no option configured for a particular button, it is unavailable to the user.

Back buttonTakes you back to the page that was displayed prior to the current page. The arrow to the right of the button allows you to select from a drop-down list of recently visited pages. You can set the maximum number of pages included in this drop-down list by adjusting the parameter [Navigation]LastPageStackSize.

Forward button Takes you back to the page that was displayed prior to the back button being pressed. The arrow to the right of the button allows you to select from a drop-down list of pages you've recently navigated back from. You can set the

Page 17: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates 13

maximum number of pages included in this drop-down list by adjusting the parameter [Navigation]LastPageStackSize.

Parent Page buttonChanges the display to the “parent page” of the current page. You can assign a parent page to a graphics page by setting an environment variable in Graphics Builder.To do this, open the page you would like to assign a parent to. Go to the properties dialog for the page (File | Properties), and click on the Environment tab. Add a new variable called “ParentPage”, with a value of the page name of the parent page.

Previous/Next buttonsMove back and forth through the pages in a browse sequence, if one has been configured.

To configure a browse sequence, go to the Page Properties dialog (File | Properties) for each page in the sequence and set the Next and Previous fields on the General tab accordingly.

Home Page buttonThis button displays the "home" page. By default, this page is the startup page CSV_Start. If you want to change the home page to a different page, it can be adjusted via the parameter [Navigation]HomePage.

Trends Page buttonDisplays the “trend” page. By default, the preconfigured page CSV_Trend will appear when this button is pressed. If you want a different page to appear instead, adjust the parameter [Navigation]TrendPage.

Network Page buttonUsed to display a page called "Network" if one exists. By default, this page does not exist, which means the button will not appear. If you would like to use this

Page 18: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates14

button to call a function, or to launch a page with a name other than network, adjust the parameter [Navigation]NetworkPage.

Tools buttonThis button displays the Admin Tools page, named CSV_AdminTools. You can adjust the parameter [Navigation]ToolsPage if you want to call a function with this button or change the page that's displayed; however, this is not recommended. This button also features a menu to launch the Tag Debug tool and Instant Trend display. It also allows you to switch tool tips on and off.

Print Page buttonThis button will print the current page. The parameter [Printer]Port needs to be configured correctly for printer selection.

Login buttonCalls up the standard CitectSCADA login prompt. The drop-down menu to the right offers additional options, including Logout, Change Password, Edit User (restricted by login) and Create User (restricted by login).

Help buttonUsed to display help information relevant to your project. The action this button triggers is determined by the parameter [Navigation]Help.

Note that the default setting for this parameter calls a page called "Help", which does not actually exist in the CSV_Include project. Therefore, to make this button work, you must do one of the following:

Add a page called "Help" to your project, or adjust this parameter so that a page with a different name is called.

Apply an action to the button so that an online Help file (a .HLP or .CHM file) is launched. You have to use the format:

Page 19: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates 15

[Navigation]HelpPage = ?LaunchOnlineHelp

where LaunchOnlineHelp is a Cicode function that launches the required Help file.

Implement page-based Help by setting an environmental variable called HelpPage for each particular page. To do this, open the required page, go to the properties dialog (File | Properties), and click the Environment tab. Add a new variable called HelpPage with a value of a real page name or a function name.

See Also Alarms ToolbarCreating Custom Menus

Alarms ToolbarThe Alarms toolbar provides access to current alarm information and navigation buttons for single-click access to alarm pages. It also include the standard Citect prompt and current date and time.

The Last AlarmsThe centre panel of the toolbar displays the last three alarms triggered within the system, providing the operator with an immediate visual cue to alarm occurrences.

You can modify the format of this list and control which alarms appear. For example, you can set the list to only display alarms of a particular type, category or priority. For more information, see the parameters LastAlarmFmt, LastAlarmCategories, LastAlarmPriorities, and LastAlarmType.

Active Alarms buttonChanges the display to the active alarms page, CSV_Alarm. This button is animated and will blink when there is an unacknowledged alarm in the system. This action performed by this button is determined by the parameter [Navigation]AlarmPage.

Page 20: CitectSCADA CSV Include

Chapter 2: Using Pages and Templates16

Alarms Summary buttonChanges the display to the alarm summary page, CSV_AlarmSummary, which provides a historical log of alarm occurrences.This action performed by this button is determined by the parameter [Navigation]SummaryPage.

Hardware Alarms buttonChanges the display to the hardware alarms page, CSV_AlarmHardware. This is an animated button which will blink when an unacknowledged hardware alarm occurs. This action performed by this button is determined by the parameter [Navigation]HardwarePage.

Disabled Alarms buttonThis button changes the display to the disabled alarms page, CSV_AlarmDisabled. This action performed by this button is determined by the parameter [Navigation]DisabledPage .

Alarm Silence buttonThis button will silence the audible alarm buzzer that sounds when an alarm occurs. See Implementing Audible Alarms.

See Also Creating Custom Menus

Page 21: CitectSCADA CSV Include

Chapter 3: Creating a New Project

Creating a project based on the CSV_Include project is simple; by default, it is incorporated as an included project in all new projects. This means whenever you commence configuration of a new project, the CSV_Include pages and templates are ready to use as required.

There is, however, a series of steps you should follow when initiating a new project to simplify configuration and ensure that the CSV_Include project works properly:

1 Create a privileged user; see Creating a Privileged User.

2 Run the Computer Setup Wizard; see Running the Computer Setup Wizard.

3 Set up instant trending; see Setting Up Instant Trending.

4 Set up multiple monitor display; see Displaying a Project on Multiple Monitors.

5 Implement audible alarms; see Implementing Audible Alarms.

Do not modify the CSV_Include project for use as a runtime project; keep it set aside for use as a template for new projects. This is because a future upgrade to CitectSCADA will install a new version of the CSV_Include project, and you will lose any changes you have saved.

If creating a project based on the CSV_Include templates, do not include any pages based on templates using a different style, including the earlier Include project. This will impact on the consistent appearance of a project and may affect functionality.

See Also Creating Pages

Creating a Privileged UserSome CSV_Include project content is protected via a user login. Without a valid login, some functionality within the project will be disabled. For example, the Tools page is mostly inactive if you log in as a user with restricted privileges.

By default, the following elements within the CSV_Include project are protected by global privileges.

Element Global Privilege Associated FunctionAdmin Tools page 8 [Privilege]EngToolsEditing users 8 [Privilege]EditUserProject shutdown 0 [Privilege]Shutdown

Page 22: CitectSCADA CSV Include

Chapter 3: Creating a New Project18

When configuring a CSV_Include project, make sure your users have appropriate access to the available functionality. Ensure that your users can acknowledge alarms if required, and that they have access to the full functionality of the Admin Tools page.

If you want to adjust the global privileges for the elements listed above to allow a more complex security architecture, adjust the [Privilege] parameters in the Citect.INI file. See the relevant link in the table above for more information.

See Also Running the Computer Setup Wizard

Running the Computer Setup WizardAs with all CitectSCADA projects, you must work complete the Computer Setup Wizard on any machine where a CSV_Include project will be run.

The way you set up a computer using the Wizard is largely at your control, however due to a couple of required settings, you must run the Computer Setup Wizard as a custom setup.

The relevant Wizard pages you will need to pay attention to are:

Events Setup pageThe CSV_Include project includes three preconfigured events.

CSV_TrendXClient: required to enable the Instant Trend feature

CSV_TrendXServer: required to enable the Instant Trend feature

CSV_AlarmClient: required to enable audible alarm siren

Ensure that you select and enable the required events from those listed above. To support the instant trend feature, both the CSV_TrendXClient and CSV_TrendXServer events must be enabled on the computer acting as your trend server. Only CSV_TrendXClient needs to be enabled on your runtime machines. To support audible alarms, you need to enable CSV_AlarmClient.

You should select all of the events unless you need to disable the associated functionality.

Security Setup - Control Menu pageThis page provides a Display Title Bar option. As the CSV_Include pages feature an XP-styled title bar, you should deselect this option as this will allow your project to run successfully in full-screen mode. You should run CSV_Include-based projects in full-screen mode.

Acknowledge alarms 1 [Privilege]AckAlarmsDisable alarms 8 [Privilege]DisableAlarms

Element Global Privilege Associated Function

Page 23: CitectSCADA CSV Include

Chapter 3: Creating a New Project 19

See Also Creating a Privileged UserSetting Up Instant TrendingImplementing Audible Alarms

Setting Up Instant TrendingInstant trending feature allows you to visually monitor a variable tag from your CitectSCADA project, without the need to configure it as a trend tag. Without the support of the CitectSCADA trend server to facilitate this functionality, the instant trend feature requires you to perform the following setup:

1 Enable the CSV_TrendX events. As described in Running the Computer Setup Wizard, you must enable the events CSV_TrendXClient and CSV_TrendXServer for instant trending to work. Ensure that both these events are enabled on the trend server computer, and that CSV_TrendXClient is enabled on any runtime machines where instant trending will be used.

2 Call the Instant Trend display. Ensure that any buttons or menu items you configure to launch the Instant Trend display call the function CSV_TrendX_Display(). You should call this function with no arguments set, as this will implement the default settings. This ensures the correct page is called with appropriate display settings.

3 Set the default display duration. The Instant Trend window only stays open for a set period of time. You should adjust the default period of time to suit your needs via the parameter [TrendX]Duration.

4 Configure the Tag Selection dialog. You can decide whether or not a list of current tags is loaded into the Tag Selection dialog when using the instant trend display. Having no tags appear in the selection dialog may be useful if your project has a large number of tags that takes a while to load. See the parameter [TrendX]EnableTagList.

5 Check the key sequence used to load tags. You can load tags directly into the Instant Trend display by hovering the mouse over a tag value on a graphics page and keying in a plus sign. However, you should confirm that this key sequence does not clash with the functionality of other applications. If you need to change the key sequence used for this feature, see the parameter [TrendX]KeySeq.

Note: The Instant Trend feature does not support variable tags of the type LONG or REAL.

See Also Trend Page Templates

Page 24: CitectSCADA CSV Include

Chapter 3: Creating a New Project20

Displaying a Project on Multiple MonitorsThe CSV_Include project can display several pages simultaneously across multiple computer screens. If you have the hardware required to run multiple monitors off a single computer, the CSV_Include can display a different page on up to six screens at a time.

To successfully run your project across multiple monitors, you must adjust the following parameters:

1 [MultiMonitors]Monitors. Adjust this parameter to indicate how many monitors you're project will be running on.

2 [MultiMonitors]StartupPagen. This parameter determines which page will appear on each monitor at startup. Note that you have to duplicate this parameter for each monitor. For example, StartupPage1 determines the page that appears on the first monitor at startup, StartupPage2 determines what appears on the second monitor, and so on.

Many types of hardware support multiple-monitor display. The CSV_Include project has been tested on a PC with multiple outputs from a single video card, but not on other architectures. The capability to display project pages on multiple screens may be impacted by hardware architectures that have not been tested.

Implementing Audible AlarmsThe CSV_Include project offers support for audible alarms. You can configure a project so that a selected wav file is sounded whenever an alarm of a particular priority is triggered. You can even assign different sounds to different alarm priorities, allowing the urgency of an alarm to be distinguishable from the sound it makes.

To implement audible alarms in your project:

1 Ensure any alarms you would like to trigger an audible alert are assigned to a category and given a particular priority.

2 Adjust the parameter [Alarm]Soundn. This parameter determines the wav file that is used when an alarm sounds, based on the priority of the alarm (n). For example, [Alarm]Sound1 identifies the .wav file that will be sounded whenever a priority 1 alarm is triggered.

3 If required, adjust the parameter [Alarm]SoundnInterval. This parameter determines how long the selected wav file sounds for, based on the priority of the alarm (n). For example, [Alarm]Sound1Interval sets the length of time a priority 1 alarm is sounded for.

4 Enable the CSV_AlarmClient event on any machine you would like an audible alert sounded from. You can enable this event from the Events Setup

Page 25: CitectSCADA CSV Include

Chapter 3: Creating a New Project 21

page of the Computer Setup Wizard. See Running the Computer Setup Wizard.

5 Ensure your users have appropriate privileges associated with their login to acknowledge alarms, otherwise they will not be able to silence an alarm. See Creating a Privileged User and the parameter [Privilege]AckAlarms.

See Also Alarm Page Templates

Creating PagesWhen considering the pages required for your project, first determine if you can use any of the predefined pages in the CSV_Include project:

There are also several pages that are accommodated by the Navigation toolbar that you'll need to create if required. Decide if the following pages would be useful in your project and create them using the appropriate name:

The links between the pages listed above and the buttons that call them are defined by the [Navigation] parameter settings within the Citect.INI file. If you want a button to call a page with a different name, adjust these parameter settings. For details see Citect.ini Parameters.

Creating new pages The Normal and Popup templates are designed with minimal content to enable the presentation of customer-required information and plant mimics.

Pages are created based on these templates within Graphics Builder by choosing the required template from the Use Template dialog (File | New Page). The CSV_Include templates are accessible by selecting csv_xp_01 from the Style field.

Page name Description CSV_Trend Default 8-pen Trend page, called from the Trend button on the Navigation

toolbar.CSV_Alarm Active Alarms page, called from the Alarms toolbar.CSV_AlarmHardware Hardware Alarms page, called from the Alarms toolbar.CSV_AlarmDisabled Disabled Alarms page, called from the Alarms toolbar.CSV_AlarmSummary Alarms Summary page, called from the Alarms toolbar.CSV_AdminTools Admin Tools page, called from the Tools button on the Navigation toolbar.

Page name Description Home Called from the Home button on the Navigation toolbar. Network Called from the Network button on the Navigation toolbar. Note that this

button does not display if a page called "Network" does not exist.Help Called from the Help button on the Navigation toolbar.

Page 26: CitectSCADA CSV Include

Chapter 3: Creating a New Project22

Note: If you try to launch a CSV template from within Citect Explorer, you must drill down to [Project Name]/Graphics/Templates/csv_xp_01/XGA to locate it.

The CSV_Include project can add rollover buttons to pages without the need to draw and configure multiple elements. You can add text to a page that has a button appear behind it whenever the cursor passes by. This is achieved by adding the function DspButtonRollOver() to a button's visibility property. No arguments are required.

See Also Using Pages and Templates

Creating Custom MenusThe Custom Menu Toolbar, located directly beneath the page title bar, allows you to create drop-down menus capable of calling a Cicode function or navigating to a specific page (i.e. to a specific plant mimic).

You can disable the menu bar on all pages by adjusting the parameter [Page]MenuDisable. If you need to disable the menu on a particular page, you can apply this parameter as an environmental variable. To do this, open the required page in Graphics Builder, go to the Properties dialog (File | Properties), and insert the parameter on the Environment tab.

Menu Configuration tool The content of the menus can be configured via the Menu Configuration tool, which is launched from the Citect Configuration panel of the Admin Tools page.

The Menu Configuration tool has two panels. The panel to the left represents the menus configured for the current project in a directory structure. The panel to the right includes information about the item currently selected in the left panel. The structure pictured above includes the default settings generated for any new projects based on the CSV_Include templates.

Page 27: CitectSCADA CSV Include

Chapter 3: Creating a New Project 23

The directory in the left panel is a graphical representation of a DBF lookup table that forms the basis of the menus displayed at runtime. The hierarchical structure is determined by the following fields within this table:

In the example pictured above, the Page is defined as "generic", indicating that the menus configured appear on all the pages within the project.

The Menu Names that appear are the five defaults: Pages, Trends, Alarms, File and Tools. The Pages menu is expanded, showing the Menu Item Update Page List. As Update Page List is the currently selected item, the fields associated with it are pictured in the right.

The fields you can expect to see associated with an item, as defined in the DBF table, are as follows:

Page The page field is defined as either “Generic” (as pictured above), or the name of a page within the project. Generic specifies that the menu is associated with all pages, a specific page name indicates the menus that will appear just on that particular page.

Menuname The name(s) of the menus included on the specified page. Menuitem The item(s) that appear within each menu.Submenu Any submenus that appear in a menu (optional). Note that adding a sub menu will

automatically remove the action defined for the menu item it is branched from, as the parent becomes a placeholder for the list of sub menus.

Action Either the name of the page to display or a Cicode function. If specifying a Cicode function, it must be prefixed by a question mark ("?").

Privilege The login privilege required to trigger the associated action.Disabled Indicates if the item is currently disabled (embossed). For example, if the current login does

not meet the required privilege set for the item (see above), this field will be set to True and the menu item will appear embossed to indicate its currently not active.

Checked Indicates if the menu item is currently checked (with a tick). True indicates Btnwidth Specifies the width of the button (optional).

Page 28: CitectSCADA CSV Include

Chapter 3: Creating a New Project24

Building custom menus Creating a custom menu entails adding the required pages, menus, and items to the Configure Menus directory structure, and then assigning the required action and privileges to each item. This is all achieved via right-click menus.

Right-clicking a branch in the directory displays a menu that provides access to the possible actions that can be performed on the current selection. In the example above, clicking the Generic page allows you to add a new page, add a new button to the generic page, delete the page, copy it, or save the configuration.

The right-click menu includes the following actions:

Edit Item Available when an Item is selected. This option calls up the Edit Item dialog, which allows you to define the fields associated with the current Item. In particular, it allows you to specify the action associated with the item. (See Editing a menu item below)

New Page Adds a new page to the menu configuration. Use this option to create new custom menus designed specifically for a particular page in your project. Note that the name you give the new page in the menu configuration must be identical to the name of the page in your project that you want the menus to be applied to.

New Button Adds a new menu button to the current page. New Item Adds a new item to the currently selected menu. New Sub Item Adds a sub item to the currently selected item. Note a sub item overwrites the

action configured for its parent item. The parent item becomes a label identifying the list of Sub Items assigned to it.

Delete Page Deletes the currently selected Page from the menu configurationDelete Button Deletes the currently selected Menu Button from the menu configurationDelete Item Deletes the currently selected Item from the menu configurationDelete Sub Item Deletes the currently selected Sub Item from the menu configuration

Page 29: CitectSCADA CSV Include

Chapter 3: Creating a New Project 25

Editing an item A menu item's functionality is configured via the Edit Item Menu dialog.

Use this dialog to identify the action an item will trigger, be it navigation to a specific page, or execution a function. To launch this dialog, right-click the item to configure and select Edit Item from the menu that appears.

You should fill out the fields as follows:

See Also Common Toolbars

Creating an Alarms GroupThe CSV_Include project allows you to use "alarm groups" to display a specific set of tags defined by the alarm category and area settings configured within the runtime CitectSCADA project.

Copy page Copies the currently selected page adds automatically pastes it to the end of the menu configuration. This option is useful if you want a page to include the generic page menu configuration, but with additional menus that only appear when the particular page is displayed. To achieve this, copy the generic page, rename it to match the page you would like to customize the menus for, then adds the required menus and items.

Save Save the current menu configuration

Action Indicate the name of the page to display, or a Cicode function. If specifying a Cicode function, it must be prefixed by a question mark ("?").

Privilege The login privilege required to trigger the action. Only users with appropriate access privileges will be able to use this item.

Disabled As this setting is determined automatically depending on the current user's access privileges, you should leave this set to False unless you want the item disabled by default.

Checked Again, you should leave this set to False unless you want the item checked by default. Button Width Leave this set to zero (0) as this will automatically set the menu button to the appropriate

width. If you want to set a specific width for the button, input the width in pixels.

Page 30: CitectSCADA CSV Include

Chapter 3: Creating a New Project26

For example, you could create a group defined by all category one alarms. This group could then be used as a filter to create a list of all the category one alarms currently displayed on the Active Alarms page.

Alarm groups are configured by clicking the appropriate link on the Citect Configuration panel to the left of the Admin Tools page. The functionality can also be added to a custom menu for easier access.

To configure an alarm group:

1 Go to the Admin Tools page of a runtime project by clicking the Tools but-ton.

2 Select Configure an Alarm Group from the Citect Configuration panel. The Configure Alarm Groups dialog appears.

3 In the Alarm Group Description box, key in the name you would like to use to identify the group.

4 In the Categories box, list the alarm categories configured in the Citect runtime project that you would like to use to define the group.

5 In the Area box, key in the areas defined in the Citect project that you would like to use to define the group.

6 Click Add.

The information to the right of the dialog indicates how many alarm groups are configured and where you are currently positioned in this list. You can scroll through the list of configured groups by using the up and down arrows.

To change a group, locate it in the list, make the required changes, then click Replace.

See Also Creating a Trends Group

Page 31: CitectSCADA CSV Include

Chapter 3: Creating a New Project 27

Creating a Trends GroupThe CSV_Include project allows you to use "trend groups" to display a specific set of trend tags. A trend group includes a set of up to eight variable tags that can be automatically loaded into a trend display without having to select each tag individually.

Trend groups are configured by clicking the appropriate link on the Citect Configuration panel to the left of the Admin Tools page. The functionality can also be added to a custom menu for easier access.

To configure a trend group:

1 Click the Tools button.

2 Select Configure a Trend Group from the Citect Configuration panel. The Configure Trend Groups dialog appears.

3 In the Description text box, key in the name you would like to use to identify the group.

4 In the Trend Pen text boxes, select the eight variable tags you would like the group to trend. The button to the right of each field calls up a list of the available tags within the CitectSCADA Runtime project.

5 In the Area text box, key in the areas defined in the Citect project that you would like to use to define the group.

6 Click Add.

Page 32: CitectSCADA CSV Include

Chapter 3: Creating a New Project28

The information to the right of the dialog indicates how many trend groups are configured and where you are currently positioned in this list. You can scroll through the list of configured groups by using the up and down arrows.

To change a group, locate it in the list of groups or browse to it using the selection button to the right of the Description text box, make the required changes, then click Replace.

See Also Creating an Alarms Group

Using Environment VariablesWhereas you can use parameters to apply specified rules to all your template pages, you can use environment variables to apply rules to specific pages. In this way, you can modify environment variables for any pages that require different functionality.

For example, to display a specific page, you'd specify the page name as the environment variable. To call a specific Cicode function, you'd specify the function name (with a "?" prefix), space, then a list of comma separated arguments, like this: ?WinPrint LPT1,0,0,Trend.pal. (The “?” indicates that the variable is to be interpreted as a function call rather than a page to display.)

Let's look at a more detailed example: usually the standard Print button is used for printing a graphics page in WYSIWYG format. If you have a text/html file displayed on the page, or perhaps a trend, you can create your own print function (for example, PrintTrend) and specify it in the environment variable, as ?PrintTrend. To reduce the amount of ink used, specify the WinPrint function with a user-defined palette. In this case it would be best to specify it as a parameter rather than an environment variable so that it applies to all pages.

Note: With the standard CSV_Include trend pages, you have the option to print the screen using the standard Print button or to plot the trend using the Trend Plot button. You should give the user both alternatives as they both serve different purposes.

Page 33: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference

Citect.ini ParametersThe table below shows parameter information for the sections within the citect.ini file.

Section Parameter[Alarm] Soundn

SoundnIntervalLastAlarmFmtLastAlarmCategoriesLastAlarmPrioritiesLastAlarmType

[Multimonitors] MonitorsScreenWidthLastPageStackSizeStartupPagen

[Page] MenuDisableDelayRepaint

[Navigation] HomePageNetworkPageTrendPageFilePageToolsPageHelpPageAlarmPageHardwarePageSummaryPageDisabledPageMenuXPosMenuYPosMenuBackColourMenuForeColour

[TrendX] KeySeqTagListEnableDuration

[Privilege] AckAlarmsDisableAlarmsEngToolsEditUserShutdown

Page 34: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference30

[Alarm] Section ParametersThe [Alarm] section contains the following parameters.

Soundn Determines the wav file that is used when an alarm sounds, based on the priority of the alarm (n). For example, [Alarm]Sound1 identifies the .wav file that will be sounded when a priority 1 alarm is triggered.

Allowable Values: Any valid wav file name, including a full directory path.

Note: You can use CitectSCADA's predefined path substitutions to locate a wav file; for example:

Sound1=[RUN]:Alarm1.wav.

Default Value: (no sound)

SoundnInterval Determines how long an alarm sounds for, based on the priority of the alarm (n). For example, [Alarm]Sound1Interval identifies how long the audible alert runs for when a priority 1 alarm is triggered.

Allowable Values: 250 - 30000 milliseconds

Default Value: 2000

LastAlarmFmt Specifies the columns and formatting used for the list of recent alarms on the alarms toolbar.

Note: This parameter is available to all CitectSCADA projects; however, its default value is different when implemented as part of project based on a CSV_Include templates.

Allowable Values: Any combination of Alarm Display Fields.

Default Value: {Time,12}{Date,12}^t{Name,15}^t{Desc,35}^t{State,9}

LastAlarmCategories Determines which alarms are displayed on the alarms toolbar, based on category. For example, if you want the list of alarms to just display category 1 alarms, you would set this parameter to 1.

Allowable Values: 1 - 16376

Default Value: 0 (all alarms)

Page 35: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 31

LastAlarmPriorities Determines which alarms are displayed on the alarms toolbar, based on priority. For example, if you want the list of alarms to just display priority 1 alarms, you would set this parameter to 1.

Allowable Values: 1 - 255

Default Value: 0 (all alarms)

LastAlarmType Determines which alarms are displayed in the alarms toolbar, based on type.

Allowable Values: 0 - 14

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 (non-hardware) alarms, i.e. Types 0 to 3, plus acknowledged OFF alarms.

Hardware alarms

5 - All active alarms, i.e. Types 6 and 7

6 - All unacknowledged alarms, ON and OFF

7 - All acknowledged ON alarms

8 - All disabled alarms

9 - All configured alarms, i.e. Types 5 to 8

Alarm Summary

10 - All summary alarms

Alarm General

11 - All ON alarms

12 - All OFF alarms

13 - All ON hardware alarms

14 -All OFF hardware alarms

Default Value: 0

Page 36: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference32

[MultiMonitors] ParametersThe [MultiMonitors] section contains the following parameters.

Monitors Indicates the number of monitors the project will be displayed on.

Allowable Values: 1 and above.

Note: The CSV_Include project has only been tested on a system with up to three monitors. System performance on more than three monitors has not been confirmed.

Default Value: 1

ScreenWidth Adjusts the displayed page to suit the width of the screen in pixels. If you are not running with the recommended default screen size of 1024 x 768, you should adjust this setting to match the screen width currently set in your computer's display properties.

Allowable Values: 640, 800, 1024, 1152, 1280, 1920, etc.

Default Value: 1024

LastPageStackSize Determines the maximum number of pages that can be included in the Back button’s drop-down list of previously visited pages.

Allowable Values: 1 - 10

Default Value: 10

StartupPagen Determines the pages that appear when starting up a multi monitor setup. For example, StartupPage1 determines the page that appears on the first monitor at startup, StartupPage2 determines what appears on the second monitor, and so on.

Allowable Values: Any valid page name

Default Value: The page named CSV_Start. If CSV_Start does not exist, the current setting for [Page]Startup will be used.

[Page] ParametersThe [Page] section contains the following parameters.

Page 37: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 33

MenuDisable Enables or disables the menu bar. If disabled, the available menus will not appear.

This parameter is available to all CitectSCADA projects, however, its usage is different when implemented as part of project based on a CSV_Include templates.

Allowable Values: 0 – menu bar enabled

1 – menu disabled

Default Value: 0

DelayRepaint Delays the loading of pages until all the animation points are updated, allowing an instant repaint of the page.

Allowable Values: 1 – delay repaint on

0 – delay repaint off

Default Value: 1

[Navigation] ParametersThe [Navigation] section contains the following parameters.

HomePage Determines the page that will appear, or the action that is triggered, when the Home button is selected from the Navigation toolbar.

Allowable Values: any valid page name, or the relevant function name if a particular action is required. To trigger a function you must prefix the function name with a question mark (?).

Default Value: CSV_Start

If no value is defined for this parameter, then the page set for [MultiMonitor]StartupPage1 will be loaded. If nothing is defined there, then the default CSV_Start will be used.

NetworkPage Determines the page that will appear, or the action that is triggered, when the Trend button is selected from the Navigation toolbar.

Allowable Values: any valid page name, or the relevant function name if a particular action is required. To trigger a function you must prefix the function name with a question mark (?).

Default Value: CSV_Trend

Page 38: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference34

TrendPage Determines the page that will appear, or the action that is triggered, when the Trend button is selected from the Navigation toolbar.

Allowable Values: any valid page name, or the relevant function name if a particular action is required. To trigger a function you must prefix the function name with a question mark (?).

Default Value: CSV_Trend

FilePage Determines the page that is loaded when the function CSV_Nav_File is used to display a text file (.txt or .rtf).

When executed, CSV_Nav_File determines the file that is to be displayed on the page, its location, the title that is applied to the page, and whether or not the file is editable. The page defined by this parameter merely provides a palette for this action. Therefore, you must ensure that any page you specify for this parameter must be based on the CSV_File template, otherwise the function will not be able to execute properly.

Allowable Values: the name of any page based on the CSV_File template

Default Value: CSV_File

ToolsPage Determines the page that will appear, or the action that is triggered, when the Admin Tools button is selected from the Navigation toolbar.

Allowable Values: any valid page name, or the relevant function name if a particular action is required. To trigger a function you must prefix the function name with a question mark (?).

Default Value: CSV_AdminTools

HelpPage Determines the page that will appear, or the action that is triggered, when the Help button is selected from the Navigation toolbar. Note that the default setting calls a page called "Help", which does not actually exist in the CSV_Include project. Therefore, to make this button work, you will have to perform one of the following:

1 Add a page called "Help" to your project, or adjust this parameter so that a page with a different name is called.

2 Apply an action to the button so that an online Help file (a .HLP or .CHM file) is launched. You have to use the format:[Navigation]

HelpPage = ?LaunchOnlineHelp

Page 39: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 35

where “LaunchOnlineHelp” is a Cicode function that launches the required Help file.

3 Implement page-based Help by setting an environmental variable called “HelpPage” for each particular page. To do this, open the required page, go to the properties dialog (File | Properties), and click on the Environment tab. Add a new variable called “HelpPage”, with a value of a real page name or a function name.

Allowable Values: any valid page name, or the relevant function name if a particular action is required. To trigger a function you must prefix the function name with a question mark (?).

Default Value: Help

AlarmPage Determines the page that will appear, or the action that is triggered, when the Current Alarms button is selected from the Alarms toolbar.

Allowable Values: any valid page name, or the relevant function name if a particular action is required. To trigger a function you must prefix the function name with a question mark (?).

Default Value: CSV_Alarm

HardwarePage Determines the page that will appear, or the action that is triggered, when the Hardware Alarms button is selected from the Alarms toolbar.

Allowable Values: any valid page name, or the relevant function name if a particular action is required. To trigger a function you must prefix the function name with a question mark (?).

Default Value: CSV_AlarmHardware

SummaryPage Determines the page that will appear, or the action that is triggered, when the Alarms Summary button is selected from the Alarms toolbar.

Allowable Values: any valid page name, or the relevant function name if a particular action is required. To trigger a function you must prefix the function name with a question mark (?).

Default Value: CSV_AlarmSummary

DisabledPage Determines the page that will appear, or the action that is triggered, when the Disabled Alarms button is selected from the Alarms toolbar.

Page 40: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference36

Allowable Values: any valid page name, or the relevant function name if a particular action is required. To trigger a function you must prefix the function name with a question mark (?).

Default Value: CSV_AlarmDisabled

MenuXPos Determines the horizontal point from the left of the screen where the menu bars begins.

Default Value: 2 pixels

It is not recommended that you change this parameter as it will impact on the logical appearance of your project pages.

MenuYPos Determines the vertical point from the top of the screen where the menu bars begins.

Default Value: 25 pixels

It is not recommended that you change this parameter as it will impact on the logical appearance of your project pages.

MenuBackColour Determines the background color used for the menu bar.

Allowable Values: 0x000000 - 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)

0x7F7F7F - (Dark Grey)

0x0000FF - (Light blue)

0x00FF00 - (Light green)

0x00FFFF - (Light cyan)

Page 41: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 37

0xFF0000 - (Light red)

0xFF00FF - (Light Magenta)

0xFFFF00 - (Yellow)

0xFFFFFF - (White)

Default Value: 130

MenuForeColour Determines the foreground color used for the menu bar.

Allowable Values: 0x000000 - 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)

0x7F7F7F - (Dark Grey)

0x0000FF - (Light blue)

0x00FF00 - (Light green)

0x00FFFF - (Light cyan)

0xFF0000 - (Light red)

0xFF00FF - (Light Magenta)

0xFFFF00 - (Yellow)

0xFFFFFF - (White)

Default Value: 225

[TrendX] ParametersThe [TrendX] section contains the following parameters.

Page 42: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference38

KeySeq Determines the key sequence used to automatically add tags to the Instant Trend display from a graphics page.

Default Value: + (plus sign)

It is recommended that you only change this parameter if the default setting conflicts with some other functionality on your system.

TagListEnable Determines whether a list of current tags is loaded into the Tag Selection dialog when using the instant trend display. Having no tags appear in the selection dialog may be useful if your project has a large number of tags that takes a while to load. If the list is disabled, you can still enter known tag names into the selection field.

Allowable Values: 0 = tag list disabled

1 = tag list enabled

Default Value: 1

Duration Determines the default length of time the instant trend window opens for when launched.

Allowable Values: 0, 0.25, 0.5 hours, etc.

or

1 – 192 hours

Default Value: 8

[Privilege] ParametersThe [Privilege] section contains the following parameters.

AckAlarms Determines the privilege level a user requires to acknowledge alarms.

Allowable Values: 0 - 8

Default Value: 1

DisableAlarms Determines the privilege level a user requires to disable alarms.

Allowable Values: 0 - 8

Default Value: 8

Page 43: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 39

EngTools Determines the privilege level a user requires to access the functionality on the Admin Tools page.

Allowable Values: 0 - 8

Default Value: 8

EditUser Determines the privilege level a user requires to edit users.

Allowable Values: 0 - 8

Default Value: 8

Shutdown Determines the privilege level a user requires to shutdown a project.

Allowable Values: 0 - 8

Default Value: 8

Page 44: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference40

CSV_Include FunctionsThe table below contains the CSV_Include categories of functions:

Function Category FunctionsCSV_Include Alarms CSV_Alarms_Ack

CSV_Alarms_AckHardwareCSV_Alarms_AckPageCSV_Alarms_AckRecCSV_Alarms_AdvFilterCSV_Alarms_AdvFilterConfigCSV_Alarms_AdvFilterQueryCSV_Alarms_AdvFilterSetDateTimeCSV_Alarms_CheckSoundCSV_Alarms_ClearGroupFilterCSV_Alarms_DisableCSV_Alarms_DisableRecCSV_Alarms_DspGroupFilterCSV_Alarms_DspGroupListCSV_Alarms_DspInfoCSV_Alarms_DspInfoRecCSV_Alarms_DspLastCSV_Alarms_EnableCSV_Alarms_EnableRecCSV_Alarms_GetAckPrivilege()CSV_Alarms_GetDisablePrivilege()CSV_Alarms_GetGroupFilterCSV_Alarms_GetGroupFilterIDCSV_Alarms_GetUniqueGroupNameCSV_Alarms_GroupAddCSV_Alarms_GroupConfig()CSV_Alarms_GroupRemoveCSV_Alarms_GroupEditCSV_Alarms_GroupFilterCSV_Alarms_GroupSelectCSV_Alarms_GroupsInit()CSV_Alarms_HelpCSV_Alarms_HelpRecCSV_Alarms_ListHeadingCSV_Alarms_ListHeadingFont()CSV_Alarms_PopupMenuCSV_Alarms_Sound()CSV_Alarms_SoundActive()CSV_Alarms_Silence()

Page 45: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 41

CSV_Include Database CSV_DB_BOFCSV_DB_CloseCSV_DB_EOF()CSV_DB_ExecuteCSV_DB_GetExecuteErrorCSV_DB_GetFieldCountCSV_DB_GetFieldIndexCSV_DB_GetFieldNameCSV_DB_GetFieldTextCSV_DB_GetRowCountCSV_DB_GetRowCurrentCSV_DB_GetRowFieldTextCSV_DB_MoveFirstCSV_DB_MoveLastCSV_DB_MoveNextCSV_DB_MoveOffsetCSV_DB_MovePrevCSV_DB_StandbyConnectionActiveCSV_DB_StrToSQL

CSV_Include Display CSV_Display_Display_LogoCSV_Display_Display_ServicePack()CSV_Display_Title()CSV_Display_Version()

CSV_Include File CSV_File_DisplayCSV_File_PrintCSV_File_Save

CSV_Include Form CSV_Form_CentreCSV_Form_Login()CSV_Form_NumPadCSV_Form_PositionCSV_Form_Shutdown()CSV_Form_UserCreate()CSV_Form_UserEdit()CSV_Form_UserPassword()

Function Category Functions

Page 46: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference42

CSV_Include ListBox CSV_ListBox_AddItemCSV_ListBox_ClearCSV_ListBox_Create()CSV_ListBox_DestroyCSV_ListBox_GetCategoryCSV_ListBox_GetItemCSV_ListBox_GetItemIDCSV_ListBox_GetSelectedItemCSV_ListBox_GetSelectedItemCategoryCSV_ListBox_GetSelectedItemIDCSV_ListBox_GetTagCommentCSV_ListBox_GetTagDescFromTagCSV_ListBox_GetTagNameCSV_ListBox_GetTrendDescFromTag()CSV_ListBox_HideCSV_ListBox_RemoveItemCSV_ListBox_SelectCategoriesCSV_ListBox_SelectTags()CSV_ListBox_SelectTrends()CSV_ListBox_SetTextCSV_ListBox_ShowCSV_ListBox_TagFormatCSV_ListBox_Visible

CSV_Include Math CSV_Math_RoundDownCSV_Math_Truncate

CSV_Include MenuConfig CSV_MenuConfig_Close()CSV_MenuConfig_Display()CSV_MenuConfig_LoadDflt()CSV_MenuConfig_UserPages()

CSV_Include MessageBox CSV_MessageBoxCSV_Include Misc CSV_Misc_CheckNumPadValue

CSV_Misc_IntRangeCSV_Misc_MouseOver

Function Category Functions

Page 47: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 43

CSV_Include MultiMonitors CSV_MM_BackEmpty()CSV_MM_ConfigInit()CSV_MM_FwdEmpty()CSV_MM_GetMonitor()CSV_MM_GetMonitors()CSV_MM_GetMouseXCSV_MM_GetMouseYCSV_MM_GetOffsetCSV_MM_GetScreenWidth()CSV_MM_ListLastPagesCSV_MM_MonitorFromPointCSV_MM_MonitorFromWindowCSV_MM_MonitorGotoCSV_MM_NextEmpty()CSV_MM_PageDisplayCSV_MM_PageLastCSV_MM_PageNext()CSV_MM_PagePrev()CSV_MM_PagesInit()CSV_MM_PreviousEmpty()CSV_MM_StoreLastPageCSV_MM_WinDrag()CSV_MM_WinDragEnd()CSV_MM_WinFree()CSV_MM_WinNewAtCSV_MM_WinPopupCSV_MM_WinTitle

Function Category Functions

Page 48: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference44

CSV_Include Navigation CSV_Nav_Alarms()CSV_Nav_AlarmsDisabled()CSV_Nav_AlarmsHardware()CSV_Nav_AlarmsSummary()CSV_Nav_CloseWindow()CSV_Nav_DisableMenuItemCSV_Nav_DisplayMenuBarCSV_Nav_DisplayPopupMenuCSV_Nav_FileCSV_Nav_GetEngToolsPrivilege()CSV_Nav_Help()CSV_Nav_HelpOnCSVInclude()CSV_Nav_Home()CSV_Nav_Login()CSV_Nav_LoginMenu()CSV_Nav_MenuBar_MenuClickCSV_Nav_Network()CSV_Nav_NetworkBtnEnabled()CSV_Nav_PageExistsCSV_Nav_PagePrint()CSV_Nav_Parent()CSV_Nav_ParentBtnEnabled()CSV_Nav_Report()CSV_Nav_ReportBtnEnabled()CSV_Nav_ReportMenuCSV_Nav_Tools()CSV_Nav_ToolsBtnEnabled()CSV_Nav_ToolsMenu()CSV_Nav_Trend()CSV_Nav_TrendBtnEnabled()CSV_Nav_TrendMenu()CSV_Nav_TrendX()CSV_Nav_TickMenuItem

CSV_Include Security CSV_Sec_ShowLoginMenuCSV_Include Strings CSV_String_GetField

CSV_String_GetLinesCSV_String_Replace

CSV_Include Tags CSV_Tag_Debug

Function Category Functions

Page 49: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 45

CSV_Include Tag CSV_Trend_AutoScaleCSV_Trend_DspGroupCSV_Trend_DspGroupListCSV_Trend_DspPopupMenuCSV_Trend_DspScaleRangeCSV_Trend_DspTrendTextCSV_Trend_GetCursorPosCSV_Trend_GetCursorTypeStrCSV_Trend_GetCursorValueStrCSV_Trend_GetDateCSV_Trend_GetModeCSV_Trend_GetPenCSV_Trend_GetPenFocusCSV_Trend_GetSettingsCSV_Trend_GetSettingsCSV_Trend_GetSpanCSV_Trend_GetTimeCSV_Trend_GroupConfig()CSV_Trend_PageCSV_Trend_PopupCSV_Trend_ScaleDigitalCSV_Trend_SelectGroupCSV_Trend_SelectPenCSV_Trend_SetCursorCSV_Trend_SetDateCSV_Trend_SetDateTimeCSV_Trend_SetPensCSV_Trend_SetRangeCSV_Trend_SetScaleCSV_Trend_SetSpanCSV_Trend_SetTimeCSV_Trend_SetTimebaseCSV_Trend_UpdatePensCSV_Trend_Win

Function Category Functions

Page 50: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference46

CSV_Alarms_Ack Acknowledges an alarm at a specified animation point in an alarm list.

CSV_Include TrendX CSV_TrendX_AddVariableCSV_TrendX_AgeTrends()CSV_TrendX_ClearTrendCSV_TrendX_CloseCSV_TrendX_DeletePen()CSV_TrendX_Display()CSV_TrendX_DspPopupMenuCSV_TrendX_GenericToTagCSV_TrendX_GenericToTagStrCSV_TrendX_GetCommentCSV_TrendX_GetCursorCSV_TrendX_GetDuration()CSV_TrendX_GetSamplePeriodCSV_TrendX_GetScaleCSV_TrendX_GetTrendNameCSV_TrendX_GetTriggerCSV_TrendX_GetValCSV_TrendX_InitClient()CSV_TrendX_InitSrvr()CSV_TrendX_MapTrendTags()CSV_TrendX_RefreshTrendPageCSV_TrendX_SetDurationCSV_TrendX_SetDurationCSV_TrendX_SetPen()CSV_TrendX_SetSamplePeriodCSV_TrendX_SetScaleCSV_TrendX_TagSelectCSV_TrendX_TagSelectFrmCursor()CSV_TrendX_TagToGenericCSV_TrendX_TrendTimeout

CSV_Include WinUtilities CSV_WinUtl_DestroyCursor()CSV_WinUtl_GetColourRes()CSV_WinUtl_GetCpuUsageCSV_WinUtl_GetSystemDir()CSV_WinUtl_GetTotalCpuUsage()CSV_WinUtl_GetWindowsDir()CSV_WinUtl_GetWinMode()CSV_WinUtl_LoadCursorCSV_WinUtl_LockWindowUpdateCSV_WinUtl_NormalCursorCSV_WinUtl_ShellExecCSV_WinUtl_UpdateTotalCpuUsage()CSV_WinUtl_WaitCursor

Function Category Functions

Page 51: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 47

Syntax CSV_Alarms_Ack(iAN)

iAN: Animation point number of alarm to acknowledge.

Return Value 0 if successful, otherwise -1.

CSV_Alarms_AckHardware

Acknowledges a hardware alarm at a specified animation point in an alarm list.

Syntax CSV_Alarms_AckHardware(iAN)

iAN: Animation point number of alarm to acknowledge.

Note: Hardware alarms are not stored in the same way as standard alarms. Therefore, AlarmGetDsp() does not return any information for a hardware alarm. Thus, CSV_Alarms_Ack will not function correctly for hardware alarms.

Return Value 0 if successful, otherwise -1.

CSV_Alarms_AckPage Acknowledges a page of alarms, starting at a specified animation point. Silences the alarm sound.

Syntax CSV_Alarms_AckPage(iAN)

iAN: Starting animation point number of page of alarms to acknowledge.

CSV_Alarms_AckRec Acknowledges an alarm by record number, and silences the alarm sound.

Syntax CSV_Alarms_AckRec(iRecNo)

iRecNo: Record number of alarm to acknowledge.

Return Value 0 if successful, otherwise -1.

CSV_Alarms_AdvFilter Applies an advanced filter to the alarm list displayed at a specified AN. The advanced filter allows alarms to be filtered based on Date, Time, Tag, Name, Description, Area, Category, Priority, State and Type (or any combination of these).

Syntax CSV_Alarms_AdvFilter(iAN,iAlarmType,iMonitor)

iAN: Animation point where the alarm list is displayed.

Page 52: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference48

iAlarmType: Type of alarm list associated with filter:

0 = Last alarms list.

1 = Active alarms list.

2 = Alarm summary list.

3 = Hardware alarms list.

4 = Disabled alarms list.

iMonitor: The number of the monitor to associate the filter with (each monitor can display and store a different filter).

Return Value 0

CSV_Alarms_AdvFilterConfig

Displays a popup window allowing the user to configure advance alarm filtering.

Syntax CSV_Alarms_AdvFilterConfig(iAlarmType,iMonitor)

iAlarmType: Type of alarm list associated with filter:

0 = Last alarms list.

1 = Active alarms list.

2 = Alarm summary list.

3 = Hardware alarms list.

4 = Disabled alarms list.

iMonitor: The number of the monitor to associate the filter with (each monitor can display and store a different filter).

Return Value 0 if Advanced filter applied, otherwise –1.

CSV_Alarms_AdvFilterQuery

Called for each alarm to determine which alarm is displayed when a user defined advanced filter has been applied.

Syntax CSV_Alarms_AdvFilterQuery(iRecNo,nVer,sFromDate,sFromTime,sToDate,sToTime,sTag,sName,sArea,sCategory,sPriority,sState,sType)

iRecNo: Record number of the alarm.

nVer: Version (not used).

sFromDate: Alarms prior to this date won't be displayed ("" sets FromDate to earliest possible).

Page 53: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 49

sFromTime: Alarms prior to this time won't be displayed ("" sets FromTime to 12:00 Midnight).

sToDate: Alarms subsequent to this date won't be displayed ("" sets ToDate to current date).

sToTime: Alarms subsequent to this time won't be displayed ("" sets ToDate to current time).

sTag: Alarm Tag must be 'Like' sTag i.e. = *sTag*.

sName: Alarm Name must be 'Like' sName i.e. = *sName*.

sArea: Area of alarm (or group of areas).

sCategory: Alarm category (or group of categories).

sPriority: Alarm priority (or group of priorities).

sState: Alarm state.

sType): Alarm type.

Note: Setting any filter argument to "" will result in that filter criteria being ignored.

Return Value 1 if alarm is to be displayed (i.e., matches criteria), otherwise 0.

CSV_Alarms_AdvFilterSetDateTime

Writes the date and time entered via a keypad form to specified Text boxes. (Used in the Advanced Alarm Filter form).

Syntax CSV_Alarms_AdvFilterSetDateTime(iDateAN, iTime)

iDateAN: AN number of Date Text Box.

iTime: AN number of Time Text Box.

Return Value 0 if successful, otherwise -1.

CSV_Alarms_CheckSound

Checks alarm summary records between a specified index and the current index until an unacknowledged alarm is found (for given area/s) with a priority higher than a specified priority.

Note: This function should only be called on an alarm server.

Syntax CSV_Alarms_CheckSound(iAlarmIndexPrevious,iPriorityPrevious,sArea)

Page 54: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference50

iAlarmIndexPrevious: Index in alarm summary to begin checking from (i.e., the index of the last alarm checked).

iPriorityPrevious: Priority to compare with.

sArea: Current logged in areas (i.e., only check alarms within these areas).

Return Value This function returns a string containing three values separated by a single space:

Alarm Priority: Priority of higher priority alarm if one is found, otherwise iPriorityPrevious as originally passed to function.

Alarm Index: Index of most recent alarm checked.

Alarm Acknowledged: 1 if an alarm has been acknowledged and no further alarms have since been triggered, otherwise 0.

CSV_Alarms_ClearGroupFilter

Clears the filter applied to the specified alarm list.

Syntax CSV_Alarms_ClearGroupFilter(iAN,iAlarmType, iMonitor)

iAN: Animation point number of start of alarm list.

iAlarmType: Type of alarm list associated with filter:

0 = Last alarms list.

1 = Active alarms list.

2 = Alarm summary list.

3 = Hardware alarms list.

4 = Disabled alarms list.

iMonitor: Number of monitor displaying alarm list (-1 = active monitor).

CSV_Alarms_Disable Disables an alarm at a specified animation point in an alarm list.

Syntax CSV_Alarms_Disable(iAN)

iAN: Animation point number of alarm to disable.

Return Value 0 if successful, otherwise -1.

Page 55: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 51

CSV_Alarms_DisableRec

Disables an alarm by record number.

Syntax CSV_Alarms_DisableRec(iRecNo)

iRecNo: Record number of alarm to disable.

Return Value 0 if successful, otherwise -1.

CSV_Alarms_DspGroupFilter

Displays the Alarm Group listbox, and stores the selected filter for the specified alarm page and the specified monitor.

Syntax CSV_Alarms_DspGroupFilter(iAlarmType,iMonitor)

iAlarmType: Type of alarm list associated with filter:

0 = Last alarms list.

1 = Active alarms list.

2 = Alarm summary list.

3 = Hardware alarms list.

4 = Disabled alarms list.

iMonitor: Number of monitor displaying alarm list (-1 = active monitor).

Return Value Name of Alarm Group selected, or "" if selection cancelled.

CSV_Alarms_DspGroupList

Displays the Alarm Group listbox.

Syntax CSV_Alarms_DspGroupList

sSelectedGroup: Name of group to preselect in the list.

sAreas: Areas to enable in the list; i.e., only alarm groups belonging to these areas are displayed.

Return Value Alarm group (description) selected from the list, or "" if cancel is pressed.

CSV_Alarms_DspInfo Displays information popup for alarm at specified animation point in alarm list.

Syntax CSV_Alarms_DspInfo(iAN)

Page 56: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference52

iAN: Animation point number of alarm to display information for.

CSV_Alarms_DspInfoRec

Displays information popup for alarm at the specified record number.

Syntax CSV_Alarms_DspInfoRec(iRecNo)

iRecNo: Record number of alarm to display information for.

Return Value 0 if successful, otherwise -1.

CSV_Alarms_DspLast Displays specified number of most recent alarms, starting at a specified animation point.

Syntax CSV_Alarms_DspLast(iAN,iAlarmCount,iType)

iAN: Animation point number of start of alarm list.

iAlarmCount: Number of alarms to display.

iType: The type of alarms to display.

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 (non-hardware) alarms, i.e. Types 0 to 3, plus acknowledged OFF alarms.

Hardware alarms

5 = All active alarms; i.e., types 6 and 7.

6 = All unacknowledged alarms, ON and OFF.

7 = All acknowledged ON alarms.

8 = All disabled alarms.

9 = All configured alarms; i.e., types 5 to 8.

Alarm Summary

10 = All summary alarms.

Alarm General

Page 57: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 53

11 = All ON alarms.

12 = All OFF alarms.

13 = All ON hardware alarms.

14 = All OFF hardware alarms.

CSV_Alarms_Enable Enables an alarm at a specified animation point in an alarm list.

Syntax CSV_Alarms_Enable(iAN)

iAN: Animation point number of alarm to enable.

Return Value 0 if successful, otherwise -1.

CSV_Alarms_EnableRec

Enables an alarm by record number.

Syntax CSV_Alarms_EnableRec(iRecNo)

iRecNo: Record number of alarm to enable.

Return Value 0 if successful, otherwise -1.

CSV_Alarms_GetAckPrivilege()

Checks that the user has privilege level required for acknowledging alarms.

Return Value 1 if user has required privilege level, otherwise 0.

CSV_Alarms_GetDisablePrivilege()

Checks that the user has privilege level required for disabling alarms.

Return Value 1 if user has required privilege level, otherwise 0.

CSV_Alarms_GetGroupFilter

Returns the description of the filter currently applied to the alarm list.

Syntax CSV_Alarms_GetGroupFilter(iAlarmType,iMonitor,iChars)

Page 58: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference54

iAlarmType: Type of alarm list associated with filter:

0 = Last alarms list.

1 = Active alarms list.

2 = Alarm summary list.

3 = Hardware alarms list.

4 = Disabled alarms list.

iMonitor: Number of monitor displaying alarm list (-1 = active monitor).

iChars: Number of characters per line (-1 = single line).

Return Value Description of the filter currently applied to a specified alarm list, returned as lines if a maximum number of characters per line is specified.

CSV_Alarms_GetGroupFilterID

Returns the name of the group associated with the filter currently applied to a specified alarm list.

Syntax CSV_Alarms_GetGroupFilterID(iAlarmType,iMonitor)

iAlarmType: Type of alarm list associated with filter:

0 = Last alarms list.

1 = Active alarms list.

2 = Alarm summary list.

3 = Hardware alarms list.

4 = Disabled alarms list.

iMonitor: Number of monitor displaying alarm list (-1 = active monitor).

Return Value Name of alarm group, or "_AdvFilter_" if advanced filter applied, "" if no filter applied.

CSV_Alarms_GetUniqueGroupName

Checks if a group of a specified name exists. If a group already exists with the specified name then a new name is found by appending a number to the original name.

Syntax CSV_Alarms_GetUniqueGroupName(sGroupName)

sGroupName: Name of a group to check.

Note: Call this function to ensure a new group can be created with a specified name, before attempting to create the group.

Page 59: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 55

Return Value Name of a group not yet assigned (= sGroupName, or modified version of sGroupName).

CSV_Alarms_GroupAdd Adds an alarm group to the Alarm Group Listbox, and creates a group to store the associated alarm categories. The alarm group is also added to AlarmGrp.dbf. The name of the group is stored in the second field of the listbox (non-visible field), as well as in the "Name" field of the AlarmGrp.dbf.

Note: Alarm groups are used to filter alarms on an alarm page. When a group is selected from the list only alarms having the associated categories are displayed on the alarm page.

Syntax CSV_Alarms_GroupAdd(sGroupName, sDesc, sCategories, sArea)

sGroupName: Name/ID of alarm group (must be unique).

sDesc: Text describing alarm group that will appear in listbox.

sCategories: String listing categories represented by alarm group. Must have same format as a standard Citect group; e.g., "1,5,7..9" = categories 1,5,7,8,9.

sArea: Area the group applies to. Empty string = all areas.

Return Value Name of the group created, or "" if unsuccessful.

CSV_Alarms_GroupConfig()

Displays a popup window allowing the user to browse/edit/add/delete records in the AlarmGrp.dbf at runtime.

Note: Modifications can be made to alarm groups at run-time, that will be reflected in the list box displaying available alarm groups for filtering.

CSV_Alarms_GroupRemove

Removes an alarm group from the Alarm Group Listbox, and deletes the Citect group of the same name. The alarm group is also removed from the AlarmGrp.dbf.

Note: Alarm groups are used to filter alarms on an alarm page. When a group is selected from the list, only alarms having the associated categories are displayed on the alarm page.

Syntax CSV_Alarms_GroupRemove(sGroupName)

sGroupName: Unique Name/ID of alarm group (= second field (non-visible) of Alarm Group listbox, which can be retrieved by calling CSV_ListBox_GetSelectedItemID.)

Page 60: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference56

Return Value 0 if successful, otherwise -1.

CSV_Alarms_GroupEdit Edits an existing alarm group in the Alarm Group Listbox, and updates the AlarmGrp.dbf.

Note: Alarm groups are used to filter alarms on an alarm page. When a group is selected from the list, only alarms having the associated categories are displayed on the alarm page.

Syntax CSV_Alarms_GroupEdit(sGroupName,sDesc,sCategories,sArea)

sGroupName: Name/ID of alarm group (must be unique).

sDesc: Text describing alarm group that will appear in listbox.

sCategories: String listing categories represented by alarm group. Must have same format as a standard Citect group; e.g., "1,5,7..9" = categories 1,5,7,8,9.

sArea: Area the group applies to. Empty string = all areas.

Return Value 0 if successful, otherwise -1.

CSV_Alarms_GroupFilter

Filters the alarm list starting at a specified animation point for a group of categories.

Note: If the group name = "_AllAlarms_", the all alarms is displayed; i.e., the filter is cleared. If the group name = "_AdvFilter_", the selected advanced filter is applied to the alarm list.

Syntax CSV_Alarms_GroupFilter(iAN,sGroupName,iAlarmType,iMonitor)

iAN: Animation point number of start of alarm list.

sGroupName: Name/ID of alarm group to filter for.

iAlarmType: Type of alarm list associated with filter.

0 = Last alarms list.

1 = Active alarms list.

2 = Alarm summary list.

3 = Hardware alarms list.

4 = Disabled alarms list.

iMonitor: Number of monitor displaying alarm list (-1 = active monitor).

Page 61: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 57

Return Value Handle to group, otherwise –1.

CSV_Alarms_GroupSelect

Filters the alarm list starting at a specified animation point for a group of categories. The alarm group may be specified by either the group name or the group description (as found in the AlarmGrp.dbf). Stores the applied filter for a specified monitor and specified alarm page type.

Syntax CSV_Alarms_GroupSelect(iAN,sGroupID,sGroupIDType,iAlarmType, iMonitor)

iAN: Animation point number of start of alarm list.

sGroupID: Name/Desc of alarm group to filter for. If sGroupID = "", the filter is cleared.

sGroupIDType:

0 = sGroupID specifies the alarm group Name.

1 = sGroupID specifies the alarm group description.

iAlarmType: Type of alarm list associated with filter:

0 = Last alarms list.

1 = Active alarms list.

2 = Alarm summary list.

3 = Hardware alarms list.

4 = Disabled alarms list.

iMonitor: Number of monitor displaying alarm list (-1 = active monitor).

CSV_Alarms_GroupsInit()

Initializes Alarm Group Listbox with groups specified in AlarmGrp.dbf. For each alarm group listed in AlarmGrp.dbf, a group is created to store the alarm categories assigned to the alarm group. Groups are used to filter alarm list. When a group is selected from the list, only alarms having those categories are displayed on the alarm page.

Return Value 0 if successful, otherwise -1.

CSV_Alarms_Help For alarm at specified animation point in alarm list: Displays page specified in help field of alarm dbf, or if help field begins with "?", calls the function named in the field (i.e., the text following "?").

Return Value CSV_Alarms_Help(iAN)

Page 62: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference58

iAN: Animation point number of alarm to display help for.

Return Value 0 if successful, otherwise -1.

CSV_Alarms_HelpRec For alarm at specified record number: displays the page specified in the help field of alarm dbf, or if the help field begins with "?", calls the function named in the field (i.e., the text following "?").

Syntax CSV_Alarms_HelpRec(iAN)

iAN: Animation point number of alarm to display help for.

Return Value 0 if successful, otherwise -1.

CSV_Alarms_ListHeading

Returns a formatted heading for the specified alarm list type. The heading format is specified by the ini parameters [Alarm]ActiveHeading, [Alarm]SummaryHeading, [Alarm]DisabledHeading, and [Alarm]HardwareHeading.

Syntax CSV_Alarms_ListHeading(iAlarmType)

iAlarmType: Type of alarm list associated with filter.

0 = Last alarms list.

1 = Active alarms list.

2 = Alarm summary list.

3 = Hardware alarms list.

4 = Disabled alarms list.

Return Value Alarm list heading. Returns "" if no heading has been specified.

Example [Alarm]

ActiveHeading = {DATE,12}^t{TIME,14}^t{NAME,15}^t{DESC,40}^t{STATE,10}

CSV_Alarms_ListHeadingFont()

Returns the font to use for alarm list headings. The font is specified by the ini parameter [Alarm]HeadingFont. If no font is specified the default, (tahoma, bold, 9 blue) is used.

Return Value Alarm list heading font.

Page 63: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 59

CSV_Alarms_PopupMenu

Displays popup menu for alarm at specified animation point in alarm list. Available menu items:

Alarm information

Acknowledge

Disable

Enable

Help

Note: The Disable/Enable options are available only to user with privilege level specified by [Privilege] DisableAlarms parameter. Acknowledge option available only to user with privilege level specified by [Privilege] AckAlarms parameter.

Syntax CSV_Alarms_PopupMenu(iAN,iAlarmType)

iAN: Animation point number of alarm to display menu for.

iAlarmType: Type of alarm list:

0 = Last alarms list.

1 = Active alarms list.

2 = Alarm summary list.

3 = Hardware alarms list.

4 = Disabled alarms list.

Return Value 0 if successful, otherwise -1.

CSV_Alarms_Sound() Checks if there are unacknowledged alarms in the system, and if there are it sounds the relevant alarm.

CSV_Alarms_SoundActive()

Checks if an alarm is being sounded. This function is used to animate siren in templates, and so on.

Return Value 1 if sound is active, otherwise 0.

CSV_Alarms_Silence() Silences alarm by setting miResetAlarmSound.

Page 64: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference60

CSV_DB_BOF Checks for the beginning of file flag for a recordset.

Syntax CSV_DB_BOF(hRecordSet)

hRecordSet: Handle to recordset (as returned from CSV_DB_Execute() )

Return Value 0 if not at beginning of file.

CSV_DB_Close Closes a specified recordset.

Syntax CSV_DB_Close(hRecordSet)

hRecordSet: Handle to recordset (as returned from CSV_DB_Execute() )

Return Value 0 if successful, otherwise -1.

CSV_DB_EOF() Checks for the end of file flag for a recordset.

Return Value 0 if not at end of file.

CSV_DB_Execute Executes a command on a specified database. A connection string is used to specify how to connect to the database. If a standby connection string is specified then the standby path is used if the primary path is offline. The command should be an SQL type command, for example:

"SELECT * FROM MyTable WHERE TimeValue(Time) > #10:00:00#" etc.

Example connection strings:

SQL Server:

"Provider=sqloledb;Data Source=MySQLServerName;Initial Catalog=MyDatabase;User Id=MyUserID;Password=MyPassword;"

Access:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;User Id=MyUserID;Password=MyPassword;"

Oracle:

"Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=MyUserID;Password=MyPassword;"

Excel:

Page 65: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 61

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\somepath\MyExcel.xls; Extended Properties=Excel 8.0;HDR=Yes;IMEX=1"

where:

HDR=Yes; indicates that the first row contains columnnames, not data

IMEX=1; tells the driver to always read "intermixed" data columns as text

Text:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\somepath\MyTxtFilesFolder\;Extended Properties=text;HDR=Yes;FMT=Delimited"

where:

"HDR=Yes;" indicates that the first row contains column names, not data

DBF:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\somepath\MyDbfFolder;Extended Properties=dBASE IV;User ID=Admin;Password="

DSN:

"DSN=MyDsn;Uid=MyUserID;Pwd=MyPassword;"

UDL:

"File Name=c:\somepath\myDataLink.udl;"

Syntax CSV_DB_Execute(sCommand,sPrimaryConnection,sStandbyConnection)

#sCommand: Command to execute

#sPrimaryConnection: Connection string for primary connection path.

#sStandbyConnection: Connection string for standby connection path.

Return Value Handle to the resulting recordset if successful, otherwise -1.

CSV_DB_GetExecuteError

Returns a description of the error that occurred for the last CSV_DB_Execute command call.

Syntax CSV_DB_GetExecuteError(nMode)

#nMode

Return Value Error description.

Page 66: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference62

CSV_DB_GetFieldCount Returns the number of fields contained in a specified recordset.

Syntax CSV_DB_GetFieldCount(hRecordSet)

Return Value Number of fields if successful, otherwise -1.

CSV_DB_GetFieldIndex Returns the index of a specified field in a specified recordset.

Syntax CSV_DB_GetFieldIndex(hRecordSet,sField)

#sField: Name of field.

Return Value Index of fields if successful, otherwise -1.

CSV_DB_GetFieldName Returns the name of a field contained in a specified recordset. The field is identified by a field index.

Syntax CSV_DB_GetFieldName(hRecordSet,nFieldIndex)

#nFieldIndex: Index of field (first field has nFieldIndex = 0).

Return Value Name of fields if successful, otherwise "".

CSV_DB_GetFieldText Returns the value of a field (as a string) contained in a specified recordset. The field is identified by a field index.

Syntax CSV_DB_GetFieldText(hRecordSet,sField,nFieldIndex,sNullValue)

#sField: Name of field. (Leave blank "" if nFieldIndex is to be used instead.)

#nFieldIndex: Index of field.The first field has nFieldIndex = 0. (Used only if sField = "")

#sNullValue: Value to return if the field value is Null

Note: If the value of the field is Null then this function will return the string specified by the argument sNullValue.

Return Value Value of fields if successful, otherwise sNullValue.

CSV_DB_GetRowCount Returns the number of rows contained in a specified recordset.

Syntax CSV_DB_GetRowCount(hRecordSet)

Page 67: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 63

Return Value Number of rows if successful, otherwise -1.

CSV_DB_GetRowCurrent

Returns the row number of the current record in a specified recordset.

Syntax CSV_DB_GetRowCurrent(hRecordSet)

Return Value Current row number if successful, otherwise -1.

CSV_DB_GetRowFieldText

Get the value of a specified field in a specified row of a specified recordset.

Syntax CSV_DB_GetRowFieldText(hRecordSet,nRowOffset,sField,nFieldIndex, sNullValue)

#nRowOffset: Offset of row (from current position)

CSV_DB_MoveFirst Finds the first record in a specified recordset.

Syntax CSV_DB_MoveFirst(hRecordSet)

Return Value First record if successful, otherwise -1.

CSV_DB_MoveLast Finds the last record in a specified recordset.

Syntax CSV_DB_MoveLast(hRecordSet)

Return Value Last record if successful, otherwise -1.

CSV_DB_MoveNext Finds the next record in a specified recordset.

Syntax CSV_DB_MoveNext(hRecordSet)

Return Value Next record if successful, otherwise -1.

CSV_DB_MoveOffset Finds the record at a specified offset from the current record in a specified recordset.

Page 68: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference64

Syntax CSV_DB_MoveOffset(hRecordSet)

Return Value Record at specified offset if successful, otherwise -1.

CSV_DB_MovePrev Finds the previous record in a specified recordset.

Syntax CSV_DB_MovePrev(hRecordSet)

Return Value Previous record if successful, otherwise -1.

CSV_DB_StandbyConnectionActive

Check the last connection state of the specified primary connection and the specified standby connection.

Syntax CSV_DB_StandbyConnectionActive(sPrimaryConnection, sStandbyConnection)

Return Value If the primary connection state is offline and the standby connection state is online then return 1 otherwise return 0.

CSV_DB_StrToSQL Replaces single quote with two single quotes to ensure SQL interprets single quote as text only.

Syntax CSV_DB_StrToSQL(sText)

#sText: The text to convert to SQL format

Return Value Converted text.

CSV_Display_Display_Logo

Note: Displays company logo at specified x and y coordinates. The logo must be a 256-color (maximum) bitmap file. The default file is "logo.bmp" located in the [RUN] directory. Alternatively, a file name and path may be specified.

Note: The logo will only be displayed on the first scanupdate of the page.

Syntax CSV_Display_Logo(iX,iY,sLogoFile)

#iX: X coordinate to display top-left corner of logo.

#iY: Y coordinate to display top-left corner of logo.

#sLogoFile: File name to display (including path).

Page 69: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 65

CSV_Display_Display_ServicePack()

Gets Citect Service PackHotfix in the form 'Service Pack A' or 'HF....'.

Return Value Citect Service Pack as string.

CSV_Display_Title() Gets window title to display in title bar.

Return Value Window title.

CSV_Display_Version() Gets Citect Version number in the form 5.41.128.

Return Value Citect Version number as string.

CSV_File_Display Displays textRich text file at a text box object AN.

Syntax CSV_File_Display(sFile,iAN,iMode,sFontName,sFontSize, iFontColour,iBackColour,iWordWrap,iScrollbars)

#sFile: Name of file to display.

#iAN: Animation point number of text box object.

#iMode:

1 = Locked (don't allow editing).

2 = Allow save (enables save option in popup context menu).

4 = Allow create (creates the file if it doesn't already exist).

8 = Allow open (enable open option in popup context menu, which allows user to browse for another file to open).

#sFontName: Name of font.

#sFontSize: Size of font.

#iFontColour: Color of font.

#iBackColour: Color of text box.

#iWordWrap: Wrap text (for text files only; i.e., not rtf files).

#iScrollbars: Display scrollbars:

0 = None

1 = Horizontal

Page 70: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference66

2 = Vertical

3 = Both

CSV_File_Print Prints text/Rich text file.

Syntax CSV_File_Print(Name)

#Name: Name of file to print.

Return Value 0 if successful, otherwise -1.

CSV_File_Save Saves text/Rich text file.

Syntax CSV_File_Save(sFile)

#sFile: Name of File to save.

Return Value 0 if successful, otherwise -1.

CSV_Form_Centre Displays a form in the centre of the current monitor screen.

Syntax CSV_Form_Centre(iFormX, iFormY)

#iFormX: Width of form.

#iFormY: Height of form

CSV_Form_Login() Displays the login form, gest the user name and password, and then tries to log the user in. If the login fails, it will retry unti login is OK or user presses the Cancel button.

Return Value 0 if login successful, otherwise an error (298).

CSV_Form_NumPad Generates a form that allows the user to enter values through a number pad. The form is displayed on the current ('active') monitor, at the cursor position.

Syntax CSV_Form_NumPad(sTitle,sInput,iMode)

#sTitle: Title of numeric pad form.

#sInput: Initial default value.

Page 71: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 67

#iMode: Indicates the input mode:

0 = Normal keypad.

1 = With a Password style edit field.

2 = Mode not yet implemented.

4 = With "+-" button.

8 = With "" button.

16 = With "." button.

32 = With ":" button, not compatible with mode "+-".

64 = With "AM" and "PM" buttons, not compatable with mode "" or "."

128 = With "Now" button.

512 = With "1hr", "2hr", "8hr", "24hr" buttons, not compatible with mode "Now".

Return Value Returns the string of value entered through the keypad if closed with the accept button, or a null string if closed any other way.

CSV_Form_Position Displays a form at the specified x,y coordinates, while ensuring that all of the form is displayed within the boundaries of the current monitor. (i.e., that the x,y coordinates are automatically adjusted if necessary).

Syntax CSV_Form_Position(iX, iY, iFormX, iFormY)

#iX: Desired X position of top-left of form.

#iY: Desired Y position of top-left of form.

#iFormX: Width of form.

#iFormY: Height of form.

CSV_Form_Shutdown() Displays a dialog box to verify that the user really wants to shut down the Citect system. If the user selects [Yes], Citect will be shut down.

Return Value 0 if shutdown confirmed, otherwise an error (298).

CSV_Form_UserCreate()

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.

Return Value 0 if new user is created successfully, otherwise an error.

Page 72: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference68

CSV_Form_UserEdit() 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.

Return Value 0 if successful, otherwise an error.

CSV_Form_UserPassword()

Displays a form to allow users to change their own passwords. Changes are written to both the Users database and the runtime database in memory.

Return Value 0 if successful, otherwise an error.

CSV_ListBox_AddItem Adds item to combo box in ActiveX tag list object.

Syntax CSV_ListBox_AddItem(hList,sItem,sCategory,sItemID)

#hList: Handle to list object.

#sItem: Item text to add to list.

#sCategory: Category of item (list can be filtered by category).

#sItemID: ID of item (optional, but if used it should be unique for each item).

Return Value 0 if successful, otherwise -1.

CSV_ListBox_Clear Clears ActiveX list object.

Syntax CSV_ListBox_Clear(hList)

#hList: Handle to list object.

Return Value 0 if successful, otherwise -1.

CSV_ListBox_Create() Creates ActiveX list object.

Note: This object displays a form that contains a combobox. The form may be displayed or hidden at any time. Items may be added to or removed from the combobox at any time (whether or not the combobox is currently being displayed). The combobox remains in memory until the CSV_List_Destroy() function is called for that combobox.

Page 73: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 69

Return Value 0 if list box was created successfully, otherwise an error.

CSV_ListBox_Create() Creates new list.

Return Value Handle to the created list if list box was created successfully; otherwise -1.

CSV_ListBox_Destroy Destroys ActiveX list object.

Note: Call this function if the listbox is no longer required to free memory.

Syntax CSV_ListBox_Destroy(hList)

#hList: Handle to list object.

Return Value 0 if successful, otherwise -1.

CSV_ListBox_GetCategory

Returns the item category associated with a given ItemID.

Syntax CSV_ListBox_GetCategory(hList,sItemID)

#hList: Handle to list object.

#sItemID: ItemID of item.

Return Value Category of item having ItemID = sItemID.

CSV_ListBox_GetItem Returns the item text associated with a given ItemID.

Syntax CSV_ListBox_GetItem(hList,sItemID)

#hList: Handle to list object.

#sItemID: ItemID of item.

Return Value Item having ItemID = sItemID.

CSV_ListBox_GetItemID

Returns the item ID associated with a given Item text.

Syntax CSV_ListBox_GetItemID(hList,sItem)

Page 74: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference70

#hList: Handle to list object.

#sItem: Item text (as it appears in the listbox).

Return Value ItemID.

CSV_ListBox_GetSelectedItem

Called when list is displayed. Returns the selected item.

Syntax CSV_ListBox_GetSelectedItem(hList)

#hList: Handle to list object.

Return Value Item selected from list.

CSV_ListBox_GetSelectedItemCategory

Call after selection has been made from list. Returns the category of the selected item.

Syntax CSV_ListBox_GetSelectedItemCategory(hList)

#hList: Handle to list object.

Return Value Category of item selected from list.

CSV_ListBox_GetSelectedItemID

Call after item has been selected from list to retrieve its Item ID.

Syntax CSV_ListBox_GetSelectedItemID(hList)

#hList: Handle to list object.

Return Value ItemID of item selected from list.

CSV_ListBox_GetTagComment

Extracts the tag comment from a string containing the name followed by, in brackets, the tag comment.

Syntax CSV_ListBox_GetTagComment(sItem)

#sItem: String containing tag name and comment.

Return Value Comment of tag contained in string sItem

Page 75: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 71

CSV_ListBox_GetTagDescFromTag

Extracts the tag name and comment from the tag name.

Syntax CSV_ListBox_GetTagDescFromTag(sTrendTag)

#sTrendTag: Name of tag.

Return Value String containing formatted tag name and comment.

CSV_ListBox_GetTagName

Extracts the tag name from a string containing the name followed by, in brackets, the tag comment.

Syntax CSV_ListBox_GetTagName(sItem)

#sItem: String containing tag name and comment.

Return Value Name of tag contained in string sItem.

CSV_ListBox_GetTrendDescFromTag()

Remove item from combo box in ActiveX list object.

#sTrendTag: Name of trend tag.

Return Value String containing formatted trend tag name and comment.

CSV_ListBox_RemoveItem

Removes item from combo box in ActiveX list object.

Note: Two options: 1) Specify both sItem AND sCategory; or 2) Set sItem = "", sCategory = "", and specify only sItemID.

Syntax CSV_ListBox_RemoveItem(hList,sItem,sCategory,sItemID)

#hList: Handle to list object.

#sItem: Item to remove from list.

#sCategory: Category of item.

#sItemID: ID of item.

Return Value 0 if successful, otherwise -1.

CSV_ListBox_Hide Hides list.

Page 76: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference72

Syntax CSV_ListBox_Hide(hList)

#hList: Handle to list object.

Return Value 0 if successful, otherwise –1.

CSV_ListBox_SelectCategories

Select categories of items to be displayed in list (filters list to display only items having specified category. More than one category can be displayed by separating each category with a comma (and no spaces between categories).

Note: Categories = "" -> removes category filter.

Syntax CSV_ListBox_SelectCategories(hList, sCategories)

#hList: Handle to list object.

#sCategories: Categories to filter list for.

Return Value 0 if successful, otherwise –1.

CSV_ListBox_SelectTags()

Creates an ActiveX object which provides a combo box to allow a tag to be selected from a list. If a tag list object already exists a new instance of it is created.

Return Value Handle to tag list object.

CSV_ListBox_SelectTrends()

Creates an ActiveX object which provides a combo box to allow a trend tag to be selected from a list. If a trend tag list object already exists a new instance of it is created.

Return Value Handle to trend list object.

CSV_ListBox_SetText Set title, description, OK button, and Cancel button text on ActiveX list object.

Syntax CSV_ListBox_SetText(hList,sTitle,sDesc,sOK,sCancel)

#hList: Handle to list object.

#sTitle: Title appearing on form.

#sDesc: Description appearing on form.

#sOK: Text displayed on OK button.

#sCancel: Text displayed on Cancel button.

Page 77: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 73

Return Value 0 if successful, otherwise -1.

CSV_ListBox_Show Displays list of tags.

Syntax CSV_ListBox_Show(hList,sTitle,sDesc,sOK,sCancel,iX,iY)

#hList: Handle to list object.

#sTitle: Title appearing on form.

#sDesc: Description appearing on form.

#sOK: Text displayed on OK button.

#sCancel: Text displayed on Cancel button.

#iX: X coordinate of left corner, or -9999 to center horizontally on active monitor.

#iY: Y coordinate of top corner, or -9999 to center vertically.

Return Value Item selected from list (returns empty string if no item selected)

CSV_ListBox_TagFormat

Formats a string to contain the name of the specified variable followed by, in brackets, the comment associated with the variable. Called before adding a variable to a drop down list of variables available for trending. Formats each item in the drop down list.

Syntax CSV_ListBox_TagFormat(sVariable)

#sVariable: Name of variable to be formatted.

CSV_ListBox_Visible Checks if a ListBox is currently visible.

Syntax CSV_ListBox_Visible(hObject)

#hObject: Handle to list object.

Return Value 1 if list is currently visible, otherwise 0.

CSV_Math_RoundDown Rounds a real value down to a specified number of decimal places.

Syntax CSV_Math_RoundDown(rValue, iDecPlaces)

#rValue: The value to be rounded down.

Page 78: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference74

#iDecPlaces: The number of decimal places the value is rounded down to.

Example CSV_Math_RoundDown(4.328, 2) = 4.32

CSV_Math_RoundDown(4.321, 2) = 4.32

Return Value Rounded value.

CSV_Math_Truncate Truncates a real value down to an integer value.

Syntax CSV_Math_Truncate(rValue)

Example CSV_Math_Truncate(4.328) = 4

CSV_Math_Truncate(5.867) = 5

Return Value Truncated value (as integer).

CSV_MenuConfig_Close()

Closes the Menu Configuration popup. If changes have not been saved, a prompt to save the configuration will appear.

Return Value 0 if successful, otherwise -1.

CSV_MenuConfig_Display()

Displays Menu configuration popup, which gives the user the ability to configure menus at runtime.

Return Value 0 if successful, otherwise -1.

CSV_MenuConfig_LoadDflt()

Loads a default menu configuration from the [Bin] directory.

Return Value 0 if successful, otherwise -1.

CSV_MenuConfig_UserPages()

Updates the menu configuration to allow the user to select from the "Pages" menu all non-system pages (maximum number of pages = 25).

Return Value 0 if successful, otherwise -1.

Page 79: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 75

CSV_MessageBox Displays a message box centered on the active monitor screen and waits for the user to select a button. Can display up to three buttons, as well as a checkbox. Can disappear after specified timeout.

Syntax CSV_MessageBox(sTitle,sPrompt,iMode,iTimeout,SButton1Text, SButton2Text,SButton3Text)

#sTitle: Message box title

#sPrompt: Message box prompt

#iMode

0 - OK button only (default)

1 - OK and Cancel buttons

2 - Abort, Retry, and Ignore buttons

3 - Yes, No, and Cancel buttons

4 - Yes and No buttons

5 - Retry and Cancel buttons

16 - Critical message

32 - Warning query

48 - Warning message

64 - Information message

0 - First button is default (default)

256 - Second button is default

512 - Third button is default

768 - Fourth button is default

0 - Application modal message box (default)

4096 - System modal message box

16384 - Adds Help button to the message box

65536 - Specifies the message box window as the foreground window

524288 - Text is right aligned

1048576 - Specifies text should appear as right-to-left reading on Hebrew and Arabic systems

#iTimeout: The number of seconds before the message box disappears.

#sButton1Text: Text for first button

#sButton2Text: Text for second button

#sButton3Text: Text for third button

Page 80: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference76

Example IF sButtonText1 = ""

THEN

0 OK button pressed

299Cancel button pressed

3 Abort button pressed

4 Retry button pressed

5 Ignore button pressed

6 Yes button pressed

7 No button pressed

ELSE

0 = first button pressed

1 = second button pressed

2 = third button pressed

IF sCheckBoxText <> ""

THEN

1024 is added to the above result.

CSV_Misc_CheckNumPadValue

Uses the MultiMonitor Numpad to get a value, then checks the value's range and returns the new value, or the old if range is incorrect.

Syntax CSV_Misc_CheckNumPadValue(sDESC, rValue, rUpLimit, rLowLimit)

#sDESC: The description to appear in the form numpad title (as a string)

#rValue: The original value to be changed (as a real or int)

#rUpLimit: The Upper limit that the original value can be changed to (as a real or int)

#rLowLimit: The Lower limit that the original value can be changed to (as a real or int)

Return Value The new value or the original value if out of range.

Example Tag = CSV_Misc_CheckNumPadValue("change Value", Tag, 190, 10)

! This will means that Tag can only have values of 10 - 190 written to it via the formNumPad.

Page 81: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 77

CSV_Misc_IntRange Checks the range is valid for Integers; if not, a message box appears informing the user of the correct range.

Syntax CSV_Misc_IntRange(LowerRange,UpperRange,OriginalValue,NewValue)

#LowerRange: The Lower range of the required Range

#UpperRange: The Upper range of the required Range

#Original Value: The value to be change back too; this is used if the value is invalid or out of range.

#New Value: The new value to change to.

Return Value The new value, or the original value if out of range.

CSV_Misc_MouseOver Returns TRUE if the mouse is inside the region defined by the extents of the object at 'hAN'.

Syntax CSV_Misc_MouseOver(hAN)

#hAN: The animation number of the display object

Return Value TRUE (1) if the mouse cursor is inside the region bounded by the extents of the specified display object

FALSE (0) otherwise.

CSV_MM_BackEmpty() Checks if backward navigation is possible.

Note: If CSV_MM_BackEmpty() = 1, disable backward navigation button (there are no pages on the last-page stack that may be navigated in a backward direction from the current position).

Return Value 1 if backward navigation is not possible, otherwise 0.

CSV_MM_ConfigInit() Initialises parameters required for mult-monitor functionality. Initialises queues for storing last pages displayed (last page stack) Parameter values are read from .ini file [MultiMonitors] section:

Number of monitors (parameter = "Monitors", default = 1).

Screen width of monitor (parameter = "ScreenWidth", default = 1024).

Startup pages for each monitor (parameter = "Startup1","Startup2",... etc. depending on number of monitors, default = "Startup").

Page 82: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference78

Size of last page stack (parameter = "LastPageStackSize", default = 10).

CSV_MM_FwdEmpty() Checks if forward navigation is possible (only possible if backward navigation has been used).

Return Value 1 if forward navigation is not possible, otherwise 0.

Note: If CSV_MM_FwdEmpty() = 1 then disable forward navigation button (there are no pages on the last-page stack that may be navigated in a forward direction from the current position).

CSV_MM_GetMonitor() Gets the number of the currently active monitor. The 'active' monitor is the monitor that contains the largest part of the area of the currently active window.

Return Value Number of currently active monitor.

CSV_MM_GetMonitors() Gets number of monitors, as set by Monitors parameter in [MultiMonitors] section of the .ini file.

Return Value Number of monitors.

CSV_MM_GetMouseX Gets X coordinate of mouse position with respect to desktop, monitor, or window.

Syntax CSV_MM_GetMouseX(iMode)

#iMode

0 = Gets mouse position with respect to top-left corner of desktop.

1 = Gets mouse position with respect to top-left corner of active monitor.

2 = Gets mouse position with respect to top-left corner of active window.

CSV_MM_GetMouseY Gets Y coordinate of mouse position with respect to desktop, monitor, or window.

Syntax CSV_MM_GetMouseY(iMode)

#iMode

0 = Gets mouse position with respect to top-left corner of desktop.

Page 83: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 79

1 = Gets mouse position with respect to top-left corner of active monitor.

2 = Gets mouse position with respect to top-left corner of active window.

CSV_MM_GetOffset Gets X-offset of selected monitor. To display a page on the selected monitor the page must have its X coordinate set to this value.

Syntax CSV_MM_GetOffset(iMonitorNo)

#iMonitorNo: Number of monitor to get X-offset for.

Return Value Offset of monitor.

CSV_MM_GetScreenWidth()

Gets width of screen, as set by ScreenWidth parameter in [MultiMonitors] section of .ini file.

Return Value Width of screen.

CSV_MM_ListLastPages

Displays on the active monitor a menu listing pages that may be navigated backwards or forwards from the current page. A stack stores recently displayed pages in the order in which they were displayed. This function can be used to allow these pages to be selected for display.

Syntax CSV_MM_ListLastPages(Mode)

#Mode

0 = Lists pages which may be navigated backwards.

1 = Lists pages which may be navigated forwards.

Return Value 0 if successful, otherwise –1.

CSV_MM_MonitorFromPoint

Gets number of monitor containing point specified.

Syntax CSV_MM_MonitorFromPoint(iX, iY)

#iX: X-coordinate of point.

#iY: Y-coordinate of point.

Return Value Number of monitor containing specified point.

Page 84: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference80

CSV_MM_MonitorFromWindow

Gets number of monitor intersecting the largest area of the specified window.

Syntax CSV_MM_MonitorFromWindow(iWindowNo)

#iWindowNo: Window number to get monitor number for.

Return Value Number of monitor associated with window.

CSV_MM_MonitorGoto Goes to main window of specified monitor.

Syntax CSV_MM_MonitorGoto(iMonitor)

#iMonitor: Number of monitor to go to.

Return Value Number of main window associated with monitor if successful, otherwise -1.

CSV_MM_NextEmpty() Checks if a 'Next' page has been defined for the current page.

Note: If CSV_MM_NextEmpty() = 1 then disable 'Next Page' navigation button.

Return Value 1 if 'Next Page' has not been defined, otherwise 0.

CSV_MM_PageDisplay Displays selected page on the 'active' monitor, or a pre-selected monitor.

Syntax CSV_MM_PageDisplay(sPage,iMonitor,bStoreLastPage,sStoreFunction)

#sPage: Name of page to display.

#iMonitor: Number of monitor to display page on. First monitor = '0', Second = '1' etc. If iMonitor = -1 then page is displayed on the 'active' (ie. currently selected) monitor.

#bStoreLastPage: Add page to last page stack. If bStoreLastPage = 0 then the page is not written to the queue that stores the previous pages displayed.

#sStoreFunction: Name of function to store on last page stack.

If a function has been specified then that function will be called when navigating through the last pages, rather than displaying the page.

To include arguments append a space and then a comma-separated list of the arguments (string constants) to the function name.

Return Value ‘0' if successful, otherwise an error number.

Page 85: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 81

CSV_MM_PageLast Navigates last page stack. Allows moving backward and (subsequently) forward through a predefined number of previously displayed pages, in the order in which they were displayed. The stack is unique to the currently active monitor. ie. only the last pages displayed on the active monitor are navigated.

Syntax CSV_MM_PageLast(iMode)

Return Value 0 if successful, otherwise -1

#iMode: Direction of navigation:

0 = backwards (Default).

1 = forwards.

CSV_MM_PageNext() Displays 'Next page' of currently active page. Page is displayed on same monitor (ie. currently active monitor).

Return Value 0 if successful, otherwise –1.

CSV_MM_PagePrev() Displays 'Previous page' of currently active page. Page is displayed on same monitor (i.e., currently active monitor).

Return Value 0 if successful, otherwise –1.

CSV_MM_PagesInit() Displays startup pages. Parameter values are read from .ini file [MultiMonitors] section.

Note: This function is to be called on startup for all clients requiring multiple-monitor support. To implement this without requiring a call to this function from within the startup cicode function, it has been configured as a periodic event (listed as a 'CSV_MultiMonitor' event). The first time the event is processed the multi-monitor functionality is initialized. All subsequent calls return immediately without effect.

CSV_MM_PreviousEmpty()

Checks if a 'Previous' page has been defined for the current page.

Note: If CSV_MM_PreviousEmpty() = 1 then disable 'Previous Page' navigation button.

Return Value 1 if 'Previous Page' has not been defined, otherwise 0.

Page 86: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference82

CSV_MM_StoreLastPage

Adds page to last page stack for selected monitor. Page Title is written to queue that stores pages in order of access. (Each monitor has its own queue.) The action to perform when navigating through the last page stack is also stored.

Syntax CSV_MM_StoreLastPage(iMonitorNo,sPageAction,sPageTitle)

#iMonitorNo: Number of monitor page was displayed on.

#sPageAction: Name of action to store on last page stack.

To specify a function, prefix the function name with "?" If a function has been specified then that function will be called when navigating through the last pages, rather than displaying the page.

To include arguments, append a space and then a comma-separated list of the arguments (string constants) to the function name.

#sPageTitle: Name of page displayed.

Return Value 1 if backward navigation is not possible, otherwise 0.

CSV_MM_WinDrag() Moves active window with mouse; i.e., window position will track mouse movements.

Note: Call CSV_MM_WinDragEnd to end dragging of window.

CSV_MM_WinDragEnd() Ends window dragging initiated by CSV_MM_WinDrag().

CSV_MM_WinFree() Closes active window, if active window is not main window for a monitor.

Calling CSV_MM_WinFree rather than WinFree ensures that all assigned monitors maintain at least one open window. That window will be the one opened by the CSV_MM_PageDisplay function.

Always call CSV_MM_WinFree to close a window if multi-monitor functionality has been implemented.

Return Value 0 if successful, otherwise an error is returned. -1 indicates that you attempted to close the main window of a monitor.

CSV_MM_WinNewAt Displays a new window at the X and Y coordinates relative to the top-left corner of active monitor.

Syntax CSV_MM_WinNewAt(sPage,iX,iY,iMode)

Page 87: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 83

#sPage: Name of pagewindow to display.

#iX: X-offset to display window at relative to left of monitor.

#iY: Y-offset to display window at relative to top of monitor.

#iMode: Display mode (same settings as for 'WinNewAt' function, except that the window by default will be 'always on top', regardless of whether or not you add 64 to the mode.This ensures that the popup window does not disappear behind the main window. To de-select this option add 2048 to the mode). Dynamic resizing will be disabled unless 4096 is added to the mode. To centre the window within the page add 8192 to the mode.

Return Value The window number of the window, or -1 if the window cannot be opened.

CSV_MM_WinPopup Display popup window at x and y coordinates relative to top left corner of active monitor.

Syntax CSV_MM_WinPopup(sWindow, iX, iY, iHideTitleBar)

#sWindow: Name of page window to display.

#iX: X offset to display window at relative to left of monitor.

#iY: Y offset to display window at relative to top of monitor.

#iHideTitleBar

0 = display window standard title bar.

1 = don't display title bar (for XP style window).

Return Value The window number of the window, or -1 if the window cannot be opened.

Note: The entire window is displayed within the borders of a single screen. If iX = -1 and iY = -1, the window is centered on screen.

CSV_MM_WinTitle Sets the window title. Call this function rather than WinTitle to set window title. Changes the title of the page on the last page stack if the window is a main page. Shows the correct page title in the forward/back navigation drop down list.

Syntax CSV_MM_WinTitle(sTitle)

#sTitle: Title of window.

Return Value 0 if successful, otherwise an error.

Page 88: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference84

CSV_Nav_Alarms() Displays Alarm page, or calls function defined for alarm page.

Note: The Network page is defined by the parameter [Navigation] AlarmPage. To specify a function prefix the function name with "?"

Return Value 0 if successful, otherwise -1.

CSV_Nav_AlarmsDisabled()

Displays Disabled Alarm page, or calls function defined for disabled alarm page.

Note: The Network page is defined by the parameter [Navigation] DisabledPage. To specify a function prefix the function name with "?".

Return Value 0 if successful, otherwise -1.

CSV_Nav_AlarmsHardware()

Displays Hardware Alarm page, or calls function defined for hardware alarm page.

Note: The Network page is defined by the parameter [Navigation] HardwarePage. To specify a function prefix the function name with "?"

Return Value 0 if successful, otherwise -1.

CSV_Nav_AlarmsSummary()

Displays Alarm page, or calls function defined for alarm page.

Note: The Network page is defined by the parameter [Navigation] SummaryPage. To specify a function prefix the function name with "?"

Return Value 0 if successful, otherwise -1.

CSV_Nav_CloseWindow()

Displays form to enable user to shutdown Citect.

CSV_Nav_DisableMenuItem

Disables/enables a specified item in a specified popup menu. A disabled menu item appears embossed in the popup menu and cannot be selected.

Syntax CSV_Nav_DisableMenuItem(iMode,sMenuItem,sSubMenuItem,sMenuName,sPageName)

#iMode

Page 89: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 85

1 = disable menu item.

0 = enable menu item.

#sMenuItem: Menu item to enable/disable.

#sSubMenuItem: Submenu item to enable/disable(if applicable).

#sMenuName: Name of menu (ie. button associated with popup menu).

#sPageName: Name of page associated with menu.

Return Value 0 if successful, otherwise –1.

CSV_Nav_DisplayMenuBar

Creates menu bar for specified page. The menu.dbf is accessed to determine what buttons should appear in the menu bar. A new menu bar (ActiveX object) is created with the specified buttons.

Syntax CSV_Nav_DisplayMenuBar(sPageName,iX,iY,nBackColour,nForeColour)

#sPageName: Name of page.

#iX: X-coordinate of top left corner of menu bar.

#iY: Y-coordinate of top left corner of menu bar.

#nBackColour: Background color of menu bar (citect palette number).

#nForeColour: Foreground (font) color of menu bar (citect palette number).

Return Value 0 if successful, otherwise -1.

CSV_Nav_DisplayPopupMenu

Displays popup menu for specified page and specified menu. Top left corner of menu is displayed at nominated x,y coordinates.

Syntax CSV_Nav_DisplayPopupMenu(sPageName,sMenuName,iX,iY)

#sPageName: Name of page.

#sMenuName: Name of menu.

#iX: X-coordinate of top left corner of popup menu.

#iY: Y-coordinate of top left corner of popup menu.

Return Value 0 if successful, otherwise -1.

CSV_Nav_File Displays text/Rich text file.

Page 90: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference86

Syntax CSV_Nav_File(sTitle,sFile,iMode,sFontName,iFontSize,iFontColour, iBackColour,iWordWrap)

#sTitle: Title to appear on file page.

#sFile: File name including path (eg. "[Run]:\file.txt").

#iMode

1 = Locked (don't allow editing).

2 = Allow save (enables save option in popup context menu).

4 = Allow create (creates the file if it doesn't already exist).

8 = Allow open (enable open option in popup context menu - allows user to browse for another file to open).

#sFontName: Name of font to display file in (if not an rtf file).

#iFontSize: Size of font (if not an rtf file).

#iFontColour: Colour of font (if not an rtf file).

#iBackColour: Colour of background.

#iWordWrap: Enable word wrap.

Return Value 0 if successful, otherwise -1.

CSV_Nav_GetEngToolsPrivilege()

Checks that the user has the privilege level required for engineering tools.

Return Value 1 if user has required privilege level, otherwise 0.

CSV_Nav_Help() Displays Help page, or calls function defined for help page.

Note: The Help page is defined by the page environment variable "HelpPage" if it exists, otherwise by the parameter [Navigation] HelpPage. To specify a function prefix the function name with "?"

Return Value 0 if successful, otherwise -1.

CSV_Nav_HelpOnCSVInclude()

Displays Help file for CSV_Include project.

Return Value 0 if successful, otherwise –1.

Page 91: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 87

CSV_Nav_Home() Displays Home page, or calls function defined for home page.

Note: The Home page is defined by the parameter [Navigation] HomePage. To specify a function prefix the function name with "?"

Return Value 0 if successful, otherwise -1.

CSV_Nav_Login() Displays popup form allowing user to login.

CSV_Nav_LoginMenu() Displays popup menu for Screen Login.

Note: Login popup menu is defined by the "Template" page and "Login" menu in the Menu.dbf. If no "Login" menu has been defined in this section of the Menu.dbf then a default menu is displayed.

CSV_Nav_MenuBar_MenuClick

Event triggered by clicking a button in the ActiveX menu bar.

Syntax CSV_Nav_MenuBar_MenuClick(sPageName,sButtonName,iX,iY)

#sPageName: Name of page containing menu bar.

#sButtonName: Name of button clicked.

#iX: X-coordinate of top-left corner of menu bar.

#iY: Y-coordinate of top-left corner of menu bar.

CSV_Nav_Network() Displays Network page, or calls function defined for network page.

Note: The Network page is defined by the parameter [Navigation] NetworkPage. To specify a function prefix the function name with "?"

Return Value 0 if successful, otherwise -1.

CSV_Nav_NetworkBtnEnabled()

Checks if network page exists.

Return Value 1 if network page exists, or function has been specified for network page.

Page 92: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference88

CSV_Nav_PageExists Checks if a page exists by attempting to locate its associated runtime file.

Syntax CSV_Nav_PageExists(sPage)

#sPage: Name of page to check.

Return Value 1 if page exists, otherwise 0.

CSV_Nav_PagePrint() Creates a screen print of the active page, or calls the function defined for page print.

Note: The print function is defined by the page environment variable "PrintPage" if it exists, otherwise by the parameter [Navigation] PrintPage. To specify a function prefix the function name with "?". If no function has been defined, a screen print will be performed.

CSV_Nav_Parent() Displays page configured as ParentPage environment variable for current page, or calls function specified by ParentPage.

Return Value 0 if successful, otherwise -1.

Note: To specify a function prefix the function name with "?".

CSV_Nav_ParentBtnEnabled()

Checks if a page has been defined for the current page.

Return Value 1 if parent page has been defined.

CSV_Nav_Report() Displays Report page, or calls function defined for report page.

Note: The Network page is defined by the parameter [Navigation] ReportPage. To specify a function prefix the function name with "?".

Return Value 0 if successful, otherwise -1.

CSV_Nav_ReportBtnEnabled()

Checks if Report page exists.

Return Value 1 if Report page exists, or function has been specified for Report page.

Page 93: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 89

CSV_Nav_ReportMenu Displays popup menu for Reports.

Note: Report popup menu is defined by the "Template" page and "Reports" menu in the Menu.dbf.

Syntax CSV_Nav_ReportMenu(iX,iY)

#iX: X-coordinate of popup menu position.

#iY: Y-coordinate of popup menu position.

CSV_Nav_Tools() Displays Tools page, or calls function defined for tools page.

Note: The Tools page is defined by the parameter [Navigation] ToolsPage.

To specify a function, prefix the function name with "?".

Return Value 0 if successful, otherwise -1.

CSV_Nav_ToolsBtnEnabled()

Checks if Tools page exists.

Return Value 1 if Tools page exists, or function has been specified for Tools page.

CSV_Nav_ToolsMenu() Displays popup menu for Screen Tools.

Note: Tools popup menu is defined by the "Template" page and "Tools" menu in the Menu.dbf. If no Tools menu has been defined in this section of the Menu.dbf, a default menu is displayed.

CSV_Nav_Trend() Displays Trend page, or calls function defined for trend page.

Note: The Trend page is defined by the parameter [Navigation] TrendPage. To specify a function prefix the function name with "?".

Return Value 0 if successful, otherwise -1.

CSV_Nav_TrendBtnEnabled()

Checks if Trend page exists.

Return Value 1 if Trend page exists, or function has been specified for Trend page.

Page 94: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference90

CSV_Nav_TrendMenu() Displays popup menu for Trends.

Note: Trend popup menu is defined by the "Template" page and "Trends" menu in the Menu.dbf.

CSV_Nav_TrendX() Displays Instant Trend page.

Return Value 0 if successful, otherwise -1.

CSV_Nav_TickMenuItem

Checks/unchecks a specified item in a specified popup menu. A checked menu item appears with a tick beside it in the popup menu.

Syntax CSV_Nav_TickMenuItem(iMode,sMenuItem,sSubMenuItem,sMenuName,sPageName)

#iMode

1 = Check menu item.

0 = Uncheck menu item.

#sMenuItem: Menu item to check/uncheck.

#sSubMenuItem: Submenu item to check/uncheck (if applicable).

#sMenuName: Name of menu (i.e., button associated with popup menu).

#sPageName: Name of page associated with menu.

Return Value 0 if successful, otherwise -1.

CSV_Sec_ShowLoginMenu

Displays a popup menu allowing user to login, logout, change the password, and, if the user has the required privilege, to edit a user or add a user.

Syntax CSV_Sec_ShowLoginMenu(iXpos,iYpos,iUserEditPrivilege)

#iXpos: X position of top-left corner of popup menu.

#iYpos: Y position of top-left corner of popup menu.

#iUserEditPrivilege: Privilege required to edit or add a user.

CSV_String_GetField Gets a field value (text) from a string, where the string consists of a number of fields separated by a field separation character.

Page 95: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 91

Syntax CSV_String_GetField(sText,iField,sFieldSeparator)

#sText: String containing fields.

#iField: Index of field value to return (starting at 1).

#SFieldSeparator: Field separation character.

Return Value Field value as string.

Example sText = "ab?cde?fghi?j";

sField = CSV_String_GetField(sText,3,"?");

In this case sField = "fghi"

CSV_String_GetLines Returns the number of lines in a string, given a maximum number of characters per line.

Syntax CSV_String_GetLines(sText, iChars)

#sText: Text to convert to lines.

#iChars: Maximum number of characters per line.

Return Value Number of lines that text would be converted to.

CSV_String_Replace Returns a string in which a specified substring has been replaced with another substring a specified number of times.

Syntax CSV_String_Replace(sTextString,sFind,sReplace,iStart,iCount)

#sTextString: Expression containing substring to replace.

#sFind: Substring being searched for.

#sReplace: Replacement substring.

#iStart: Optional. Position within expression where substring search is to begin. If omitted, 0 is assumed.

#iCount: Optional. Number of substring substitutions to perform. If omitted, the default value is –1, which means make all possible substitutions.

CSV_Tag_Debug Builds a form to provide simple user access to all Variable Tags during runtime. Reading and writing are supported. The Form is always on top, and only one instance is allowed.

Page 96: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference92

Syntax CSV_Tag_Debug()

Return Value Name of selected tag.

Note: Uses a listbox object to display all tags in system. List may be filtered.

CSV_Trend_AutoScale Auto scales all trend pens, such that the 100% scale is 10% of the full tag range above the maximum tag value in the viewable trend window, and the 0% scale is 10% of the tag range below the minimum tag value in the viewable trend window.

Syntax CSV_Trend_AutoScale(hTrendAN)

#hTrendAN: Animation point number of the trend.

CSV_Trend_DspGroup Displays a specified group of trend pens on a specified trend page. The group of trend pens must have been defined in the TrendGrp.dbf file in the [RUN] directory. The group may be specified by either the group name or the group description.

Syntax CSV_Trend_DspGroup(sTitle,sTrendPage,hTrendAN,sTrendID,iTrendIDType, iTrendDataSet)

#sTitle: Title to appear on trend page.

#sTrendPage: Name of trend page to display.

#hTrendAN: Animation point number of trend.

#sTrendID: Name or Desc of trend group (found in TrendGrp.dbf).

#iTrendIDType: The type of the trend. Two possible values:

0 = sTrendID specifies the Name of the trend group.

1 = sTrendID specifies the description of the trend group.

#iTrendDataSet: Identifies the data set to be used for the group.

Normal trend page uses data set 0, double trend page uses data sets 1 and 2.

CSV_Trend_DspGroupList

Displays available groups of trend tags in a listbox. Returns the description of the item selected from the list. Groups are configured in the TrendGrp.dbf file found in the [RUN] directory.

Syntax CSV_Trend_DspGroupList(sSelectedGroup,sAreas)

#sSelectedGroup: Name of group to preselect in the list.

Page 97: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 93

#sAreas: Areas to enable in the list; i.e., only trend groups belonging to these areas are displayed.

Return Value Trend group (description) selected from the list, or "" if cancel is pressed.

CSV_Trend_DspPopupMenu

Displays a popup menu to allow the user to add or clear the selected pen.

Syntax CSV_Trend_DspPopupMenu(hTrendAN,iPen)

#hTrendAN: Animation point number of the trend.

#iPen: Number of selected pen.

Return Value Description of trend group.

CSV_Trend_DspScaleRange

Returns the current displayed scale range for a specified trend pen, in the format: "Lo - HiEU" where Lo = RangeMin, Hi = RangeMax, and EU = engineering units.

Syntax CSV_Trend_DspScaleRange(hTrendAN,iPen)

#hTrendAN: Animation point number of the trend.

#iPen: Number of the trend pen.

Return Value Formatted range value as a string.

CSV_Trend_DspTrendText

Returns the comment for the trend tag plotted by the specified pen if a comment exists, otherwise returns the name of the trend tag.

Syntax CSV_Trend_DspTrendText(hTrendAN,iPen)

#hTrendAN: Animation point number of the trend.

#iPen: Number of the trend pen.

Return Value Trend tag comment if it exists, otherwise the trend tag name (all capitalized).

CSV_Trend_GetCursorPos

Gets the offset of a trend cursor from its origin, in samples.

Page 98: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference94

Syntax CSV_Trend_GetCursorPos(hTrendAN)

#hTrendAN: Animation point number of the trend.

Return Value The offset of a trend cursor from its origin, in samples, or -1 if the trend cursor is disabled.

CSV_Trend_GetCursorTypeStr

Returns text indicating whether the cusor is displayed. Used in conjunction with CSV_Trend_GetCursorValueStr() to notify the user whether the displayed trend tag value corresponds to the value at the cursor, or the current value.

Syntax CSV_Trend_GetCursorTypeStr(hTrendAN)

#hTrendAN: Animation point number of the trend.

Return Value Returns "Current Value" if the cursor is not displayed, or "Cursor Value" if the cursor is displayed.

CSV_Trend_GetCursorValueStr

Gets the value of a trend pen at the cursor position, or the current value of the trend pen if the cursor is disabled. The value is returned as a string, optionally followed by the engineering units of the tag.

Syntax CSV_Trend_GetCursorValueStr(hTrendAN, iPen, iEngUnits)

#hTrendAN: Animation point number of the trend.

#iPen: Number of the trend pen.

#iEngUnits: Append the engineering units to the cursor value returned.

Return Value Value of the trend pen at the cursor position, or its current value if the cursor is not displayed.

CSV_Trend_GetGroup Gets the description of the group of trends (as defined in TrendGrp.dbf) currently displayed (or last displayed) on a specified monitor.

Syntax CSV_Trend_GetGroup(iMonitor, iTrendDataSet)

#iMonitor: Number of monitor the trend is/was displayed on.

#iTrendDataSet: Identifies the data set to be used for the group of trend tags. Normal trend page uses data set 0; a double trend page uses data sets 1 and 2.

Return Value Description of trend group.

Page 99: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 95

CSV_Trend_GetMode Gets the mode (real-time or historical trending) of the trend pen.

Syntax CSV_Trend_GetMode(hTrendAN)

#hTrendAN: Animation point number of the trend.

Return Value The current mode: 0 for real-time or 1 for historical.

CSV_Trend_GetPen Gets the trend tag being plotted by a specified pen.

Syntax CSV_Trend_GetPen(hTrendAN, iPen)

#hTrendAN: Animation point number of the trend.

#iPen: Number of pen.

Return Value Trend tag of specified pen.

CSV_Trend_GetPenFocus

Gets the trend pen currently in focus.

Syntax CSV_Trend_GetPenFocus(hTrendAN)

#hTrendAN: Animation point number of the trend.

Return Value Number of pen in focus.

CSV_Trend_GetSettings Reads an .ini file to recall (Get) the settings (Tags displayed and scales) for the current page. This function will allocate a separate section in the .ini file for each page.

Syntax CSV_Trend_GetSettings(sPage, hTrendAN)

#sPage: The reference for the settings to recall.

#hTrendAN: Animation point number of the trend.

Example [TrendPage1]

Tag_1=TrendTag1

Zero_1=0.

Full_1=1000.

Tag_2=TrendTag2

Page 100: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference96

Zero_2=0.

Full_2=1000.

Tag_3=TrendTag3

Zero_3=0.

Full_3=1000.

Tag_4=TrendTag4

Zero_4=0.

Full_4=1000.

Tag_5=

Tag_6=

Tag_7=

Tag_8=

Note: Call this function on entry to the Trend Page.

CSV_Trend_GetSettings Writes an .ini file to recall (Get) the settings (tags displayed and scales) for the current page. This function allocates a separate section in the .ini file for each page.

Syntax CSV_Trend_GetSettings(sPage,hTrendAN)

Example [TrendPage1]

Tag_1=TrendTag1

Zero_1=0.

Full_1=1000.

Tag_2=TrendTag2

Zero_2=0.

Full_2=1000.

Tag_3=TrendTag3

Zero_3=0.

Full_3=1000.

Tag_4=TrendTag4

Zero_4=0.

Full_4=1000.

Tag_5=

Tag_6=

Page 101: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 97

Tag_7=

Tag_8=

Note: Call this function on exiting the Trend Page.

CSV_Trend_GetSpan Gets the time span as a time formatted string "HH:MM:SS" for a specified trend.

Syntax CSV_Trend_GetSpan(hTrendAN)

#hTrendAN: Animation point number of the trend.

Return Value The formatted time string.

CSV_Trend_GetTime Gets the time of the trend at a percentage along the trend, using the time 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 left-most sample displayed. Percent 0 (zero) will correspond to the end time, and Percent 100 will correspond to the start time.

Syntax CSV_Trend_GetTime(hTrendAN, iPercent)

#hTrendAN: Animation point number of the trend.

#iPercent: The percentage of the trend from the time of the right-most sample displayed.

Return Value The time of the trend in the format hh:mm:ss.

CSV_Trend_GetDate Gets the date of the trend at a percentage along the trend, using the date of the right-most sample displayed. The date associated with the right-most sample displayed is known as the end date.

The start date is the date of the left-most sample displayed. Percent 0 (zero) will correspond to the end date, and Percent 100 will correspond to the start date.

Syntax GetDate(hTrendAN,iPercent)

#hTrendAN: Animation point number of the trend.

#iPercent: The percentage of the trend from the date of the right-most sample displayed.

Return Value The date of the trend in the format month day year.

Page 102: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference98

CSV_Trend_GroupConfig()

Displays a popup window allowing the user to browse/edit/add/delete records in the TrendGrp.dbf at runtime.

CSV_Trend_Page Builds a trend page with the specified pens.

Syntax CSV_Trend_Page(sPage,sPen1,sPen2,sPen3,sPen4,sPen5,sPen6,sPen7,sPen8)

#sPage: Name of trend page to display.

#sPen1: Trend tag to be trended by pen 1.

#sPen2: Trend tag to be trended by pen 2.

#sPen3: Trend tag to be trended by pen 3.

#sPen4: Trend tag to be trended by pen 4.

#sPen5: Trend tag to be trended by pen 5.

#sPen6: Trend tag to be trended by pen 6.

#sPen7: Trend tag to be trended by pen 7.

#sPen8: Trend tag to be trended by pen 8.

Return Value 0 if successful, otherwise an error number.

CSV_Trend_Popup Builds a Pop-up trend page in a new window with the specified pens. The window is centered on the active monitor.

Syntax CSV_Trend_Popup(sPage,sPen1,sPen2,sPen3,sPen4)

#sPage: Name of trend page to display.

#sPen1: Trend tag to be trended by pen 1.

#sPen2: Trend tag to be trended by pen 2.

#sPen3: Trend tag to be trended by pen 3.

#sPen4: Trend tag to be trended by pen 4.

Return Value Window number of popup trend window; otherwise -1 if the window couldn't be created.

Page 103: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 99

CSV_Trend_ScaleDigital

Rescales digital pens between -2 and 2.

Note: To be rescaled trend tags must have same name as digital variable tag.

Syntax CSV_Trend_ScaleDigital(hTrendAN,iPen)

#hTrendAN: Animation point number of the trend.

#iPen: Number of pen to scale, or -1 for all pens.

CSV_Trend_SelectGroup

Allows the user to select a group of trend tags from a listbox. Each group has an associated name, description and list of up to 8 tags. This function stores the selected group data and returns the name of the group selected from the list.

Note: Groups are configured in the TrendGrp.dbf file found in the [RUN] directory.

Syntax CSV_Trend_SelectGroup(iMonitor,iTrendDataSet)

#iMonitor: Number of monitor the trend is/was displayed on.

#iTrendDataSet: Identifies the data set to be used for the group of trend tags. A normal trend page uses data set 0, double trend page uses data sets 1 and 2.

Return Value Trend group (description) selected from the list, or "" if Cancel is pressed.

CSV_Trend_SelectPen Displays a listbox to allow the user to select a tag to trend with the selected pen.

Syntax CSV_Trend_SelectPen(sSelectedPen)

#sSelectedPen: Name of trend tag to pre-select.

Return Value Name of trend tag selected from list, or "" if action is cancelled.

CSV_Trend_SetCursor If no trend pen has the focus, this function returns, otherwise it 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.

Syntax CSV_Trend_SetCursor(hTrendAN)

#hTrendAN: Animation point number of the trend.

Page 104: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference100

CSV_Trend_SetDate Sets the 0% date of the trend via a keypad form. This allows the user to view trend information up to the date entered.

Syntax CSV_Trend_SetDate(hTrendAN,sValue)

#hTrendAN: Animation point number of the trend.

#sValue: The date to set the 0% trend date to. If sValue = "", a form is displayed for the user to select a date.

Return Value New date (as string).

CSV_Trend_SetDateTime

Sets the 0% date and time of the trend via a keypad form. This allows the user to view trend information up to the time and date entered.

Syntax CSV_Trend_SetDateTime(hTrendAN)

#hTrendAN: Animation point number of the trend.

Return Value New time and date, separated by a space.

CSV_Trend_SetPens Allocates trend tags to trend pens. The names of the trend tags are extracted from a string that stores the last group of trend tags displayed on a particular monitor.

Syntax CSV_Trend_SetPens(hTrendAN, iMonitor, iTrendDataSet)

#hTrendAN: Animation point number of the trend.

#iMonitor: Number of monitor the trend is displayed on (-1 for active monitor).

#iTrendDataSet: Identifies the data set to be used for the group of trend tags. Normal trend page uses data set 0; double trend page uses data sets 1 and 2.

CSV_Trend_SetRange Gets the default range for all trend pens and sets page strings 10–17 to the values of the ranges.

Syntax CSV_Trend_SetRange(hTrendAN)

#hTrendAN: Animation point number of trend.

Page 105: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 101

CSV_Trend_SetScale Allows the user to set the zero and full scale values of the trend. The scale may be changed for all trends or only the current trend.

Syntax CSV_Trend_SetScale(hTrendAN,iPercentage,sValue)

#hTrendAN: Animation point number of trend for which the timebase is to be set.

#iPercentage: Scale percentage to set (0 or 100).

#sValue: Value to set scale percentage to. If sValue = "", a form will be displayed allowing the user to select a new scale.

Return Value New scale value as string.

CSV_Trend_SetSpan Sets the span (total amount of time visible) on the trend.

Syntax CSV_Trend_SetSpan(hTrendAN,sSpan)

#hTrendAN: Animation point number of trend.

#sSpan: Value to set the span to. If sSpan = "", a form will be displayed allowing the user to select the trend span.

Return Value New span as string.

CSV_Trend_SetTime Sets the 0% time of the trend via a keypad form. This allows the user to view trend information up to the time entered.

Syntax CSV_Trend_SetTime(hTrendAN,sValue)

#hTrendAN: Animation point number of the trend.

#sValue: The time to set the 0% trend time to. If sValue = "", a form is displayed for the user to select a time.

Return Value New time (as string).

CSV_Trend_SetTimebase

Allows the operator to set the time interval between each sample.

Syntax CSV_Trend_SetTimebase(hTrendAN,sValue)

#hTrendAN: Animation point number of trend for which the timebase is to be set.

Page 106: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference102

#sValue: Value to set timebase to. If sValue = "", a form will be displayed allowing the user to select a new timebase.

Return Value New timebase as string.

CSV_Trend_UpdatePens

Stores the names of tags currently trended at a specified AN to a string as a comma separated list. A separate string is assigned to each monitor. The string is used to restore the last tags trended when the trend page is redisplayed.

Syntax CSV_Trend_UpdatePens(hTrendAN,iMonitor,iTrendDataSet)

#hTrendAN: Animation point number of the trend.

#iMonitor: Number of monitor the trend is displayed on (-1 for active monitor).

#iTrendDataSet: Identifies the data set to be used for the group of trend tags. Normal trend page uses data set 0, double trend page uses data sets 1 and 2.

CSV_Trend_Win Builds a trend page in a new window with the specified pens.

Syntax CSV_Trend_Win(sPage,iX,iY,iMode,sPen1,sPen2,sPen3,sPen4,sPen5,sPen6,sPen7, sPen8)

#sPage: Name of trend page to display.

#iX: X coordinate of top left corner of window.

#iY: Y coordinate of top left corner of window.

#iMode: Mode of the window (= mode used by WinNewAt).

#sPen1: Trend tag to be trended by pen 1.

#sPen2: Trend tag to be trended by pen 2.

#sPen3: Trend tag to be trended by pen 3.

#sPen4: Trend tag to be trended by pen 4.

#sPen5: Trend tag to be trended by pen 5.

#sPen6: Trend tag to be trended by pen 6.

#sPen7: Trend tag to be trended by pen 7.

#sPen8: Trend tag to be trended by pen 8.

Return Value Window number of the window; otherwise -1 if window can't be opened.

Page 107: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 103

CSV_TrendX_AddVariable

Assigns a variable to the first available instant trend tag. An instant trend tag is available if no variable is currently being trended by it; that is, msTrendXVariable[iTrendNo] = "", where iTrendNo is the number of the instant trend.

Note: This function is to be called only on a trend server. To maintain redundancy the function is also called with the same arguments on the second/redundant trend server.

The variable is assigned a trend duration. The variable name is also added to the end of a queue storing all currently assigned variables in the order in which they were assigned.

If there are no available trend tags then the variable is not assigned to be trended.

Syntax CSV_TrendX_AddVariable(sVariable, iDuration, IupdateRedundantSrvr)

#sVariable: Name of variable to be trended.

#iDuration: Value to preset trend tag timer to. This determines the number of seconds that the variable will be trended for.

#iUpdateRedundantSrvr

1 = update second trend server with same info, i.e. RPC same function on second trend server. Set to 0 only in RPC call from within function itself.

0 = don't RPC second trend server.

Note: Number of instant trend tag assigned to trending sVariable if successful, otherwise -1.

CSV_TrendX_AgeTrends()

Decrements trend countdown timers.

CSV_TrendX_ClearTrend

Clears trend cache and delete trend file associated with specified trend.

This function must be called before a new variable can be assigned to a Instant Trend tag. This must be done as the trend tag may have been previously assigned to a different variable, in which case scrolling back through the trends history could display data not associated with the current variable.

Note: This function is to be called only on a trend server. To maintain redundancy the function is also called with the same arguments on the second/redundant trend server.

Page 108: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference104

Syntax CSV_TrendX_ClearTrend(iTrendNo, IUpdateRedundantSrvr)

#iTrendNo: Number of Instant Trend to be cleared.

#iUpdateRedundantSrvr

1 = update second trend server with same info; i.e., RPC same function on second trend server.

0 = don't RPC second trend server. Set to 0 only in RPC call from within function itself.

CSV_TrendX_Close Frees instant trend tags associated with trend pens. Close the instant trend popup.

Syntax CSV_TrendX_Close(hAN)

#hAN: AN number of instant trend.

CSV_TrendX_DeletePen()

Deletes trend pen on instant trend page. Stop trending variable assigned to instant trend Tag.

#hAN: AN number of Instant Trend

#iPenNo: Number of trend pen to delete.

CSV_TrendX_Display() Displays the Instant Trend popup. Set trend duration to default value.

CSV_TrendX_DspPopupMenu

Creates a popup at the location of the mouse on an Instant Trend page, giving the user a choice of selecting a trend pen (i.e., selecting a tag to be trended by the selected pen), or clearing a trend pen.

If the user chooses 'select trend pen' then a form is displayed allowing the user to select a variable tag to be trended by the pen from a menu of available variable tags. If the user chooses 'clear trend pen', the selected trend pen is deleted. Called when the user right-clicks a trend pen marker.

Syntax CSV_TrendX_DspPopupMenu(hTrendAN, iPenNo)

#hTrendAn: AN number of Instant Trend.

#iPenNo: Number of trend pen to select/clear.

Page 109: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 105

CSV_TrendX_GenericToTag

Converts raw integer value (0–32000) to real value scaled between specified tag's engineering zero and engineering full scale.

Syntax CSV_TrendX_GenericToTag(iValue,sTagName)

#iValue: Raw value scaled between 0 – 32000.

#sTagname: Name of tag whose eng zero and eng full scale values are to be used to scale iValue.

Return Value Value scaled between tag's eng zero scale and eng full scale.

CSV_TrendX_GenericToTagStr

Converts raw integer value (0–32000) to real value scaled between specified tag's engineering zero and engineering full scale, then returns that value as a string.

Note: Instant trend data is stored in generic format. i.e., as a raw integer with range 0–32000. Call this function to convert raw trend value into scaled value to be displayed on the trend popup.

Syntax CSV_TrendX_GenericToTagStr(iValue,sTagName)

#iValue: Raw value scaled between 0 – 32000.

#sTagname: Name of tag whose eng zero and eng full scale values are to be used to scale iValue.

Return Value Value (as string) scaled between tag's eng zero scale and eng full scale.

CSV_TrendX_GetComment

Gets comment associated with variable tag.

Syntax CSV_TrendX_GetComment(sVariable)

#sVariable: Name of tag to retrieve comment for.

Return Value Comment associated with variable tag sVariable.

CSV_TrendX_GetCursor

Gets value of instant trend pen at cursor.

Syntax CSV_TrendX_GetCursor(hAN, iPenNo)

#hAN: AN number of Instant Trend.

#iPenNo: Pen to get cursor value for.

Page 110: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference106

Return Value Value of trend pen at cursor (returned as string). Value is scaled between eng zero and eng full for variable being trended, as specified by in variable tag configuration.

CSV_TrendX_GetDuration()

Gets duration associated with instant trend popup.

Return Value Trend duration of instant trend popup, in long time period format (hh:mm:ss).

CSV_TrendX_GetSamplePeriod

Gets period at which trend tag is being sampled.

Syntax CSV_TrendX_GetSamplePeriod(iTrendNo)

#iTrendNo: Number of trend tag to get sample period for.

Return Value Sample period of specified Instant Trend (in seconds).

Note: This is not the same as the sample period specified in the trend tag configuration form (which is set to 1 sec). The sample period for a Instant Trend can be set dynamically at run time.

CSV_TrendX_GetScale Gets value representing a percentage of the displayed range for trend pen in focus. Used for determining/displaying 0, 50, 100% etc, scale on Instant Trend page.

Syntax CSV_TrendX_GetScale(hAN, iPercent)

#hAN: AN number of Instant Trend.

#iPercent: Percentage of full scale.

Return Value Scale value.

CSV_TrendX_GetTrendName

Gets name of instant trend from number of instant trend.

Syntax CSV_TrendX_GetTrendName(iTrendNo)

#iTrendNo: Number of instant trend tag.

Return Value Name of trend tag.

Page 111: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 107

CSV_TrendX_GetTrigger

DescriptionThis function is called in the Trigger field of the Trend Tag configuration form for all Instant Trend tags.

Syntax CSV_TrendX_GetTrigger(iTrendNo)

#iTrendNo: Number of the instant trend tag.

Return Value Return ValueTrigger setting for each Instant Trend tag.

CSV_TrendX_GetVal This function is called in the Expression field of the Trend Tag configuration form for all instant trend tags. Makes the element of the array that stores the value assigned to a trend tag available to the trend system.

Syntax CSV_TrendX_GetVal(iTrendNo)

#iTrendNo: Number of the instant trend tag.

Return Value Last stored value of the variable associated with the instant trend tag, as an integer between –1 and 32000.

CSV_TrendX_InitClient() Initializes trend client for instant trending.

Note: This function is to be called on startup for all trend clients if instant trend functionality is required. To implement this without requiring a call to this function from within the startup cicode function, it has been configured as a periodic event (listed as a CSV_TrendXClient event). The first time the event is processed the instant trend client functionality is initialized. All subsequent calls return immediately without effect.

CSV_TrendX_InitSrvr() Initializes trend server for instant trending. Set up table used for clearing data in trend cache. Set all instant trend triggers to 1. Initializes queue for storing names of variables being trended by instant trend system.

Note: This function is to be called on startup for all trend servers if instant trend functionality is required. To implement this without requiring a call to this function from within the startup cicode function, it has been configured as a periodic event (listed as a CSV_TrendXServer event). The first time the event is processed the instant trend server functionality is initialized. Subsequent calls return immediately without effect.

Page 112: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference108

CSV_TrendX_MapTrendTags()

Wrapper function for _CSV_TrendX_MapTrendTags. Called as an event on trend server every 1 second, to update all trend tag values (if CSV_TrendXServer event has been enabled).

CSV_TrendX_RefreshTrendPage

Refreshes trend page. Called after a variable has been added to instant trend system. Scrolls to current time.

Syntax CSV_TrendX_RefreshTrendPage(hAN)

#hAN: AN number of instant trend.

Note: Calling TrendSetNow results in old/invalid data being cleared from the screen. This is necessary when the variable being trended by a pen changes.

CSV_TrendX_SetDuration

Sets duration of Instant Trend popup.

Syntax CSV_TrendX_SetDuration(iDuration, iDspNumPad)

#iDuration: Duration of popup (in seconds).

#iDspNumPad: Display number pad for data entry.

CSV_TrendX_SetDuration

Sets duration of Instant Trend on trend server.

Note: This function is to be called only on a trend server. To maintain redundancy, the function is also called with the same arguments on the second/redundant trend server.

Syntax CSV_TrendX_SetDuration(iTrendNo,iDuration,iUpdateRedundantSrvr)

#iTrendNo: Number of trend to set duration for.

#iDuration: Duration of popup (in seconds).

#iUpdateRedundantSrvr

1 = Update second trend server with same info; i.e., RPC same function on second trend server.

0 = Don't RPC second trend server. Set to 0 only in RPC call from within function itself.

Return Value 0 if successful, otherwise –1.

Page 113: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 109

CSV_TrendX_SetPen() Displays form allowing user to select variable to assign to trend pen.

CSV_TrendX_SetSamplePeriod

Sets the sample period for a specified instant trend pen. For display purposes only, the sample period is stored as a page-based integer. This is updated when this function is called. The sample period is updated on the trend server.

Syntax CSV_TrendX_SetSamplePeriod(hAN, iPenNo, iPeriod)

#hAN: Number of Instant Trend AN.

#iPenNo: Number of pen to update sample period.

#iPeriod: Time (in seconds) to set new sample period to.

CSV_TrendX_SetScale Sets scale for instant trend. Scale may be set for all pens or current pen only.

Syntax CSV_TrendX_SetScale(hAN,iPercent,iScaleVal,iDspNumPad)

#hAN: AN number of Instant Trend.

#iPercent: Percent of displayed range that scale setting represents.

#iScaleVal: New scale value.

#iDspNumPad: Display number pad for setting scale.

CSV_TrendX_TagSelect Assigns a variable to a pen on the Instant Trend page. The variable will be assigned to the first available Instant Trend tag. The local page based variables accessed by the trend page are updated.

Return Value Number of instant trend tag assigned to trending sVariable if successful, otherwise -1.

Syntax CSV_TrendX_TagSelect(hAN,iPenNo,sVariable)

#hAN: AN number of Instant Trend.

#iPenNo: Number of pen to assign to variable.

#sVariable: Name of variable to assign to pen.

CSV_TrendX_TagSelectFrmCursor()

Assigns a variable to a pen on the Instant Trend page by positioning the mouse pointer over an animation point. The variable associated with the AN point will be selected.

Page 114: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference110

CSV_TrendX_TagToGeneric

Converts real value scaled between specified tag's engineering zero and engineering full scale, to a raw integer value (0 - 32000).

Instant Trend data is stored in generic format. i.e. as a raw integer with range 0 – 32000.

Syntax CSV_TrendX_TagToGeneric(rValue, sTagName)

#rValue: Scaled value to convert to raw integer 0–32000.

#sTagname: Name of tag whose eng zero and eng full scale values rValue is scaled between.

Return Value Value scaled between 0–32000.

CSV_TrendX_TrendTimeout

Monitors time remaining for trends associated with instant trend popup.

Syntax CSV_TrendX_TrendTimeout(hAN)

#hAN: Number of Instant Trend AN.

Return Value 1 if trend has timed out, 0 otherwise.

CSV_WinUtl_DestroyCursor()

Deletes the specified cursor and sets the cursor to the normal cursor.

CSV_WinUtl_GetColourRes()

Gets the screen color resolution.

Return Value Screen color resolution: 0 = 256 colors, 1 = High color (16 bit), 2 = True color (24 bit/32 bit), -1 = Error.

CSV_WinUtl_GetCpuUsage

Gets the percent CPU usage of a specified process, or the total CPU usage.

Syntax CSV_WinUtl_GetCpuUsage(sProcessName)

#sProcessName: Name of process, or "" to get total CPU usage.

Return Value Percentage CPU usage.

Page 115: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 111

CSV_WinUtl_GetSystemDir()

Gets the windows system directory.

Return Value Windows system directory path.

CSV_WinUtl_GetTotalCpuUsage()

Gets the total percent CPU usage.

Note: Call CSV_WinUtl_UpdateTotalCpuUsage to refresh the data (CSV_WinUtl_UpdateTotalCpuUsage prevents a 'Foreground Cicode run too long' error).

Return Value Total CPU Usage.

CSV_WinUtl_GetWindowsDir()

Gets the windows directory.

Return Value Windows directory path.

CSV_WinUtl_GetWinMode()

Returns 1 if Citect is in Fullscreen mode.

Return Value 1 if fullscreen mode([Animator]Fullscreen = 1), otherwise 0.

CSV_WinUtl_LoadCursor

Loads the cursor for a specified window from a file (.ani or .cur).

Syntax CSV_WinUtl_LoadCursor(sCursor,hWnd)

#sCursor: File (including path) containing cursor.

#hWnd: Handle of window to change cursor for.

Return Value Handle to new cursor.

CSV_WinUtl_LockWindowUpdate

Freezes the specified window (prevents Citect repainting it).

Syntax CSV_WinUtl_LockWindowUpdate(hWnd)

Page 116: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference112

#hWnd: Handle of window to freeze, or -1 to unfreeze any frozen window.

Return Value 0 if successful, otherwise -1.

CSV_WinUtl_NormalCursor

Loads the normal cursor for a specified window.

Syntax CSV_WinUtl_NormalCursor(hWnd)

#hWnd: Handle of window to change cursor for.

Return Value Handle to normal cursor.

CSV_WinUtl_ShellExec Opens or prints a specified file.

Syntax CSV_WinUtl_ShellExec(sOperation,sFile,sArgs,sDir,iShowCmd)

#sOperation: Specifies the operation to perform. The following operation strings are valid:

open - Opens the file specified by the lpFile parameter. The file can be an executable file or a document file. It can also be a folder.

print - The function prints the file specified by lpFile. The file should be a document file. If the file is an executable file, the function opens the file, as if "open" had been specified.

explore - The function explores the folder specified by lpFile. This parameter can be "". In that case, the function opens the file specified by lpFile.

#sFile: Specifies the file to open or print or the folder to open or explore. The function can open an executable file or a document file. The function can print a document file.

#sArgs: If sFile specifies an executable file, sArgs specifies the parameters to be passed to the application. If sFile specifies a document file, sArgs should be "".

#sDir: Specifies the default directory.

#iShowCmd: If sFile specifies an executable file, iShowCmd specifies how the application is to be shown when it is opened. This parameter can be one of the following values:

SW_HIDE (=0) - Hides the window and activates another window.

SW_MAXIMIZE (=3) - Maximizes the specified window.

Page 117: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference 113

SW_MINIMIZE (=6) - Minimizes the specified window and activates the next top-level window in the z-order.

SW_RESTORE (=9) - Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized window.

SW_SHOW (=5) - Activates the window and displays it in its current size and position.

SW_SHOWDEFAULT (=10) - Sets the show state based on the SW_ flag specified in the STARTUPINFO structure passed to theCreateProcess function by the program that started the application. An application should call ShowWindow with this flag to set the initial show state of its main window.

SW_SHOWMAXIMIZED (=3) - Activates the window and displays it as a maximized window.

SW_SHOWMINIMIZED (=2) - Activates the window and displays it as a minimized window.

SW_SHOWMINNOACTIVE (=7) - Displays the window as a minimized window. The active window remains active.

SW_SHOWNA (=8) - Displays the window in its current state. The active window remains active.

SW_SHOWNOACTIVATE (=4) - Displays a window in its most recent size and position. The active window remains active.

SW_SHOWNORMAL (=1) - Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time. If sFile specifies a document file, nShowCmd should be zero.

Return Value Returns a value greater than 32 if successful, or an error value that is less than or equal to 32 otherwise. The following table lists the error values.

ERROR_FILE_NOT_FOUND (=2) - The specified file was not found.

ERROR_PATH_NOT_FOUND (=3) - The specified path was not found.

ERROR_BAD_FORMAT (=17) - The .exe file is invalid (non-Win32® .exe or error in .exe image).

SE_ERR_ACCESSDENIED (=5) - The operating system denied access to the specified file.

SE_ERR_ASSOCINCOMPLETE (=27) - The file name association is incomplete or invalid.

Page 118: CitectSCADA CSV Include

Chapter 4: CSV_Include Reference114

SE_ERR_DDEBUSY (=30) - The DDE transaction could not be completed because other DDE transactions were being processed.

SE_ERR_DDEFAIL (=29) - The DDE transaction failed.

SE_ERR_DDETIMEOUT (=28) - The DDE transaction could not be completed because the request timed out.

SE_ERR_DLLNOTFOUND (=32) - The specified dynamic-link library was not found.

SE_ERR_FNF (=2) - The specified file was not found.

SE_ERR_NOASSOC (=31) - There is no application associated with the given file name extension.

SE_ERR_OOM (=8) - There was not enough memory to complete the operation.

SE_ERR_PNF (=3) - The specified path was not found.

SE_ERR_SHARE (=26) - A sharing violation occurred.

CSV_WinUtl_UpdateTotalCpuUsage()

Updates the total percent CPU usage at minimum of 0.5 second intervals. Called from the Admin Tools page.

CSV_WinUtl_WaitCursor

Loads the wait/busy cursor for a specified window.

Syntax CSV_WinUtl_WaitCursor(hWnd)

#hWnd: Handle of window to change cursor for.

Return Value Handle to wait cursor.

Page 119: CitectSCADA CSV Include

Chapter 5: CSV_Example Project

The CSV_Example Project is a preconfigured project that is installed with CitectHMI/SCADA Version 5.5 or later. The project demonstrates CitectSCADA functionality via a series of pages created from the CSV_Include project templates.

This information complements the CSV_Include information, and describes the pages that are specifically configured in this project for demonstration purposes.

The pages described include:

Filter page

Loop Page

Recipe Page

Genies Page

Operator Input Page

Dynamic Objects Page

Filter pageThe Filter page is the layout page for controlling and monitoring a copper filtration process. Copper concentrate enters a tank (top left) and mixes with flocculent to a specified density. The DIC_104 button displays a faceplate. Pump A pumps the mixture to the filter tank, through VALVE_512. Pump B pumps spillage (from the process) back to the mixing tank.

The DEVICE STATUS panel displays the status (on/off or open/closed) of the pumps, valve, and density faceplate.

See Also Filter Page (Engineers Notes)

To do this: Do this...Start or stop a pump Click the Pump A or Pump B button to display the command panel, and

then click the MANUAL and START (or STOP) buttons.Open or close the valve Click the VALVE_512 button to display the command panel, and then click

the MANUAL and OPEN (or CLOSE) buttons.Switch the filter on or off Click the Disk Filter button to toggle the filter on and off.Display the runtime for Pump A Click the Spanner button to display the accumulator panel for the pump.Display Loop Faceplates Click the Flocculent, Torque, Bed Depth, and Density numbers.

Page 120: CitectSCADA CSV Include

Chapter 5: CSV_Example Project116

Filter Page (Engineers Notes)To view information about any variable, move the mouse cursor onto the variable and press F11.

To configure this feature in your own project:

1 Start Citect Project Editor.

2 Choose Definitions | Keyboard Keys.

3 In the Key Name text box, enter F11.

4 In the Key Code text box, enter Key_F11.

5 Choose System | Keyboard.

6 In the Key Sequence text box, enter F11.

7 In the Command text box, enter InfoForm();.

Loop PageThe Loop page provides control for five loops:

To change the setpoint for a loop, move the red thumb on the slider control.

To adjust the gain, integral, or derivative of a loop, click the Tune button.

See Also Loop Page (Engineers Notes)

Loop Page (Engineers Notes)This page was created using the NORMAL template and the Face1 Super Genie, as follows:

1 From the Graphics Builder, select the (File New) tool.

2 Click the Page button.

3 Double-click the Normal template.

4 Select the Super Genie tool.

5 From the Paste Super Genie File window, choose Faceplate.

6 Double-click the genie.

Page 121: CitectSCADA CSV Include

Chapter 5: CSV_Example Project 117

7 Type LOOP_1 in the Base Tag field.

8 Click OK.

This Super Genie requires a Base Tag with the following attributes, declared as Variable Tags, i.e.:

LOOP_1 is the Base Tag and _PV is the Attribute.

Recipe PageThe Recipe page is the layout page for a bread-making process.

To select a recipe to manufacture:

1 Click the Select\Edit button.

2 Use the Prev or Next buttons to locate the recipe.

3 Click the Select button.

To start the manufacturing process, click the Start Process button. The process stops automatically when complete.

See Also Recipe Page (Engineers Notes)

Recipe Page (Engineers Notes)The recipe functions on this page are provided through the Cicode Recipe() function, included with this Example project. You can adapt this function to your own project by copying the file recipe.ci to your project, and editing the file to suit your needs.

Use the Windows File Manager to copy the file RECIPE.CI file to your project (e.g. \Citect\user\myproj)

1 In the Project Editor, click the Recipe tool.

LOOP_1_PV Process Variable INTLOOP_1_SP Setpoint INTLOOP_1_OP Output INTLOOP_1_OPM Output Mode DIGITALLOOP_1_P Gain (Proportional Band) INTLOOP_1_I Integral (Reset) INTLOOP_1_D Derivative (Rate) INT

Page 122: CitectSCADA CSV Include

Chapter 5: CSV_Example Project118

2 From the Edit Library dilaog box, click New.

3 In the File Name text box, enter Recipe.

4 Click Add.

5 Click Edit to edit the Recipe function.

6 To invoke the recipe display, add a button to your page with the command EditRecipe().

Genies PageThe Test Genies button toggles a tag off or on. You can see how Genies represent on or off conditions.

See Also Genies Page (Engineers Notes)

Genies Page (Engineers Notes)This page contains a selection of Genies from the Citect Include Project and the Example Project. Genies that are stored in the Include Project are accessible to all projects. Any project that you create will be able to access these Genies.

Genies that are stored in the Example project (or your own project) are accessible only by the Example project. If you create your own Genies you should store them in your own project (not in the Include Project), as this way, they will be automatically backed up with your project and can be easily transported to another computer.

If the Genies in the Include Project are not exactly what you want, copy them into your project, change their name, then edit them the way you want.

When you save Genies into your own project, Citect will take care of displaying your Genies on the menus and dialog boxes, just like the ones supplied with Citect. If you have a genie library name, and genie name, which is the same as one in the Include Project, yours will take precedence. If you have the same Genie Library Name but a different Genie name, Citect will display both lots of Genies together.

To copy the Genies from the Examples project:

Use File Manager or Explorer to copy the files from the Example project directory to your project directory.

*.CTL Citect Symbol Library Files

*.CTM Citect Genie files

*.FRM Citect form files

Page 123: CitectSCADA CSV Include

Chapter 5: CSV_Example Project 119

Note: This copies all the Symbol library files. You can copy only the files you need if you prefer.

Operator Input PageThis page lets you experiment with various methods of handling operator input objects. The options shown here are only a few of the possibilities available.

To move the slider, point to the number then click and drag the mouse.

To enter new values position the mouse over the number, type the new value and press Enter. To enter values via a number pad, double-click the numbers.

Dynamic Objects PageThis page provides a way to experiment with the dynamic properties of various objects.

Page 124: CitectSCADA CSV Include

Chapter 5: CSV_Example Project120

Page 125: CitectSCADA CSV Include

IndexSymbols[Alarm]LastAlarmCategories parameter, 30[Alarm]LastAlarmFmt parameter, 30[Alarm]LastAlarmPriorities parameter, 31[Alarm]LastAlarmType parameter, 31[Alarm]Soundn parameter, 30[Alarm]SoundnInterval parameter, 30[Multimonitors]LastPageStackSize parameter, 32[Multimonitors]Monitors parameter, 32[Multimonitors]ScreenWidth parameter, 32[Multimonitors]StartupPagen parameter, 32[Navigation]AlarmPage parameter, 35[Navigation]DisabledPage parameter, 35[Navigation]FilePage parameter, 34[Navigation]HardwarePage parameter, 35[Navigation]HelpPage parameter, 34[Navigation]HomePage parameter, 33[Navigation]MenuBackColour parameter, 36[Navigation]MenuForeColour parameter, 37[Navigation]MenuXPos parameter, 36[Navigation]MenuYPos parameter, 36[Navigation]NetworkPage parameter, 33[Navigation]SummaryPage parameter, 35[Navigation]ToolsPage parameter, 34[Navigation]TrendPage parameter, 34[Page]DelayRepaint parameter, 33[Page]MenuDisable parameter, 33[Privilege]AckAlarms parameter, 38[Privilege]DisableAlarms parameter, 38[Privilege]EditUser parameter, 39[Privilege]EngTools parameter, 39[Privilege]Shutdown parameter, 39[TrendX]Duration parameter, 38[TrendX]KeySeq parameter, 38[TrendX]TagListEnable parameter, 38

AActive Alarms button, 15Admin Tools page template, 10alarm page template, 4Alarm Silence button, 16

alarms group, 25Alarms Summary button, 16Alarms toolbar, 15alarms, audible, 20audible alarms, implementing, 20Autoscale button, 8

BBack button, 12

Ccommon toolbars, 11Computer Setup Wizard, 18Configure Alarm Groups dialog box, 26Configure Trend Groups dialog box, 27Control Menu page, 18creating

alarms group, 25custom menus, 22, 24pages, 21projects, 17

CSV_Alarms_Ack function, 46CSV_Alarms_AckHardware function, 47CSV_Alarms_AckPage function, 47CSV_Alarms_AckRec function, 47CSV_Alarms_AdvFilter function, 47CSV_Alarms_AdvFilterConfig function, 48CSV_Alarms_AdvFilterQuery function, 48CSV_Alarms_AdvFilterSetDateTime function, 49CSV_Alarms_CheckSound function, 49CSV_Alarms_ClearGroupFilter function, 50CSV_Alarms_Disable function, 50CSV_Alarms_DisableRec function, 51CSV_Alarms_DspGroupFilter function, 51CSV_Alarms_DspGroupList function, 51CSV_Alarms_DspInfo function, 51CSV_Alarms_DspInfoRec function, 52CSV_Alarms_DspLast function, 52CSV_Alarms_Enable function, 53CSV_Alarms_EnableRec function, 53CSV_Alarms_GetAckPrivilege() function, 53CSV_Alarms_GetDisablePrivilege() function, 53CSV_Alarms_GetGroupFilter function, 53CSV_Alarms_GetGroupFilterID function, 54

Page 126: CitectSCADA CSV Include

122 Index

CSV_Alarms_GetUniqueGroupName function, 54CSV_Alarms_GroupAdd function, 55CSV_Alarms_GroupConfig() function, 55CSV_Alarms_GroupEdit function, 56CSV_Alarms_GroupFilter function, 56CSV_Alarms_GroupRemove function, 55CSV_Alarms_GroupSelect function, 57CSV_Alarms_GroupsInit() function, 57CSV_Alarms_Help function, 57CSV_Alarms_HelpRec function, 58CSV_Alarms_ListHeading function, 58CSV_Alarms_ListHeadingFont() function, 58CSV_Alarms_PopupMenu function, 59CSV_Alarms_Silence() function, 59CSV_Alarms_Sound() function, 59CSV_Alarms_SoundActive() function, 59CSV_DB_BOF function, 60CSV_DB_Close function, 60CSV_DB_EOF() function, 60CSV_DB_Execute function, 60CSV_DB_GetExecuteError function, 61CSV_DB_GetFieldCount function, 62CSV_DB_GetFieldIndex function, 62CSV_DB_GetFieldName function, 62CSV_DB_GetFieldText function, 62CSV_DB_GetRowCount function, 62CSV_DB_GetRowCurrent function, 63CSV_DB_GetRowFieldText function, 63CSV_DB_MoveFirst function, 63CSV_DB_MoveLast function, 63CSV_DB_MoveNext function, 63CSV_DB_MoveOffset function, 63CSV_DB_MovePrev function, 64CSV_DB_StandbyConnectionActive function, 64CSV_DB_StrToSQL function, 64CSV_Display_Display_Logo function, 64CSV_Display_Display_ServicePack() function, 65CSV_Display_Title() function, 65CSV_Display_Version() function, 65CSV_Example project, 115CSV_File_Display function, 65CSV_File_Print function, 66CSV_File_Save function, 66CSV_Form_Centre function, 66CSV_Form_Login() function, 66

CSV_Form_NumPad function, 66CSV_Form_Position function, 67CSV_Form_Shutdown() function, 67CSV_Form_UserCreate() function, 67CSV_Form_UserPassword() function, 68CSV_Include citect.ini parameters, 29CSV_Include functions, 40CSV_ListBox_AddItem function, 68CSV_ListBox_Clear function, 68CSV_ListBox_Create() function, 68, 69CSV_ListBox_Destroy function, 69CSV_ListBox_GetCategory function, 69CSV_ListBox_GetItem function, 69CSV_ListBox_GetItemID function, 69CSV_ListBox_GetSelectedItem function, 70CSV_ListBox_GetSelectedItemCategory function, 70CSV_ListBox_GetSelectedItemID function, 70CSV_ListBox_GetTagComment function, 70CSV_ListBox_GetTagDescFromTag function, 71CSV_ListBox_GetTagName function, 71CSV_ListBox_GetTrendDescFromTag() function, 71CSV_ListBox_Hide function, 71CSV_ListBox_RemoveItem function, 71CSV_ListBox_SelectCategories function, 72CSV_ListBox_SelectTags() function, 72CSV_ListBox_SelectTrends() function, 72CSV_ListBox_SetText function, 72CSV_ListBox_Show function, 73CSV_ListBox_TagFormat function, 73CSV_ListBox_Visible function, 73CSV_Math_RoundDown function, 73CSV_Math_Truncate function, 74CSV_MenuConfig_Close() function, 74CSV_MenuConfig_Display() function, 74CSV_MenuConfig_LoadDflt() function, 74CSV_MenuConfig_UserPages() function, 74CSV_MessageBox function, 75CSV_Misc_CheckNumPadValue function, 76CSV_Misc_IntRange function, 77CSV_Misc_MouseOver function, 77CSV_MM_BackEmpty() function, 77CSV_MM_ConfigInit() function, 77CSV_MM_FwdEmpty() function, 78CSV_MM_GetMonitor() function, 78CSV_MM_GetMonitors() function, 78

Page 127: CitectSCADA CSV Include

123Index

CSV_MM_GetMouseX function, 78CSV_MM_GetMouseY function, 78CSV_MM_GetOffset function, 79CSV_MM_GetScreenWidth() function, 79CSV_MM_ListLastPages function, 79CSV_MM_MonitorFromPoint function, 79CSV_MM_MonitorFromWindow function, 80CSV_MM_MonitorGoto function, 80CSV_MM_NextEmpty() function, 80CSV_MM_PageDisplay function, 80CSV_MM_PageLast function, 81CSV_MM_PageNext() function, 81CSV_MM_PagePrev() function, 81CSV_MM_PagesInit() function, 81CSV_MM_PreviousEmpty() function, 81CSV_MM_StoreLastPage function, 82CSV_MM_WinDrag() function, 82CSV_MM_WinDragEnd() function, 82CSV_MM_WinFree() function, 82CSV_MM_WinNewAt function, 82CSV_MM_WinPopup function, 83CSV_MM_WinTitle function, 83CSV_Nav_Alarms() function, 84CSV_Nav_AlarmsDisabled() function, 84CSV_Nav_AlarmsHardware() function, 84CSV_Nav_AlarmsSummary() function, 84CSV_Nav_CloseWindow() function, 84CSV_Nav_DisableMenuItem function, 84CSV_Nav_DisplayMenuBar function, 85CSV_Nav_DisplayPopupMenu function, 85CSV_Nav_File function, 85CSV_Nav_GetEngToolsPrivilege() function, 86CSV_Nav_Help() function, 86CSV_Nav_HelpOnCSVInclude() function, 86CSV_Nav_Home() function, 87CSV_Nav_Login() function, 87CSV_Nav_LoginMenu() function, 87CSV_Nav_MenuBar_MenuClick function, 87CSV_Nav_Network() function, 87CSV_Nav_NetworkBtnEnabled() function, 87CSV_Nav_PageExists function, 88CSV_Nav_PagePrint() function, 88CSV_Nav_Parent() function, 88CSV_Nav_ParentBtnEnabled() function, 88CSV_Nav_Report() function, 88

CSV_Nav_ReportBtnEnabled() function, 88CSV_Nav_ReportMenu function, 89CSV_Nav_TickMenuItem function, 90CSV_Nav_Tools() function, 89CSV_Nav_ToolsBtnEnabled() function, 89CSV_Nav_ToolsMenu() function, 89CSV_Nav_Trend() function, 89CSV_Nav_TrendBtnEnabled() function, 89CSV_Nav_TrendMenu() function, 90CSV_Nav_TrendX() function, 90CSV_Sec_ShowLoginMenu function, 90CSV_String_GetField function, 90CSV_String_GetLines function, 91CSV_String_Replace function, 91CSV_Tag_Debug function, 91CSV_Trend_AutoScale function, 92CSV_Trend_DspGroup function, 92CSV_Trend_DspGroupList function, 92CSV_Trend_DspPopupMenu function, 93CSV_Trend_DspScaleRange function, 93CSV_Trend_DspTrendText function, 93CSV_Trend_GetCursorPos function, 93CSV_Trend_GetCursorTypeStr function, 94CSV_Trend_GetCursorValueStr function, 94CSV_Trend_GetDate function, 97CSV_Trend_GetGroup function, 94CSV_Trend_GetMode function, 95CSV_Trend_GetPen function, 95CSV_Trend_GetPenFocus function, 95CSV_Trend_GetSettings function, 95CSV_Trend_GetSpan function, 97CSV_Trend_GetTime function, 97CSV_Trend_GroupConfig() function, 98CSV_Trend_Page function, 98CSV_Trend_Popup function, 98CSV_Trend_ScaleDigital function, 99CSV_Trend_SelectGroup function, 99CSV_Trend_SelectPen function, 99CSV_Trend_SetCursor function, 99CSV_Trend_SetDate function, 100CSV_Trend_SetDateTime function, 100CSV_Trend_SetPens function, 100CSV_Trend_SetRange function, 100CSV_Trend_SetScale function, 101CSV_Trend_SetSpan function, 101

Page 128: CitectSCADA CSV Include

124 Index

CSV_Trend_SetTime function, 101CSV_Trend_SetTimebase function, 101CSV_Trend_UpdatePens function, 102CSV_Trend_Win function, 102CSV_TrendX_AddVariable function, 103CSV_TrendX_AgeTrends() function, 103CSV_TrendX_ClearTrend function, 103CSV_TrendX_Close function, 104CSV_TrendX_DeletePen() function, 104CSV_TrendX_Display() function, 104CSV_TrendX_DspPopupMenu function, 104CSV_TrendX_GenericToTagStr function, 105CSV_TrendX_GetComment function, 105CSV_TrendX_GetDuration() function, 106CSV_TrendX_GetSamplePeriod function, 106CSV_TrendX_GetScale function, 106CSV_TrendX_GetTrendName function, 106CSV_TrendX_GetTrigger function, 107CSV_TrendX_GetVal function, 107CSV_TrendX_InitClient() function, 107CSV_TrendX_InitSrvr() function, 107CSV_TrendX_MapTrendTags() function, 108CSV_TrendX_RefreshTrendPage function, 108CSV_TrendX_SetDuration function, 108CSV_TrendX_SetPen() function, 109CSV_TrendX_SetSamplePeriod function, 109CSV_TrendX_SetScale function, 109CSV_TrendX_TagSelect function, 109CSV_TrendX_TagSelectFrmCursor() function, 109CSV_TrendX_TagToGeneric function, 110CSV_TrendX_TrendTimeout function, 110CSV_WinUtl_DestroyCursor() function, 110CSV_WinUtl_GetColourRes() function, 110CSV_WinUtl_GetCpuUsage function, 110CSV_WinUtl_GetSystemDir() function, 111CSV_WinUtl_GetTotalCpuUsage() function, 111CSV_WinUtl_GetWindowsDir() function, 111CSV_WinUtl_GetWinMode() function, 111CSV_WinUtl_LoadCursor function, 111CSV_WinUtl_LockWindowUpdate function, 111CSV_WinUtl_NormalCursor function, 112CSV_WinUtl_ShellExec function, 112CSV_WinUtl_UpdateTotalCpuUsage() function, 114CSV_WinUtl_WaitCursor function, 114

DDisabled Alarms button, 16Dynamic Objects page, 119

EEdit Item Menu dialog box, 25editing menu items, 25Events Setup page, 18Export to file button, 8

Ffile page template, 9Filter page, 115, 116Forward button, 12

GGenies page, 118

HHardware Alarms button, 16Help button, 14History mode, 7Home Page button, 13

Iinstant trending, 19

LLast Alarms panel, 15Login button, 14Loop page, 116

Mmenu configuration tool, 22menus, 24

creating, 22Monitors parameter, 20, 20multiple monitors, using, 20

Nnavigation toolbar, 12

Page 129: CitectSCADA CSV Include

125Index

Network Page button, 13normal page template, 4

OOperator Input page, 119

Ppages, 21pages, preconfigured, 3Parent Page button, 13Paste to clipboard button, 9Plot trend button, 9preconfigured pages, 3Previous/Next buttons, 13Print Page button, 14privileged user, 17projects, creating, 17

Rrange markers, 7Recipe page, 117

Sscale defaults, 8scale markers, 7Set span button, 7span markers, 7StartupPagen parameter, 20SV_Form_UserEdit() function, 68

SV_Trend_GetSettings function, 96SV_TrendX_GenericToTag function, 105SV_TrendX_GetCursor function, 105

Ttemplates

Admin Tools page, 10alarm page, 4CSV_Include, 3file page, 9normal page, 4trend page, 5

toolbarAlarms, 15navigation, 12

toolbars, common, 11Tools button, 14trend cursor, 7Trend group folder, 9trend page template, 5trending, instant, 19trends group, 27Trends Page button, 13

Uuser, privileged, 17

ZZoom buttons, 8

Page 130: CitectSCADA CSV Include

126 Index