You are on page 1of 24

Citect SCADA/Vijeo

Assignment 2
Assignment 2(Module7-12)

Estimated Duration-90mints

Total Marks – 100

Module – 7

1) What are the steps involved in Time Scheduler Configuration? 5M

The configuration of time scheduler involves four steps


i) Defining a Calendar
ii) Defining Programs
iii) Selecting tags
iv) Assigning a Schedule to a Program

Defining a Calendar – Assigns the defined dates and special days to the
calendar. An existing calendar can be modify the planned monthly schedule. It is
applicable to the current projects only.

Defining Programs – Configures the program after defining the program


type. It consists of assigning tag to a named program. Up to 200 programs can be
configured and each program can be configured to have a maximum limit of 120
tags. Program configuration window is used to configure the program.

Selecting Tags – The required tag has to be selected to include in the


program. When assigning to the program, the tags are selected using the Selection
tag PLC window. Using this window, values can be assigned to the tags.

Assigning a Schedule to a Program – It specifies, when a program should


run and associate them with a defined day. It also defines when a program should
start on a selected day.

2) Explain the procedure to view the log files in Time Scheduler. 3M

Daily log file created by Citect Time Scheduler records all the manual or
scheduled actions performed in the Time Scheduler. It records
i) Program Execution – which defines when a value is assigned to a tag
and the tag name
ii) The creation, deletion or modification of special days or programs
including program resets
iii) Cicode operations of Time Scheduler

The log file s called by <date>_TmSchedLog.txt


Where <date> - the day on which the log file was created
The location of the log file is
\Program Files\Citect\CitectSCADA\Data
To view the Log file
To the data folder, use Windows Explorer navigation and double click
the required log file to view. In the Citect Time Scheduler, the log file
opens to show the changes made to the selected day.

3) What is Migration tool in Time Scheduler? 3M

The automatic update process that is occurred during the initial launch of
Citect SCADA does not fully upgrade the project. So, migration tool is used
to do the complete automation process. The automatic update process is
required and a passive action to upgrade the database field that has been
changed between the two versions and copies a new file.

Module – 8

4) What is the use of Include Files in Cicode commands? 3M

The maximum limit of characters that can be used in Command or


Expression field is 128. A separate Include file can be defined to include
more commands or expressions in a property field. It is a separate and
individual ASCII text file contains only one sequence of CitectSCADA
commands or expressions. After entering the Include file name, the whole
file will be activated when called

5) How to pass the data to functions? 3M

The parentheses() used in the function name defines the statement as a


function and enclose its related arguments. Arguments are known as the
values or variables which are passed into the function when it executes.
Some functions like PageNext() does not require arguments. If parentheses
are not included then CitectSCADA will not recognize it as a function and
an error will be thrown while compiling.

6) Explain Table Array Functions. 3M

For processing the variable arrays, Cicode has inbuilt functions.

 To perform the calculations on an array elements like max, min, total


etc
 On an array element, to look up the index number
 To shift the elements of an array either right or left

The Table functions perform the mathematical functions such as the


calculation of minimum, maximum, average or standard deviation values on
entire tables.

Table Lookup – Gets the value from a table. It searches a value in the table
and returns the position of the value in the table.

Syntax - TableLookup(Table, Size, Value)

TableMath - Performs the mathematical operations on a table. This


function cannot check the length of an array.

Syntax – TableMath(Table, Size, Command, Mode)


TableShift - Shifts the table to left or right. It shifts the table items in a
table by the number positions. The items which are shifted off to the end of a
table are lost.

Syntax – TableShift(Table, Size, Count)

7) What are the conventions need to be followed while formatting executable


statements? 4M

At the time of formatting the executable statements, the conventions are


required to follow

1) On new lines with one tab stop the statements should be placed
2) On a single line not more than one statement should be placed because the
first statement will permanently deleted
3) If the statements are logically related, place them on consecutive lines

Ex – hDev = 0; hNum = 0; // ---------- wrong


hDev = 0; // ------ Right
hNum = 0; // ----- Right

4) While using IF statement, a tab stop should be used. IF statements can be


used in either of the below mentioned forms”
i) Simple IF Block
IF <expression> Then
.
.
.
.
END
ii) IF-THEN-ELSE Block
IF <expression> Then
.
.
Else
.
.
END
iii) For ELSEIF blocks, nesting statements should be used
IF <expression> Then
.
.
Else
IF <expression> Then
.
.
Else
IF <expression> Then
.
.
END
END
END

8) Explain DebugMsg function with an example. 4M

When the debug switch is on, the debug message function (DebugMsg () )
internally calls the trace message function (TraceMsg() ). The
implementation debug message function is found in DEBUG.CI in the
INCLUDE project. The debug switch can be turned ON or OFF by any of
the below two procedures

 Calling DebugMsgSet (Int bDebugMsg) on the Kernel Cicode


window
 Calling the [Code] DebugMessage parameter in the INI file
Example

INT
FUNCTION
FilePrint(STRING sDeviceName, STRING sFileName)

INT hFile;
INT hDev;
STRING Str1;

hDev = DevOpen(sDeviceName, 0);


IF (hDev = 0) THEN
DebugMsg("Invalid arg to FilePrint - 'DeviceName'");
RETURN 261; /* File does not exist */
END
hFile = FileOpen(sFileName, "r");
IF (hFile = 0) THEN
DebugMsg("Invalid arg to FilePrint - 'FileName'");
DevClose(hDev);
RETURN 261; /* File does not exist */
END
WHILE NOT FileEof(hFile) DO
Str1 = FileReadLn(hFile);
DevWriteLn(hDev, Str1);
END
FileClose(hFile);
DevClose(hDev);
RETURN 0;
END

9) Describe about Dynamic Size Arrays in CitectVBA. 4M

To declare a dynamic sized array, the array should be declared using the dim
statement with an empty parentheses pair and followed by its array name.
Once array is declared as dynamic, the array can be only resized using the
redim statement within a function or subroutine. Redim may also erases the
values of the array. So, preceding the Redim statement with the preserve
keyword is necessary to preserve the contents of the array when it is resized.
Redimensioning an array to smaller values may erase the values it contained
in the removed portions. Arrays which are declared using the dim statement
wthin the procedures will not retain their values in CitectVBA between the
procedure calls.

10) How to add the variable tag to test project in CitectVBA? 2M

1) Open the CitectVBA test project


2) Press or Click the Project Editor button
3) Click the button Variable Tags
4) Replace the default name Tag_1 with TestTag_1 in the Variable
Tag Name field
5) Check that the device name selected is CiVBAIODevice, in the I/O
Device Name field
6) Select INT from the menu in the Data Type field
7) Type I1 in the Address field
8) Click Add

11) List different types of conversion functions in CitectVBA 10M

To assist the data manipulation and calculations, CitectVBA


conversion functions are used. It is used in CitectVBA statements and
it returns a value to the caller.

ASCII Character Code Conversion

ASC – Returns the numeric ASCII value of a string


Chr - Returns the string ASCII value of a number

Date Conversion

CDate – Converts an expression to a variant of date data type

CDbl - Converts an expression to a double data type

CInt - Converts an expression to an integer data type

CLng - Converts an expression to a long data type

CSng – Converts an expression to a single data type

CStr – Converts an expression to a string data tpe

CVar – Converts an expression to a variable data type

Date and Time Conversion

DateSerial – Constructs a date value

TimeSerial – Constructs the time value

Number and String Conversion

Format – Formats a string, number, or variant to the format expression

Hex – Converts a value to a string representing the hex value

Oct – Converts a value to a string representing the octal value

Str – Converts a value to a string representing the numeric characters

Val – Converts a string containing numeric characters to a numeric


value

12) How to setup the appearance options in configuring the data exchange
of Citect SCADA 4M
In the Properties dialog box, the Fonts and Colors tabs enables users to
control the appearance of the Database Exchange ActiveX control

To Setup the Font in the Database Exchange ActiveX control

1) Double click the control tab to access its Properties dialog


2) On the right hand side select the Font tab
3) From the properties list, select the Font or Head Font to set the font for
either the general text or column headings
4) From the drop down list, select a font name and size
5) To apply underlining, bold, Italic or strikeout, tick the Effects checkboxes
6) To make the changes click OK and close the dialog box

To Setup the Colors in the Database Exchange ActiveX control

1) Double click the control tab to access its Properties dialog


2) On the right hand side select the Colors tab
3) From the properties list, select the Back color or Fore color to set the color
for either the background or text
4) From the drop down list, select a color set
5) The available colors are displayed in the Color Palette to choose. Select the
required color to set for the selected property. Click Edit Custom Color to
edit or add a color to the Color Palette
6) To make the changes click OK and close the dialog box

13) Write a Cicode program to make the connection to an SQL server and
select the salary field from each record in the employee database 6M

FUNCTION
ListNames()
INT hSQL;
STRING sSalary;
INT Status;
INT hRec;
INT nColumns;
INT nRows;
INT i;
hSQL = SQLCreate("DSN=MyDatabase;UID=billw;SRVR=CI1");
IF hSQL <> 1 THEN
Status = SQLOpen(hSQL);
IF Status = 0 THEN
hRec = SQLGetRecordset(hSQL, "SELECT SALARY FROM
EMPLOYEE");
IF hRec <> 1 THEN
nRows = SQLRowCount(hRec);
FOR i=0 TO nRows 1 DO
sName = SQLGetField(hRec, "SALARY", i);
..
END
SQLEnd(hRec);
ELSE
Message("Information", SQLErrMsg(), 48);
END
SQLClose(hSQL);
ELSE
Message("Information", SQLErrMsg(), 48);
END
SQLDispose(hSQL);
END
END

14) How to read the data from an access table in Citect SCADA? 4M

To read data from an Access table or to call an Access query, a Select query is
used

Function SQLTest
INT hSQL, iResult;
hSQL =
SQLConnect("DSN=ODBCTest;UID=YourUID_C;PWD=YourPWD");
IF hSQL <> 1 Then
iResult = SQLExec(hSQL, "SELECT * FROM qryRecipes
WHERE Recipe Between '4000' And '7000'");
IF iResult = 0 Then
WHILE SQLNext(hSQL) = 0 DO
TraceMsg(">" + SQLGetField(hSQL, "Recipe")
+ "<>" +SQLGetField(hSQL, "Milk")
+ "<>" +SQLGetField(hSQL, "Water")
+ "<>" +SQLGetField(hSQL, "Sugar") + "<");
END
SQLDisconnect(hSQL);
ELSE
Message("SQL Error", SQLErrMsg, 48);
END
Message("SQL Error", SQLErrMsg, 48);
END
END

15) Explain the usage of history files in database of Citect SCADA. 6M

Vijeo Citect uses the system of rotational history files to store the historical
data to make the long term storage of logged data easier to organize and
more accessible. To use the system, we need to specify the required number
of device history files.

If we want to keep 10 history files then they should be stored rotationally as


shown in the figure.
1) When Vijeo Citect is logged in, the data is written to a file called
<filename>.dbf
2) The file <filename>.dbf is renamed to <filename>.001 and a new file
<filename>.dbf is created at the midnight of the following Sunday.
3) The file <filename>.001 is renamed to <filename>.002, <filename>.dbf
is renamed <filename>.001 and a new <filename>.dbf is created at the
midnight of the following Sunday
4) The first file is overwritten (week 11 in the first cycle) after week 10

Period can also be used between the files to specify when a new file has
to be used.

16) How to edit and save the contents of the table in Microsoft Excel?
4M

To edit the contents of the Table

In Microsoft Excel, a table is displayed in .dbf format

 a field is displayed as column


 a record is displayed as row
 a field within a record is displayed as a cell

The data in the table shown as cells within a row can be edited.

The record shown as a row can be deleted or can add a record

The structure of the table cannot be modify the name of any Field shown
as column, add a column or delete a column.

To Save a Table

 On the toolbar, select to save and re-index the table from the drop
down control
 Click the button SaveDBF

While saving the table, the following checks has to be done

 Verify the file type is .dbf or not


 In table structure, check for any changes that have been made
 According to the data in the Microsoft Excel sheet, update the existing table
 If it is an indexed table, re-indexes the updated table

Module – 11

17) What is the use of Kernel with a selected process in Citect SCADA?
4M

The Kernel window is used to diagnose the runtime information while


a Citect SCADA process was running.

To view the Kernel for a Process:

1) Right click on the process in Runtime manager to view the Kernel window
2) From the context menu select Kernel
3) For the selected process, the Kernel window will appear.

To dump the Kernel Data for a Running Process


 Right click the running process
 Select Dump Kernel

18) What is project activity? 4M

The list of all users and system projects are displayed in the project
activity. In the title bar of the application, the name of the Active project is
displayed along with the text [Active Project]

The following details are displayed in the Project Activity for every project

 Project — gives the Name of the project.

 Compiled — verifies whether the project has been compiled or not. If


the project has been compiled successfully, then it displays a green tick.

 Revision — Revises the number of Citect SCADA project that can be


assigned manually to keep the track of changes to the projects.

 Date — It specifies the date in the project Properties dialog box.

 Description — describes the specification in the project Properties


dialog box.

 Path — describes the folder in which the project files are stored.

19) Explain about the Monitoring Runtime Process 4M

On the local window, Citect SCADA Runtime manager monitors the status
of each process running. In the Status Column, the status of each process is
present.

Exception – The monitoring process has stopped functioning and is


generating an exception report which can be used to diagnose the situation
Starting – The monitoring process is currently starting up

Stopped – The monitoring process has

 Been stopped due to shutdown


 Stopped unexpectedly
 Disappeared due to a shutdown via Windows

A notification balloon appears when the status of a process changes to


exception from the task bar to inform that the process has been stopped
unexpectedly

20) Implement a sample project in Citect SCADA 20M

Instructions

1) Create a new project


2) Open the Graphics Builder

3) Create the page templates


4) Set up Object based configuration
5) Configure the required type of alarms

6) Configure the network environment


7) Create the genies and supergenes as per the requirement
8) Integrate the process analyst

9) Integrate the scheduler as per the requirement


10) Write the programming code in Cicode

11) Integrate the CitectVBA with Cicode functioning


12) Configure the process with required database exchange

13) Finally run the runtime manager to start the process of the current
project

You might also like