Code Builder - English Manual
Code Builder - English Manual
Contents
Table of Contents
Foreword
Part I Introduction
12
14
17
19
21
23
25
1 Introduction
................................................................................................................................... 25
2 Files
................................................................................................................................... 25
Introduction......................................................................................................................................................... 25
New
......................................................................................................................................................... 26
Open
......................................................................................................................................................... 26
Close
......................................................................................................................................................... 26
Save
......................................................................................................................................................... 26
Save As
......................................................................................................................................................... 27
Projects
......................................................................................................................................................... 27
Reopen
......................................................................................................................................................... 28
......................................................................................................................................................... 28
3 Edit
......................................................................................................................................................... 29
................................................................................................................................... 29
Introduction......................................................................................................................................................... 29
Undo
......................................................................................................................................................... 29
Cut
......................................................................................................................................................... 29
Copy
......................................................................................................................................................... 30
Paste
......................................................................................................................................................... 30
Delete
......................................................................................................................................................... 30
Preferences......................................................................................................................................................... 30
4 Search ................................................................................................................................... 30
Introduction......................................................................................................................................................... 30
Find
......................................................................................................................................................... 30
Replace
......................................................................................................................................................... 31
Search again
......................................................................................................................................................... 31
5 Syntax ................................................................................................................................... 31
Introduction......................................................................................................................................................... 31
Analyse
......................................................................................................................................................... 31
Analyse project
......................................................................................................................................................... 31
6 Window ................................................................................................................................... 32
......................................................................................................................................................... 32
Tile
......................................................................................................................................................... 32
Arrange icons
......................................................................................................................................................... 32
Minimize all ......................................................................................................................................................... 32
7 Help
................................................................................................................................... 32
Introduction......................................................................................................................................................... 32
Help
......................................................................................................................................................... 33
Contents
......................................................................................................................................................... 33
Index
......................................................................................................................................................... 33
35
1 Introduction
................................................................................................................................... 35
2 Colors
................................................................................................................................... 35
3 Editor
................................................................................................................................... 36
38
Part IX API
1 Introduction
................................................................................................................................... 38
2 Bit
................................................................................................................................... 38
BitAnd
......................................................................................................................................................... 38
BitMask
......................................................................................................................................................... 38
BitNot
......................................................................................................................................................... 39
BitOr
......................................................................................................................................................... 39
BitXor
......................................................................................................................................................... 40
GetBit
......................................................................................................................................................... 40
ResetBit
......................................................................................................................................................... 41
SetBit
......................................................................................................................................................... 41
3 Date and...................................................................................................................................
Time
42
DateTimeToSeconds
......................................................................................................................................................... 42
GetDateString
......................................................................................................................................................... 43
GetDayFromSeconds
......................................................................................................................................................... 43
GetDayOfMonth
......................................................................................................................................................... 44
GetDayOfWeek
......................................................................................................................................................... 44
GetHour
......................................................................................................................................................... 44
GetHourFromSeconds
......................................................................................................................................................... 45
GetMilliseconds
......................................................................................................................................................... 45
GetMinute ......................................................................................................................................................... 46
GetMinuteFromSeconds
......................................................................................................................................................... 46
GetMonth
......................................................................................................................................................... 47
GetMonthFromSeconds
......................................................................................................................................................... 47
GetSecond ......................................................................................................................................................... 47
GetSecondFromSeconds
......................................................................................................................................................... 48
GetTickCount
......................................................................................................................................................... 48
GetTimeString
......................................................................................................................................................... 49
GetYear
......................................................................................................................................................... 49
GetYearFromSeconds
......................................................................................................................................................... 50
SetDateTime......................................................................................................................................................... 50
UnsignedGetTickCount
......................................................................................................................................................... 51
4 Devices ................................................................................................................................... 51
Contents
DeviceEnableCommunication
......................................................................................................................................................... 51
DeviceName......................................................................................................................................................... 52
GetDeviceRxErrors
......................................................................................................................................................... 52
GetDeviceTxErrors
......................................................................................................................................................... 53
IsDeviceCommunicationEnabled
......................................................................................................................................................... 53
IsDeviceCommunicationKo
......................................................................................................................................................... 54
ResetDeviceRxErrors
......................................................................................................................................................... 54
ResetDeviceTxErrors
......................................................................................................................................................... 54
5 Directory................................................................................................................................... 55
DirectoryCreate
......................................................................................................................................................... 55
DirectoryDelete
......................................................................................................................................................... 55
DirectoryGetCurrent
......................................................................................................................................................... 56
DirectorySetCurrent
......................................................................................................................................................... 56
6 Files
................................................................................................................................... 56
FileAttrFound
......................................................................................................................................................... 56
FileAttrFoundEx
......................................................................................................................................................... 57
FileCopy
......................................................................................................................................................... 57
FileClose
......................................................................................................................................................... 58
FileDelete ......................................................................................................................................................... 58
FileEof
......................................................................................................................................................... 59
FileExist
......................................................................................................................................................... 59
FileFindClose
......................................................................................................................................................... 60
FileFindCloseEx
......................................................................................................................................................... 60
FileFindFirst......................................................................................................................................................... 60
FileFindFirstEx
......................................................................................................................................................... 61
FileFindNext......................................................................................................................................................... 61
FileFindNextEx
......................................................................................................................................................... 62
FileGetAttr ......................................................................................................................................................... 62
FileSetAttr ......................................................................................................................................................... 63
FileGetSize ......................................................................................................................................................... 63
FileMove
......................................................................................................................................................... 63
FileNameFound
......................................................................................................................................................... 64
FileNameFoundEx
......................................................................................................................................................... 64
FileOpen
......................................................................................................................................................... 65
FilePos
......................................................................................................................................................... 66
FileRead
......................................................................................................................................................... 66
FileReadLn ......................................................................................................................................................... 66
FileRename ......................................................................................................................................................... 67
FileSeek
......................................................................................................................................................... 67
FileSize
......................................................................................................................................................... 68
FileSplitPath......................................................................................................................................................... 68
FileWrite
......................................................................................................................................................... 69
FileWriteLn ......................................................................................................................................................... 69
7 Gates
................................................................................................................................... 70
NumGates ......................................................................................................................................................... 70
GetNumGateCommunicationStatus
.................................................................................................................................................. 70
GetNumGateGateID
.................................................................................................................................................. 70
GetNumGateNID
.................................................................................................................................................. 71
GetNumGateProp
.................................................................................................................................................. 71
GetNumGateValue
.................................................................................................................................................. 72
GetNumGateValueAsString
.................................................................................................................................................. 72
GetTotalNumGates
.................................................................................................................................................. 73
NumGateExists
.................................................................................................................................................. 74
......................................................................................................................................................... 75
DigGateExists
.................................................................................................................................................. 75
GetDigGateCommunicationStatus
.................................................................................................................................................. 75
GetDigGateGateID
.................................................................................................................................................. 76
GetDigGateNID
.................................................................................................................................................. 76
GetDigGateProp
.................................................................................................................................................. 77
GetDigGateValue
.................................................................................................................................................. 77
GetTotalDigGates
.................................................................................................................................................. 78
SetDigGateValue
.................................................................................................................................................. 78
CmpGates ......................................................................................................................................................... 79
CmpGateExists
.................................................................................................................................................. 79
GetCmpGateGateID
.................................................................................................................................................. 79
GetCmpGateNID
.................................................................................................................................................. 80
GetCmpGateValue
.................................................................................................................................................. 80
GetCmpGateValueAsString
.................................................................................................................................................. 81
GetTotalCmpGates
.................................................................................................................................................. 81
StrGates
......................................................................................................................................................... 82
GetStrGateCommunicationStatus
.................................................................................................................................................. 82
GetStrGateGateID
.................................................................................................................................................. 82
GetStrGateNID
.................................................................................................................................................. 83
GetStrGateValue
.................................................................................................................................................. 83
GetStrGateProp
.................................................................................................................................................. 84
SetStrGateValue
.................................................................................................................................................. 84
GetTotalStrGates
.................................................................................................................................................. 85
StrGateExists
.................................................................................................................................................. 85
EvnGates
......................................................................................................................................................... 86
EvnGateExists
.................................................................................................................................................. 86
GetEvnGateAckedStatus
.................................................................................................................................................. 86
GetEvnGateGateID
.................................................................................................................................................. 87
GetEvnGateNID
.................................................................................................................................................. 87
GetEvnGateMsg
.................................................................................................................................................. 88
GetEvnGateValue
.................................................................................................................................................. 88
GetTotalEventGates
.................................................................................................................................................. 89
8 Generic ................................................................................................................................... 89
Beep
......................................................................................................................................................... 89
CloseKeyboard
......................................................................................................................................................... 89
CloseSession
......................................................................................................................................................... 90
CloseWindow
......................................................................................................................................................... 90
EnableShutdown
......................................................................................................................................................... 91
Exec
......................................................................................................................................................... 91
ExecEx
......................................................................................................................................................... 92
FileOpenDialog
......................................................................................................................................................... 92
FileSaveDialog
......................................................................................................................................................... 94
GetCurrentLanguage
......................................................................................................................................................... 95
GetProjectCaption
......................................................................................................................................................... 96
GetProjectName
......................................................................................................................................................... 96
GetProjectPath
......................................................................................................................................................... 97
GetShutdownStatus
......................................................................................................................................................... 97
GetUserName
......................................................................................................................................................... 98
GetUserGroups
......................................................................................................................................................... 98
HexStrToInt......................................................................................................................................................... 99
Keyboard ......................................................................................................................................................... 100
IconMessageBox
......................................................................................................................................................... 100
Contents
InputDialog......................................................................................................................................................... 102
IntToHexStr
......................................................................................................................................................... 102
Logout
......................................................................................................................................................... 103
Message Beep
......................................................................................................................................................... 103
MessageBox
......................................................................................................................................................... 104
Play
......................................................................................................................................................... 105
PlaySound......................................................................................................................................................... 105
PrintString......................................................................................................................................................... 105
QuestionBox
......................................................................................................................................................... 106
RealToInt ......................................................................................................................................................... 107
ShellExec ......................................................................................................................................................... 107
Sleep
......................................................................................................................................................... 108
StopFunction
......................................................................................................................................................... 108
StopSound......................................................................................................................................................... 109
WindowIsOpen
......................................................................................................................................................... 109
9 Internet................................................................................................................................... 110
SendMail ......................................................................................................................................................... 110
FTP
......................................................................................................................................................... 111
FTPConnect
.................................................................................................................................................. 111
FTPDisconnect
.................................................................................................................................................. 112
10 Math
FTPGet
.................................................................................................................................................. 113
FTPPut
.................................................................................................................................................. 114
................................................................................................................................... 115
Abs
......................................................................................................................................................... 115
ArcCos
......................................................................................................................................................... 115
ArcSin
......................................................................................................................................................... 116
ArcTan
......................................................................................................................................................... 116
Cos
......................................................................................................................................................... 117
Exp
......................................................................................................................................................... 117
Log
......................................................................................................................................................... 117
Mod
......................................................................................................................................................... 118
Pow
......................................................................................................................................................... 118
Rand
......................................................................................................................................................... 119
Round
......................................................................................................................................................... 119
Sin
......................................................................................................................................................... 119
Sqrt
......................................................................................................................................................... 120
Tan
......................................................................................................................................................... 120
12 Recipes................................................................................................................................... 125
RecipeCreate
......................................................................................................................................................... 125
RecipeExecute
......................................................................................................................................................... 125
RecipeImport
......................................................................................................................................................... 126
......................................................................................................................................................... 145
IntToStr
......................................................................................................................................................... 145
......................................................................................................................................................... 146
......................................................................................................................................................... 147
......................................................................................................................................................... 148
StrSubString
......................................................................................................................................................... 148
StrToChar ......................................................................................................................................................... 149
StrToInt
......................................................................................................................................................... 149
15 Template
................................................................................................................................... 150
TPageClose
......................................................................................................................................................... 150
TPageOpen......................................................................................................................................................... 150
TPagePrint......................................................................................................................................................... 151
TemplateAlarmsStatus
......................................................................................................................................................... 151
TemplateChart
......................................................................................................................................................... 151
TemplateDefineGroupNames
......................................................................................................................................................... 152
TemplateDefinePagesAccess
......................................................................................................................................................... 152
TemplateDefineUsers
......................................................................................................................................................... 153
TemplateDevicesStatus
......................................................................................................................................................... 153
TemplateEventsStatus
......................................................................................................................................................... 154
TemplateGatesStatus
......................................................................................................................................................... 154
TemplateHistAlarms
......................................................................................................................................................... 154
TemplateHistEvents
......................................................................................................................................................... 155
TemplateMakeReport
......................................................................................................................................................... 155
TemplateMultilanguage
......................................................................................................................................................... 156
TemplatePassword
......................................................................................................................................................... 156
TemplatePrinterSetup
......................................................................................................................................................... 157
TemplateRecipe
......................................................................................................................................................... 157
TemplateSystemStatus
......................................................................................................................................................... 157
Contents
TemplateUserChanges
......................................................................................................................................................... 158
TemplateViewReport
......................................................................................................................................................... 158
16 Template
...................................................................................................................................
objects
159
Generic
......................................................................................................................................................... 159
TObjEndUpdate
.................................................................................................................................................. 159
TObjFunction
.................................................................................................................................................. 159
TObjGetH .................................................................................................................................................. 160
TObjGetPropertyInt
.................................................................................................................................................. 160
TObjGetStatus
.................................................................................................................................................. 161
TObjGetText
.................................................................................................................................................. 161
TObjGetW.................................................................................................................................................. 162
TObjGetX .................................................................................................................................................. 162
TObjGetY .................................................................................................................................................. 162
TObjBeginUpdate
.................................................................................................................................................. 163
TObjSetPropertyBool
.................................................................................................................................................. 163
TObjSetPropertyInt
.................................................................................................................................................. 164
TObjSetPropertyReal
.................................................................................................................................................. 164
TObjSetPropertyString
.................................................................................................................................................. 165
TObjSetPropertyUnsigned
.................................................................................................................................................. 165
TObjSetSize
.................................................................................................................................................. 166
TObjSetStatus
.................................................................................................................................................. 166
TObjSetText
.................................................................................................................................................. 167
TObjSetXY.................................................................................................................................................. 167
Chart
......................................................................................................................................................... 168
ChartEndDrawingFlagReset
.................................................................................................................................................. 168
ChartEndDrawingFlagStatus
.................................................................................................................................................. 168
ChartSetTimeRange
.................................................................................................................................................. 169
ChartSetTimeRangeStartWidth
.................................................................................................................................................. 169
ChartSetTimeRangeEndWidth
.................................................................................................................................................. 170
HistAlarmsView
......................................................................................................................................................... 170
HisViewEnablePrintOnCreation
.................................................................................................................................................. 170
HisViewSetTimeRange
.................................................................................................................................................. 171
HisViewSetTimeRangeStartWidth
.................................................................................................................................................. 171
HisViewSetTimeRangeEndWidth
.................................................................................................................................................. 172
174
1 Introduction
................................................................................................................................... 174
2 Foreword
................................................................................................................................... 174
3 Variables
................................................................................................................................... 175
4 Types ................................................................................................................................... 176
Introduction
......................................................................................................................................................... 176
Integer
......................................................................................................................................................... 176
Real
......................................................................................................................................................... 176
Boolean
......................................................................................................................................................... 176
String
......................................................................................................................................................... 176
5 Functions
................................................................................................................................... 176
6 Instructions
................................................................................................................................... 179
Introduction
......................................................................................................................................................... 179
Function call
......................................................................................................................................................... 179
Assignment
......................................................................................................................................................... 179
Return value
......................................................................................................................................................... 179
10
7 Expressions
................................................................................................................................... 181
8 Operators
................................................................................................................................... 182
Index
184
Part
12
Introduction
The Code Builder is a development environment designed for making easier the writing of
functions in the language. It allows to write code, to save it permanently, to create a new one, to
check its syntax and more besides; it offers a series of search and text editing operations typical
of editors; moreover, to simplify and reduce the presence of errors, the characters sequences are
displayed in different colors, depending on their role in the syntax. As far as the language is
concerned, refer to what is written in the Language chapter, here there is only a guide to the use
of the development environment.
Part
II
14
The integrated environment consists of menus, speed buttons, a status bar for the information (at
the bottom) and an empty workspace.
The code windows on which to work will be shown in the workspace.
First of all open a file; select Open... from the menu File.
These are the steps you have to take to open an already existing file; now in the workspace you
can see a new window with in it the content of the file just loaded.
15
Note, in the new window, the different color of the example code. The text is colored according to
the analysis made by the internal recognizer of Code Builder that categorizes the text elements.
Of course you can change the attributes of every category at will, while the rules differentiating the
classes of elements can not be changed and have their origin in the language syntax.
You may note, on the status bar, some elements that were not there before; they are the cursor
position (row : column) in the first rectangle, and the word insertion in the third rectangle; this word
indicates that every character typed with the keyboard will be inserted in the present position of
the cursor. You can also decide to replace the characters instead of inserting them. Pressing the
INS key you will note two changes: the cursor shape is wider and on the bar there is the word
overwriting. This way the characters are no longer inserted in the text but they overwrite it; to go
back to the insertion mode just press again INS.
Part
III
Speedbar
17
Speedbar
The speedbar (figure below) has speed buttons for functions frequently called up from the menus.
By placing the mouse pointer on one of these buttons, a brief explanation of the function will be
displayed.
Part
IV
19
Part
21
API let you choose all built-in functions in the libraries, you can browse them in menulike way.
Click on the name and the CBuilder add prototype in the current code window at the cursor
position.
Structures like functions let you browse and add language structures.
Part
VI
23
Cut it, that is to say delete it from the code and move it to the clipboard
To paste text from the clipboard you don't have to do any selection, the text in the clipboard will
be inserted where the cursor is.
The speedbar button performing the paste function is colored (icon below) only when in the
clipboard there is something that can be copied.
Similarly, the buttons for copying and deleting blocks of text, are highlighted only when, in the
code you are working on, there is some selected text.
Part
VII
Menus
Menus
7.1
Introduction
25
Now we are going to see in detail the functions provided by the menus.
While you are working, there are two ways to access the menus: the first is to use the mouse, the
second is to use the ALT key in combination with the underlined letter of the menu.
The functions provided by the menus can be applied to the current code window, that is to say the
one that, compared to the others, is in the foreground (as shown in figure above).
7.2
Files
7.2.1
Introduction
The File menu includes all the functions necessary to permanently store and print the code.
26
7.2.2
New
New: it opens an empty window in the workspace.
7.2.3
Open
Open: it shows a dialog box in which you can select the file you want to work on.
Once you have selected the desired file, just press the button Open.
7.2.4
Close
Close: it closes the window code presently in the foreground.
7.2.5
Save
Save: it stores the file you are working on; the first time you save a file, created with the
command new, you'll see a dialog box similar to the previous one, in which you can save the file
with a name automatically created, or give a new name to it. The data will be automatically saved
without using the dialog box, of course if the file has been saved at least once before.
Menus
7.2.6
Save As
Save as: it opens every time the dialog (the same of Save) box for saving the file.
7.2.7
Projects
Projects: let you choose the projects to work with.
In this page you can choose one of the available projects or e new path.
27
28
7.2.8
Reopen
Reopen: show you a list of recent used files (max 10 item).
7.2.9
Print
Print: it sends to the printer the content of the window code you are working on.
Menus
29
7.2.11 Exit
Exit: Close CBuilder and current work session.
7.3
Edit
7.3.1
Introduction
The edit menu includes all the functions necessary for the editing of text blocks, the correction of
wrong operations and the configuration of the working environment.
7.3.2
Undo
Undo: it restores the last text deleted. This can be a character or a block of characters.
7.3.3
Cut
Cut: it deletes the text selected in the window code and copies it in a memory area (clipboard)
from where it can be read later on.
30
7.3.4
Copy
Copy:
7.3.5
Paste
Paste: it reads the content of the clipboard and inserts it in the code, where the cursor is at that
moment.
7.3.6
Delete
Delete: Delete current selected text in the current window without copying it in the clipboard..
7.3.7
Preferences
Preferences: it opens a dialog box where it is possible to configure the environment at will.
7.4
Search
7.4.1
Introduction
In this menu there are the functions needed to search and replace text.
7.4.2
Find
Find: it opens a dialog box (figure below) where you can insert one or more words you want to
search.
In this box you can specify the search parameters. Since the operation is carried out starting from
the present position of the cursor, you can decide to move up (Up) or down (Down) the code. By
ticking the box Match case, you can require that the word is searched exactly as it had been
inserted. This way the search will distinguish capitals from small letters. After having inserted the
text in the box, press the Find next button: the cursor will position itself on the first word or
expression found in the text.
Menus
7.4.3
31
Replace
Replace: it opens a dialog box where you can specify the text to search and replace with a new
one.
It is possible to specify if the search must distinguish capitals from small letters like in the previous
function. The button Replace All repeats the inserted replacement for all the words or
expressions found in the text.
7.4.4
Search again
Search again: it repeats the last search without opening any dialog box.
7.5
Syntax
7.5.1
Introduction
This menu offers all the functions necessary for the syntactic control of the code.
7.5.2
Analyse
Analyse: it checks the file you are working on, searching for any syntactic mistake.
7.5.3
Analyse project
Analyse project: it checks all the project, in its entirety, searching for mistakes. If it finds one, the
cursor will position itself where the mistake has been found.
32
7.6
Window
7.6.1
Introduction
In this menu there are the commands for the management of the windows in the workspace.
At the bottom of the menu you can see the list of the code windows present: to access one of
them you just need to select it from the menu.
7.6.2
Cascade
Cascade: it resizes and positions all the windows in the workspace, putting one over another, but
slightly moving them, so as to be able to access each of them.
7.6.3
Tile
Tile: it divides the workspace giving all the code windows the same space.
7.6.4
Arrange icons
Arrange icons: it arranges the icons of the minimized windows.
7.6.5
Minimize all
Minimize all: it reduces all the code windows to the minimum size and sort them.
7.7
Help
7.7.1
Introduction
If you need help it can be useful to read the guide or the contextual help, both accessible from the
Help menu.
Menus
7.7.2
Help
Help: Help you starting from the introduction.
7.7.3
Contents
Contents: Show you the tree contents of the guide.
7.7.4
Index
Index: it's the word index of the cbuilder guide
33
Part
VIII
8.1
Introduction
35
There are some aspects of the integrated environment that can be configured. You can do it by
selecting Preferences from the Edit menu; a number of pages will appear: every page has a
different name, colors, editor, etc.
To access a page different from the present one you have to click on the corresponding name.
Now we are going to see in detail what you can configure in these pages.
8.2
Colors
It is possible to modify the color and the style of the text elements at will. The rules differentiating
the text elements come directly from the language syntax.
By selecting an element from the Elements list (figure below), the page will be updated
automatically, showing the configuration for that element.
For example, as shown in figure below, the element Reserved words has bold for style, white for
background color and black for text color.
To change the style of an element you just need to tick or remove the tick from one of the boxes
grouped in the item styles. Similarly, to choose the color you will have to click on one of the
colored squares: by clicking with the mouse left button you select the text color, (FG) while, using
the right button you define the background color (BG).
You can configure every element to your liking and confirm the changes made pressing the
36
8.3
Editor
In the Editor page (shown in figure) there are functions concerning the code windows.
Looking at a code window, you may note the presence of a vertical and two horizontal grey lines:
The vertical line represents a limit that it is better not to overcome: you can choose if you
want to display this limit, and also in which column to place it.
The two horizontal lines signal, in the code window, the end of the file. They also can be
omitted.
Pressing the TAB key in a code window, the cursor moves as far as the next tabulation: the
tabulations size can be defined through the item tabulations width.
Persistent Block is the way you can avoid deletion of current selected block while pasting data.
Click its check box so selected blocks won't be cancelled if you paste with CTRL+V or menu
subfunction (see cut&paste )
Part
IX
38
API
9.1
Introduction
The API are the functions already defined. They can be called up by any program. In this chapter
we are going to list and describe all the functions, dividing them depending on their
subject-matter.
9.2
Bit
9.2.1
BitAnd
Description
Makes the bitwise AND between Value1 and Value2
Syntax
int BitAnd(int Value1, int Value2)
Parameters
Value1 = first number to process
Value2 = second number to process
Returned value
The result of operation Value1 AND Value2
Related functions
BitOr(),BitXor(),BitNot()
Example
int Result;
int Value1;
int Value2;
Value1=HexStrToInt("0xFFA7");
Value2=HexStrToInt("0x0FF5");
Result=BitAnd(Value1,Value2);
The Result is 0xFA5
9.2.2
BitMask
Description
it makes the bitwise AND between a number and a mask
Syntax
int BitMask(int Num, int Mask)
Parameters
Num = number to process
Mask = mask (bit position from 0 to 31)
Returned value
the result of operation
API
Related functions
SetBit(), ResetBit(), GetBit()
Example
LowByte=BitMask(Value,HexStrToInt("000000FF"));
9.2.3
BitNot
Description
Makes the bit negation of Value
Syntax
int BitNot(int Value)
Parameters
Value = value to process
Returned value
The result of operation NOT Value
Related functions
BitOr(),BitXor(),BitAnd()
Example
int Result;
int Value;
Value=HexStrToInt("0xFFA7");
Result=BitNot(Value);
The Result is 0x0058
9.2.4
BitOr
Description
Makes the bitwise OR between Value1 and Value2
Syntax
int BitOr(int Value1, int Value2)
Parameters
Value1 = first number to process
Value2 = second number to process
39
40
Returned value
The result of operation Value1 OR Value2
Related functions
BitXor(),BitAnd(),BitNot()
Example
int Result;
int Value1;
int Value2;
Value1=HexStrToInt("0xFFA7");
Value2=HexStrToInt("0x0FF5");
Result=BitOr(Value1,Value2);
The Result is 0xFFF7
9.2.5
BitXor
Description
Makes the bitwise XOR between Value1 and Value2
Syntax
int BitXor(int Value1, int Value2)
Parameters
Value1 = first number to process
Value2 = second number to process
Returned value
The result of operation Value1 XOR Value2
Related functions
BitOr(),BitAnd(),BitNot()
Example
int Result;
int Value1;
int Value2;
Value1=HexStrToInt("0xFFA7");
Value2=HexStrToInt("0x0FF5");
Result=BitXor(Value1,Value2);
The Result is 0xF052
9.2.6
GetBit
Description
it returns you a bit from a number
Syntax
int GetBit(int Num, int Bit)
API
Parameters
Num = number to check
Bit = Bit to check (position from 0 to 31)
Returned value
requeste bit
Related functions
BitMask(), SetBit(),ResetBit()
Example
Even =GetBit(A,0);
9.2.7
ResetBit
Description
it resets (set to 0) a specified bit of a number
Syntax
int ResetBit(int Num, int Bit)
Parameters
Num = number to process
Bit = Bit you want to reset (bit position from 0 to 31)
Returned value
number with the bit low.
Related functions
BitMask(), SetBit(), GetBit()
Example
A_even=ResetBit(A,0);
9.2.8
SetBit
Description
it sets (to 1) a specified bit of a number
Syntax
int SetBit(int Num, int Bit)
Parameters
41
42
9.3
9.3.1
DateTimeToSeconds
Description
Converts date time received in input to total seconds elapsed since January 1, 1901.
Syntax
Unsigned DateTimeToSeconds(int Day,int Month,int Year,int Hour,int
Minute,int
Second)
Parameters
Day = day of the date/time to convert in seconds since January 1, 1901.
Month = month of the date/time to convert in seconds since January 1, 1901.
Year = Year of the date/time to convert in seconds since January 1, 1901.
Hour = hour of the date/time to convert in seconds since January 1, 1901.
Minute = minute of the date/time to convert in seconds since January 1, 1901.
Seconds = second of the date/time to convert in seconds since January 1, 1901.
Returned value
the number of seconds elapsed since January 1, 1901.
Related functions
GetDayFromSeconds(),GetMonthFromSeconds(),GetYearFromSeconds(),
GetHourFromSeconds(),GetMinuteFromSeconds(),GetSecondFromSeconds()
Example
Unsigned Seconds;
Seconds=DateTimeToSeconds(10,7,1970,5,34,22);
API
9.3.2
43
GetDateString
Description
It returns a string containing the date. In it days, months and years are separated by a specified
punctuation character; it is possible to specify whether you want the date to be written according
to the European style.
Syntax
String GetDateString(String Separator, Bool EuropeanStyle)
Parameters
Separator = the character separating days, months and years
EuropeanStyle = it indicates if you want to write the date in European style
Returned value
the date written as a string with the required specifications
Related functions
GetYear(), GetMonth(), GetDayOfMonths(), GetDayOfWeek()
Example
CurrentDate=GetDateString("/",true);
9.3.3
GetDayFromSeconds
Description
Returns the day of the date/time corresponding to the total seconds since January 1, 1901 passed
in input to the instruction.
Syntax
Int GetDayFromSeconds(Unsigned Seconds)
Parameters
Seconds = total amount of seconds since January 1, 1901.
Returned value
the number of the day corresponding.
Related functions
DateTimeToSeconds(),GetMonthFromSeconds(),GetYearFromSeconds(),
GetHourFromSeconds(),GetMinuteFromSeconds(),GetSecondFromSeconds()
Example
Unsigned Seconds;
Int Day;
Seconds=DateTimeToSeconds(10,7,1970,5,34,22);
Seconds=Seconds+90000;
// Add 25 hours
Day=GetDayFromSeconds(Seconds);
44
9.3.4
GetDayOfMonth
Description
It returns an integer number representing the current day.
Syntax
Int GetDayOfMonth()
Parameters
Returned value
the current day as an integer number
Related functions
GetDateString(), GetYear(),GetMonth(), GetDayOfWeek()
Example
TodayIs=GetDayOfMonth();
9.3.5
GetDayOfWeek
Description
It returns an integer number representing the current day of the week (0=Sunday, 1 =Monday,
2=Tuesday, ...).
Syntax
Int GetDayOfMonth()
Parameters
Returned value
the current day of the week as an integer number
Related functions
GetDateString(), GetYear(), GetDayOfMonth(), GetMonth()
Example
if ( GetDayOfWeek()==0 ) then
Sunday=true;
end
9.3.6
GetHour
Description
It returns an integer number representing the current hour; minutes, seconds and milliseconds are
not in the returned value.
Syntax
Int GetHour()
Parameters
API
45
Returned value
the hour as an integer number
Related functions
GetTimeString(), GetMinute(), GetSecond(), GetMilliSeconds()
Example
Hour=GetHour();
9.3.7
GetHourFromSeconds
Description
Returns the hour of the date/time corresponding to the total seconds since January 1, 1901
passed in input to the instruction.
Syntax
Int GetHourFromSeconds(Unsigned Seconds)
Parameters
Seconds = total amount of seconds since January 1, 1901.
Returned value
the number of the hour corresponding.
Related functions
DateTimeToSeconds(),GetDayFromSeconds(),GetMonthFromSeconds(),GetYearFromSeconds(),
GetMinuteFromSeconds(),GetSecondFromSeconds()
Example
Unsigned Seconds;
Int Hour
Seconds=DateTimeToSeconds(10,7,1970,5,34,22);
Seconds=Seconds+90000;
// Add 25 hours
Hour=GetHourFromSeconds(Seconds);
9.3.8
GetMilliseconds
Description
It returns an integer number representing the number of milliseconds of the current time.
Syntax
Int GetMilliseconds()
Parameters
Returned value
the number of milliseconds of the current time as an integer number
46
9.3.9
GetMinute
Description
It returns an integer number representing the number of minutes of the current hour.
Syntax
Int GetMinute()
Parameters
Returned value
the number of minutes of the current hour as an integer number
Related functions
GetTimeString(), GetHour(), GetSecond(), GetMilliSeconds()
Example
Secs=GetMinute()*60;
9.3.10 GetMinuteFromSeconds
Description
Returns the minute of the date/time corresponding to the total seconds since January 1, 1901
passed in input to the instruction.
Syntax
Int GetMinuteFromSeconds(Unsigned Seconds)
Parameters
Seconds = total amount of seconds since January 1, 1901.
Returned value
the number of the minute corresponding.
Related functions
DateTimeToSeconds(),GetDayFromSeconds(),GetMonthFromSeconds(),GetYearFromSeconds(),
GetHourFromSeconds(),GetSecondFromSeconds()
Example
Unsigned Seconds;
Int Minute
Seconds=DateTimeToSeconds(10,7,1970,5,34,22);
Seconds=Seconds+90000;
// Add 25 hours
Minute=GetMinuteFromSeconds(Seconds);
API
47
9.3.11 GetMonth
Description
It returns an integer number representing the current month.
Syntax
Int GetMonth()
Parameters
Returned value
the current month as an integer number
Related functions
GetDateString(), GetYear(), GetDayOfMonths(), GetDayOfWeek()
Example
MonthLeft=12-GetMonth();
9.3.12 GetMonthFromSeconds
Description
Returns the month of the date/time corresponding to the total seconds since January 1, 1901
passed in input to the instruction.
Syntax
Int GetMonthFromSeconds(Unsigned Seconds)
Parameters
Seconds = total amount of seconds since January 1, 1901.
Returned value
the number of the month corresponding.
Related functions
DateTimeToSeconds(),GetDayFromSeconds(),GetYearFromSeconds(), GetHourFromSeconds(),
GetMinuteFromSeconds(),GetSecondFromSeconds()
Example
Unsigned Seconds;
Int Month;
Seconds=DateTimeToSeconds(10,7,1970,5,34,22);
Seconds=Seconds+90000;
// Add 25 hours
Month=GetMonthFromSeconds(Seconds);
9.3.13 GetSecond
Description
It returns an integer number representing the number of the seconds of the current time.
48
9.3.14 GetSecondFromSeconds
Description
Returns the second of the date/time corresponding to the total seconds since January 1, 1901
passed in input to the instruction.
Syntax
Int GetSecondFromSeconds(Unsigned Seconds)
Parameters
Seconds = total amount of seconds since January 1, 1901.
Returned value
the number of the second corresponding.
Related functions
DateTimeToSeconds(),GetDayFromSeconds(),GetMonthFromSeconds(),GetYearFromSeconds(),
GetHourFromSeconds(),GetMinuteFromSeconds()
Example
Unsigned Seconds;
Int Second
Seconds=DateTimeToSeconds(10,7,1970,5,34,22);
Seconds=Seconds+90000;
// Add 25 hours
Second=GetSecondFromSeconds(Seconds);
9.3.15 GetTickCount
(OBSOLETE)
Description
It returns an integer number representing the number of milliseconds elapsed since the start of
the system. After about 24.8 days this number is 0 again.
Syntax
Int GetTickCount()
Parameters
API
49
Returned value
the number of milliseconds elapsed since the start of the system as an integer number
Related functions
Example
TimeFromStart = GetTickCount() / TickSize;
9.3.16 GetTimeString
Description
It returns a string containing the time. In it hour, minutes, seconds and milliseconds are separated
by a specified punctuation character.
Syntax
String GetTimeString(String Separator)
Parameters
Separator = the character separating hour, minutes and seconds
Returned value
the time written as a string with the required separator
Related functions
GetHour(), GetMinute(), GetSecond(), GetMilliSeconds()
Example
CurrentTime=GetTimeString(":");
9.3.17 GetYear
Description
It returns an integer number representing the current year.
Syntax
Int GetYear()
Parameters
Returned value
the current year as an integer number
Related functions
GetDateString(), GetMonth(), GetDayOfMonths(), GetDayOfWeek()
50
Example
Deltayear=GetYear()-1980;
9.3.18 GetYearFromSeconds
Description
Returns the year of the date/time corresponding to the total seconds since January 1, 1901
passed in input to the instruction.
Syntax
Int GetYearFromSeconds(Unsigned Seconds)
Parameters
Seconds = total amount of seconds since January 1, 1901.
Returned value
the number of the year corresponding.
Related functions
DateTimeToSeconds(),GetDayFromSeconds(),GetMonthFromSeconds(),GetHourFromSeconds(
), GetMinuteFromSeconds(),GetSecondFromSeconds()
Example
Unsigned Seconds;
Int Year
Seconds=DateTimeToSeconds(10,7,1970,5,34,22);
Seconds=Seconds+90000;
// Add 25 hours
Year=GetYearFromSeconds(Seconds);
9.3.19 SetDateTime
Description
Set Date and Time values
Syntax
Bool SetDateTaime(Int Day,int Month,int Year,int Hour,int Minutes,int Seconds)
Parameters
int Day= day to set
int Month = month to set
int Year = year to set
int Hour = hour to set
int Minutes= minutes to set
int Seconds= seconds to set
Returned value
True : if function terminated correctly.
API
51
9.3.20 UnsignedGetTickCount
Description
It returns an unsigned integer number representing the number of milliseconds elapsed since the
start of the system. After about 49.7 days this number is 0 again.
Syntax
Unsigned UnsignedGetTickCount()
Parameters
Returned value
the number of milliseconds elapsed since the start of the system as an unsignedt integer number
Related functions
Example
Unsigned TimeFromStart;
TimeFromStart = UnsignedGetTickCount();
9.4
Devices
9.4.1
DeviceEnableCommunication
Description
Enable or disable communication with the specified device.
Syntax
Bool DeviceEnableCommunication(Int Channel, Int DevNum,Bool
ToEnable,Bool SaveChanges)
Parameters
Channel = channel number
DevNum = device number
ToEnable= if "true" the communication with device will be enabled.
if "false" the communication with device will be disabled.
SaveChanges= if "true" the changes will be permanently saved.
52
9.4.2
DeviceName
Description
Returns the name of the device specified by channel number and device name.
Syntax
String DeviceName(Int Channel, Int DevNum)
Parameters
Channel = channel number
DevNum = device number
Returned value
name of the device
Related functions
Example
DevName = DeviceName (1,3);
9.4.3
GetDeviceRxErrors
Description
Return the number of communication errors happened douring all data read operations from the
specified device.
Syntax
Int GetDeviceRxErrors(Int Channel, Int DevNum)
Parameters
Channel = channel number
DevNum = device number
Returned value
Number of communication errors.
"-1" on istruction failure.
Related functions
ResetDeviceRxErrors(),GetDeviceTxErrors()
API
53
Example
Int RxErrors;
RxErrors=GetDeviceRxErrors(1,3);
9.4.4
GetDeviceTxErrors
Description
Return the number of communication errors happened douring all data write operations towards
the specified device.
Syntax
Int GetDeviceTxErrors(Int Channel, Int DevNum)
Parameters
Channel = channel number
DevNum = device number
Returned value
Number of communication errors.
"-1" on istruction failure.
Related functions
ResetDeviceTxErrors(),GetDeviceRxErrors()
Example
Int TxErrors;
TxErrors=GetDeviceTxErrors(1,3);
9.4.5
IsDeviceCommunicationEnabled
Description
Return the enabled/disabled device communication status.
Syntax
Bool IsDeviceCommunicationEnabled(Int Channel, Int DevNum)
Parameters
Channel = channel number
DevNum = device number
Returned value
"true" if device communication is enabled.
"false" if device communication is disabled.
Related functions
DeviceEnableCommunication()
Example
Bool Status;
Status=IsDeviceCommunicationEnabled(1,3);
54
9.4.6
IsDeviceCommunicationKo
Description
Return the device communication status (Ok/Ko).
Syntax
Bool IsDeviceCommunicationKo(Int Channel, Int DevNum)
Parameters
Channel = channel number
DevNum = device number
Returned value
"true" if the communication with the device is KO
"false" if the communication with the device is OK
Related functions
IsDeviceCommunicationEnabled()
Example
Bool ComKo;
ComKo=IsDeviceCommunicationKo(1,3);
9.4.7
ResetDeviceRxErrors
Description
Reset read errors communication counter of the device.
Syntax
Bool ResetDeviceRxErrors(Int Channel, Int DevNum)
Parameters
Channel = channel number
DevNum = device number
Returned value
"true" if function has been executed correctly,
"false" on error.
Related functions
GetDeviceRxErrors(),ResetDeviceTxErrors()
Example
ResetDeviceRxErrors(1,3);
9.4.8
ResetDeviceTxErrors
Description
Reset write errors communication counter of the device.
Syntax
Bool ResetDeviceTxErrors(Int Channel, Int DevNum)
API
Parameters
Channel = channel number
DevNum = device number
Returned value
"true" if function has been executed correctly,
"false" on error.
Related functions
GetDeviceTxErrors(),ResetDeviceRxErrors()
Example
ResetDeviceTxErrors(1,3);
9.5
Directory
9.5.1
DirectoryCreate
Description
it creates a new directory
Syntax
Bool DirectoryCreate(String DirName)
Parameters
DirName = name of new directory
Returned value
true (directory successfully created)
false (on error)
Related functions
DirectoryDelete()
Example
DirectoryCreate("MyProj");
9.5.2
DirectoryDelete
Description
it deletes a directory
Syntax
Bool DirectoryDelete(String DirName)
Parameters
DirName = name of the directory you want to delete
Returned value
true (directory deleted)
false (on failure)
Related functions
DirectoryCreate()
55
56
9.5.3
DirectoryGetCurrent
Description
it returns the current directory
Syntax
String DirectoryGetCurrent()
Parameters
Returned value
the current path
Related functions
DirectorySetCurrent()
Example
SearchFor=DirectoryGetCurrent()+"\*.*";
9.5.4
DirectorySetCurrent
Description
it sets the current directory
Syntax
Bool DirectorySetCurrent(String NewPath)
Parameters
NewPath = new path you want to set
Returned value
true (current path updated)
false (on error)
Related functions
DirectoryGetCurrent()
Example
DirectorySetCurrent("y:\projects");
9.6
Files
9.6.1
FileAttrFound
(OBSOLETE)
Description
It returns the file attribute of last file read by FileFindFirst or FileFindNext
Syntax
API
Int FileAttrFound()
Parameters
Returned value
attribute of last file found
Related functions
FileFindNext(), FileFindClose(), FileFindFirst(), FileNameFound()
Example
Example
NB: It's recommended to use FileAttrFoundEx().
9.6.2
FileAttrFoundEx
Description
It returns the file attribute of last file read by FileFindFirstEx or FileFindNextEx
Syntax
Int FileAttrFoundEx(int Handle)
Parameters
Handle = this is the handle of the search in progress.
Returned value
attribute of last file found
Related functions
FileFindFirstEx() , FileFindNextEx() , FileFindCloseEx() , FileNameFoundEx()
Example
-
9.6.3
FileCopy
Description
Copies a file
Syntax
Bool FileCopy(String Src, String Dst, Bool IfExists)
Parameters
Src = file you want to copy
Dst = destination file
IfExists =true (if Dst exists it is not overwritten) / false (if Dst exists it's overwritten)
Returned value
true (on success)
false (on failure)
Related functions
FileMove()
57
58
Example
if (FileExist("Promem.txt"))then
FileCopy("Promem.txt","Promem.bak",false); // overwrite if exists
end
9.6.4
FileClose
Description
Closes an already open file
Syntax
int FileClose(Int Handle)
Parameters
Handle = handle of the file
Returned value
0 on success
non zero (on failure)
Related functions
FileOpen()
Example
FileHandle=FileOpen("Starter.dat","rt"); // open text file for reading
FileWriteLn(FileHandle,"Stringa di prova");
FileWriteLn(FileHandle,"questa la seconda riga");
FileClose(FileHandle);
9.6.5
FileDelete
Description
it deletes a file
Syntax
Bool FileDelete(String FileName)
Parameters
FileName = name of the file
Returned value
true (on success)
false (on error)
Related functions
Example
if (FileExist("Promem.bak"))then
FileDelete("Promem.bak");
end
API
9.6.6
59
FileEof
Description
it returns a nonzero value if reading/writing file pointer has arrived at the End Of File.
Syntax
Int FileEOF(Int Handle)
Parameters
Handle = handle of opened file
Returned value
nonzero value at the end of the file
Related functions
Example
int i=0;
FileHandle=FileOpen("MadeByAPI.dat","rb");
binary file for reading
While (FileEOF(FileHandle) == 0)
chars at time
i=i+1;
s=FileRead(FileHandle,3);
if (FileEOF(FileHandle) == 0) then
MessageBox(s,"triplet number "+IntToStr(i));
end
End
FileClose(FileHandle);
9.6.7
FileExist
Description
it tells you if the file exist
Syntax
Bool FileExist(String FileName)
Parameters
FileName = name of the file
Returned value
true ( it exists)
false (it does not exist)
Related functions
Example
if (FileExist("Promem.bak")) then
FileDelete("Promem.bak");
end
// it opens
// it read 3
// is data valid?
60
9.6.8
FileFindClose
(OBSOLETE)
Description
it stops the process of directory file reading (started with FileFindFirst) then free used resources
Syntax
void FileFindClose()
Parameters
Returned value
Related functions
FileFindNext(), FileFindFirst(), FileNameFound(), FileAttrFound()
Example
Example
Note: It's recommended to use FileFindCloseEx().
9.6.9
FileFindCloseEx
Description
it stops the process of directory file reading (started with FileFindFirstEx) then free used resources
Syntax
void FileFindCloseEx(int Handle)
Parameters
Handle = this is the handle of the search in progress.
Returned value
Related functions
FileFindFirstEx() , FileFindNextEx() , FileNameFoundEx() , FileAttrFoundEx()
Example
-
9.6.10 FileFindFirst
(OBSOLETE)
Description
it starts directory file reading process
Syntax
Bool FileFindFirst(String Path)
API
61
Parameters
Path = path that you want to get directory file list from
Returned value
true (if exist at least a file)
false (empty directory)
Related functions
FileFindNext(), FileFindClose(), FileNameFound(), FileAttrFound()
Example
Example
Note: Don't execute more than one FINDFIRST, if you start using FindFirst you have to close the
reading session with FINDCLOSE to free resources.
NB: It's recommended to use FileFindFirstEx().
9.6.11 FileFindFirstEx
Description
it starts directory file reading process
Syntax
int FileFindFirstEx(String Path)
Parameters
Path = path that you want to get directory file list from
Returned value
The handle for the search in progress. It must be used in the following instructions
FileFindNextEx() and FileFindCloseEx().
0 means error.
To know if at last one file have been found check that FileNameFoundEx() returns a string
different from "".
Related functions
FileFindNextEx() , FileFindCloseEx() , FileNameFoundEx() , FileAttrFoundEx()
Example
-
9.6.12 FileFindNext
(OBSOLETE)
Description
it goes on with the directory reading file process
Syntax
Bool FileFindNext()
62
9.6.13 FileFindNextEx
Description
it goes on with the directory reading file process
Syntax
bool FileFindNextEx(int Handle)
Parameters
Handle = this is the handle of the search in progress.
Returned value
true (another file found)
false (no more files)
Related functions
FileFindFirstEx() , FileFindCloseEx() , FileNameFoundEx() , FileAttrFoundEx()
Example
-
9.6.14 FileGetAttr
Description
it returns attribute of a file
Syntax
Int FileGetAttr(String FileName)
Parameters
FileName = name of the file
Returned value
attribute of the file
Related functions
FileSetAttr()
Example
API
FileSetAttr("TryMe.bat",FileGetAttr("TryMe.bat") | 1);
// this file must be READ ONLY!
9.6.15 FileSetAttr
Description
it sets attributes of a file
Syntax
Int FileGetAttr(String FileName,Int NewAttr)
Parameters
FileName = name of the file
NewAttr = new attributes for the file
Returned value
0 (attributes successfully changed)
nonzero (onerror)
Related functions
FileGetAttr()
Example
FileSetAttr("TryMe.bat",FileGetAttr("TryMe.bat")|1);
// this file must be READ ONLY
9.6.16 FileGetSize
Description
it returns size of a file
Syntax
Int FileGetSize(String FileName)
Parameters
FileName = name of the file
Returned value
file size in bytes
Related functions
Example
CCDim=FileGetSize("Command.Com");
9.6.17 FileMove
Description
it moves a file
Syntax
Bool FileMove(String From, String To)
63
64
9.6.18 FileNameFound
(OBSOLETE)
Description
It returns the file name of last file read by FileFindFirst or FileFindNext
Syntax
String FileNameFound()
Parameters
Returned value
name of the file
Related functions
FileFindNext(), FileFindClose(), FileFindFirst()
Example
Example
Note: It's recommended to use FileNameFoundEx().
9.6.19 FileNameFoundEx
Description
It returns the file name of last file read by FileFindFirstEx or FileFindNextEx
Syntax
String FileNameFoundEx(int Handle)
Parameters
Handle = this is the handle of the search in progress.
Returned value
API
65
9.6.20 FileOpen
Description
it opens a file with specified mode
Syntax
int FileOpen(String FileName, String Mode)
Parameters
FileName = name of the file
Mode = open mode (see modes below)
Returned value
handle of the file (on success)
0 (on failure)
Related functions
FileClose()
Example
FileHandle=FileOpen("Promem.txt","wt"); // open a text file for writing
FileWriteLn(FileHandle,"Stringa di prova");
FileWriteLn(FileHandle,"questa la seconda riga");
FileClose(FileHandle);
Modes:
If you add t or b into the mode string, you can specify the data type you work on, text or binary
data.
66
9.6.21 FilePos
Description
it returns the current file pointer position (file has to be opened)
Syntax
Int FilePos(Int Handle)
Parameters
Handle = handle of opened file
Returned value
position of the reading/writing file pointer
Related functions
FileSeek()
Example
CurPos=FileSeek(CurrHandle);
9.6.22 FileRead
Description
it reads chars form a binary file
Syntax
String FileRead(Int Handle, Int Length)
Parameters
Handle = handle of opened binary file
Length = number of chars tu read
Returned value
chars read from file
Related functions
FileWrite(), FileSize()
Example
Buffer=FileRead(FileHandle,16);
// it reads 16 chars
9.6.23 FileReadLn
Description
it reads a line form a text file
Syntax
String FileReadLn(Int Handle)
Parameters
Handle = handle of opened text file
Returned value
line read from file
API
Related functions
FileWriteLn(), FileOEF()
Example
CurrLine=FileReadLn(TextFileHandle);
9.6.24 FileRename
Description
it changes the name of a file
Syntax
Int FileRename(String OldName, String NewName)
Parameters
OldName = filename of the existing file
NewName = new file name for the file
Returned value
0 (on success)
-1 (on error)
Related functions
Example
if (FileExist("Promem.bak"))then
FileRename("Promem.bak","Promem.txt");
end
9.6.25 FileSeek
Description
Moves the reading/writing pointer
Syntax
int FileSeek(Int Handle, Int Offset, Whence)
Parameters
Handle = handle of the file
Offset = position of the pointer
Whence = pointer movement from here (see table below)
Whence Table
Value
Description
0
1
2
Returned value
0 on success (otherwise failure)
67
68
9.6.26 FileSize
Description
it returns the size of an opened file
Syntax
Int FileSize(Int Handle)
Parameters
Handle = handle of the opened file
Returned value
file size in bytes
Related functions
Example
DirSize=DirSize+FileSize(CurrFileHandle);
9.6.27 FileSplitPath
Description
it splits a complete file name into its components (Drive, Path,FileName and Extension)
Syntax
String FileSplitPath(String FileName, Int Elem)
Parameters
FileName = complete file name
Elem = requested component:
0 - Drive
1 - Path
2 - FileName
3 - Extension
Returned value
requested element
Related functions
Example
String FN="c:\windows\system\win.ini";
String Drive;
String Path;
String FileName;
String Ext;
API
69
Drive=FileSplitPath(FN,0); // C
Path=FileSplitPath(FN,1); // \WINDOWS\SYSTEM
FileName=FileSplitPath(FN,2); // WIN
Ext=FileSplitPath(FN,3); // .ini
9.6.28 FileWrite
Description
it writes chars in a binary file
Syntax
int FileWrite(Int Handle, String Data, Int Length)
Parameters
Handle = handle of opened binary file
Data = chars to write
Length = number of chars to write
Returned value
number of chares that are been written
Related functions
FileRead(), FileSize()
Example
FileWrite(FileHandle,Buffer,16); // it writes 16 chars from Buffer to
file
9.6.29 FileWriteLn
Description
it writes a line in a text file
Syntax
Int FileWriteLn(Int Handle, String Line)
Parameters
Handle = handle of opened text file
Line = string to write
Returned value
non negative value on success
Related functions
FileReadLn(), FileOEF()
Example
FileWriteLn(TextFileHandle,UserInserted);
70
9.7
Gates
9.7.1
NumGates
9.7.1.1
GetNumGateCommunicationStatus
Description
Returns the status of the specified gate
Syntax
Bool GetNumGateCommunicationStatus(String Name, Int Id)
Parameters
Name = name of the gate you want to read
Id = identifier of the gate you want to read
Returned value
true (if gate is OK)
false (if gate is KO)
Related functions
GetDigGateCommunicationStatus(), GetStrGateCommunicationStatus()
Example
Bool ok;
ok = GetNumGateCommunicationStatus ("NUM 100",1);
9.7.1.2
GetNumGateGateID
Description
Returns the GateID of the indicated numeric gate.
Syntax
String GetNumGateGateID(Int Index)
Parameters
int Index = gate index in the numeric gates list.
Returned value
GateID as string value.
Related functions
GetNumGateNID()
Example
string GateID;
API
GateID = GetNumGateGateID (10);
9.7.1.3
GetNumGateNID
Description
Returns the Gate NID of the indicated numeric gate.
Syntax
Int GetNumGateNID(Int Index)
Parameters
int Index = gate index in the numeric gates list.
Returned value
Gate NID as integer value.
Related functions
GetNumGateGateID()
Example
int GateNID;
GateNID = GetNumGateNID (10);
9.7.1.4
GetNumGateProp
Description
Returns a numeric gate property into a string
Syntax
String GetNumGateProp(String Name, Int Id, int Property)
Parameters
Name = name of the gate you want to read
Id = identifier of the gate you want to read
Property = property number
PROPERTIES
Channel number
Device number
Gate address
Value type
CONSTANT
0
1
2
3
71
72
4
5
6
7
8
9
10
11
12
Returned value
String containing the requested property
Related functions
Example
samplingRate = GetnumeGateProp (NUM1, ID1, 10);
9.7.1.5
GetNumGateValue
Description
It returns the value of the specified gate through name and numerical identifier.
Syntax
Real GetNumGateValue(String Name, Int Id)
Parameters
Name = name of the gate you want to read
Id = identifier of the gate you want to read
Returned value
value of the specified gate
Related functions
SetNumGateValue()
Example
int Gate12Id;
String Gate12Name;
Gate12 = GetNumGateValue(Gate12Name, Gate12Id);
9.7.1.6
GetNumGateValueAsString
Description
It returns the value of the specified gate as a formatted text string.
Syntax
String GetNumGateValueAsString(String Name, Int Id,String Format)
Parameters
API
73
Returned value
value of the specified gate as formatted text
Related functions
GetNumGateValue()
Example
int Gate12Id;
String Gate12Name;
Sring Value;
Value = GetNumGateValueAsString(Gate12Name, Gate12Id,"%6.*lf");
9.7.1.7
GetTotalNumGates
Description
Returns the number of numeric gates defined in the application.
Syntax
int GetTotalNumGates()
Parameters
Returned value
The number of numeric gates defined in the application.
74
9.7.1.8
NumGateExists
Description
Check if the specified numeric gate exists.
Syntax
Bool NumGateExists(String Name, Int Id)
Parameters
Name = name of the gate to search
Id = identifier of the gate to search
Returned value
true if the gate is defined in the application
false if the gate does not defined in the application
Related functions
CmpGateExists() , DigGateExists() , EvnGateExists() , StrGateExists()
Example
Bool ok;
ok = NumGateExists("N",1);
9.7.1.9
SetNumGateValue
Description
It changes the value of the specified gate through name and numerical identifier
Syntax
Bool SetNumGateValue(String Name, Int Id, Real Value)
Parameters
Name = name of the gate you want to change
Id = identifier of the gate you want to change
Value = numerical value you want to give to the gate
Returned value
true (if the gate is existing and has been changed)
false (if not)
Related functions
GetNumGateValue()
Example
if (GetNumGateValue(PrimaryName,PrimaryID)) then
API
PrimaryState=OKState;
end
9.7.2
DigGates
9.7.2.1
DigGateExists
Description
Check if the specified digital gate exists.
Syntax
Bool DigGateExists(String Name, Int Id)
Parameters
Name = name of the gate to search
Id = identifier of the gate to search
Returned value
true if the gate is defined in the application
false if the gate does not defined in the application
Related functions
CmpGateExists() , EvnGateExist() , NumGateExists() , StrGateExists()
Example
Bool Exists;
Exists = DigGateExists("D",1);
9.7.2.2
GetDigGateCommunicationStatus
Description
Returns the status of the specified gate
Syntax
Bool GetDigGateCommunicationStatus(String Name, Int Id)
Parameters
Name = name of the gate you want to read
Id = identifier of the gate you want to read
Returned value
true (if gate is OK)
false (if gate is KO)
Related functions
GetNumGateCommunicationStatus(), GetStrGateCommunicationStatus()
Example
Bool ok;
ok = GetDigGateCommunicationStatus ("DIG 100",1);
75
76
9.7.2.3
Parameters
int Index = gate index in the digital gates list.
Returned value
GateID as string value.
Related functions
GetDigGateNID()
Example
string GateID;
GateID = GetDigGateGateID (10);
9.7.2.4
GetDigGateNID
Description
Returns the Gate NID of the indicated digital gate.
Syntax
Int GetDigGateNID(Int Index)
Parameters
int Index = gate index in the digital gates list.
Returned value
Gate NID as integer value.
Related functions
GetDigGateGateID()
Example
int GateNID;
API
77
GetDigGateProp
Description
Returns a digital gate property into a string
Syntax
String GetDigGateProp(String Name, Int Id, int Property)
Parameters
Name = name of the gate you want to read
Id = identifier of the gate you want to read
Property = property number
PROPERTIES
Channel number
Device number
Gate address
Sampling rate
Read status
Write status
CONSTANT
0
1
2
10
11
12
Returned value
String containing the requested property
Related functions
Example
samplingRate = GetDigGateProp (DIG1, ID1, 10);
9.7.2.6
GetDigGateValue
Description
It returns the value of the specified digital gate through name and numerical identifier. This value
is an integer number.
Syntax
Int GetDigGateValue(String Name, Int Id)
Parameters
Name = name of the gate you want to read
Id = identifier of the gate you want to read
Returned value
value of the specified gate
78
9.7.2.7
GetTotalDigGates
Description
Returns the number of digital gates defined in the application.
Syntax
int GetTotalDigGates()
Parameters
Returned value
The number of digital gates defined in the application.
Related functions
GetTotalCmpGates(),GetTotalEvnGates(),GetTotalNumGates(),GetTotalStrGates()
Example
TotalGates=GetTotalDigGates();
9.7.2.8
SetDigGateValue
Description
Return the enabled/disabled device communication status.
Syntax
Bool IsDeviceCommunicationEnabled(Int Channel, Int DevNum)
Parameters
Channel = channel number
DevNum = device number
Returned value
"true" if device communication is enabled.
"false" if device communication is disabled.
Related functions
Example
Bool Status;
Status=IsDeviceCommunicationEnabled(1,3);
API
9.7.3
CmpGates
9.7.3.1
CmpGateExists
Description
Check if the specified compound gate exists.
Syntax
Bool CmpGateExists(String Name, Int Id)
Parameters
Name = name of the gate to search
Id = identifier of the gate to search
Returned value
true if the gate is defined in the application
false if the gate does not defined in the application
Related functions
DigGateExists() , EvnGateExists() , NumGateExists() , StrGateExists()
Example
Bool Exists;
Exists = CmpGateExists("C",1);
9.7.3.2
GetCmpGateGateID
Description
Returns the GateID of the indicated compound gate.
Syntax
String GetCmpGateGateID(Int Index)
Parameters
int Index = gate index in the compound gates list.
Returned value
GateID as string value.
Related functions
GetCmpGateNID()
Example
string GateID;
GateID = GetCmpGateGateID (10);
79
80
9.7.3.3
Parameters
int Index = gate index in the compound gates list.
Returned value
Gate NID as integer value.
Related functions
GetCmpGateGateID()
Example
int GateNID;
GateNID = GetCmpGateNID (10);
9.7.3.4
GetCmpGateValue
Description
It returns the value of the specified complex gate through name and numerical identifier.
Syntax
Real GetCmpGateValue(String Name, Int Id)
Parameters
Name = name of the gate you want to read
Id = identifier of the gate you want to read
Returned value
value of the specified gate
Related functions
Example
String PortName;
GateName="GateA";
CurrValue= GetCmpGateValue(GateName,GateNo);
API
9.7.3.5
81
GetCmpGateValueAsString
Description
It returns the value of the specified gate as a formatted text string.
Syntax
String GetCmpGateValueAsString(String Name, Int Id,String Format)
Parameters
Name = name of the gate you want to read
Id = identifier of the gate you want to read
Format = format of the returned text.
Using the %g format, the software will show the real number using the less space
possible (if needed using the exponential notation). If you want to specify how the number
should appear, is possible to use the notation %x.ylf, where:
Returned value
value of the specified gate as formatted text
Related functions
GetCmpGateValue()
Example
int Gate12Id;
String Gate12Name;
Sring Value;
Value = GetCmpGateValueAsString(Gate12Name, Gate12Id,"%6.*lf");
9.7.3.6
GetTotalCmpGates
Description
Returns the number of compound gates defined in the application.
82
9.7.4
StrGates
9.7.4.1
GetStrGateCommunicationStatus
Description
Check if the specified numeric gate exists.
Syntax
Bool NumGateExists(String Name, Int Id)
Parameters
Name = name of the gate to search
Id = identifier of the gate to search
Returned value
true if the gate is defined in the application
false if the gate does not exist in the application
Related functions
GetNumGateCommunicationStatus(),GetDigGateCommunicationStatus()
Example
Bool Exists;
Exists = NumGateExist("N",1);
9.7.4.2
GetStrGateGateID
Description
Returns the GateID of the indicated string gate.
Syntax
String GetStrGateGateID(Int Index)
Parameters
int Index = gate index in the string gates list.
API
Returned value
GateID as string value.
Related functions
GetStrGateNID()
Example
string GateID;
GateID = GetStrGateGateID (10);
9.7.4.3
GetStrGateNID
Description
Returns the Gate NID of the indicated string gate.
Syntax
Int GetStrGateNID(Int Index)
Parameters
int Index = gate index in the string gates list.
Returned value
Gate NID as integer value.
Related functions
GetStrGateGateID()
Example
int GateNID;
GateNID = GetStrGateNID (10);
9.7.4.4
GetStrGateValue
Description
It returns the value of the specified string gate through name and numerical identifier.
Syntax
String
Parameters
Name = name of the gate you want to read
Id = identifier of the gate you want to read
83
84
Returned value
string of the specified gate
Related functions
SetStrGateValue()
Example
CurrValue= GetStrGateValue("STRGate001",STRGateNo);
9.7.4.5
GetStrGateProp
Description
Returns a string gate property into a string
Syntax
String GetStrGateProp(String Name, Int Id, int Property)
Parameters
Name = name of the gate you want to read
Id = identifier of the gate you want to read
Property = property number
PROPERTIES
Channel number
Device number
Gate address
Sampling rate
Read status
Write status
CONSTANT
0
1
2
10
11
12
Returned value
String containing the requested property
Related functions
Example
samplingRate = GetStrGateProp (STR1, ID1, 10);
9.7.4.6
SetStrGateValue
Description
It changes the value of the specified string gate through name and numerical identifier.
Syntax
Bool SetStrGateValue(String Name, Int Id, String Value)
Parameters
API
Name = name of the gate tou want to change
Id = identifier of the gate you want to change
Value = new value to give to the gate
Returned value
true (if the gate is existing and has been changed)
false (if not)
Related functions
GetStrGateValue()
Example
GateModified= SetStrGateValue("Gate0001SS",1,"Alfa");
9.7.4.7
GetTotalStrGates
Description
Returns the number of string gates defined in the application.
Syntax
int GetTotalStrGates()
Parameters
Returned value
The number of string gates defined in the application.
Related functions
GetTotalDigGates(),GetTotalEvnGates(),GetTotalNumGates(),GetTotalCmpGates()
Example
TotalGates=GetTotalStrGates();
9.7.4.8
StrGateExists
Description
Check if the specified string gate exists.
Syntax
Bool StrGateExists(String Name, Int Id)
Parameters
Name = name of the gate to search
Id = identifier of the gate to search
Returned value
true if the gate is defined in the application
false if the gate does not defined in the application
Related functions
CmpGateExists() , DigGateExists() , EvnGateExists() , NumGateExists()
85
86
Example
Bool Exists;
Exists = StrGateExists("S",1);
9.7.5
EvnGates
9.7.5.1
EvnGateExists
Description
Check if the specified event/alarm gate exists.
Syntax
Bool EvnGateExists(String Name, Int Id)
Parameters
Name = name of the gate to search
Id = identifier of the gate to search
Returned value
true if the gate is defined in the application
false if the gate does not defined in the application
Related functions
CmpGateExists() , DigGateExists() , NumGateExists() , StrGateExists()
Example
Bool Exists;
Exists = EvnGateExists("E",1);
9.7.5.2
GetEvnGateAckedStatus
Description:
It returns the alarm acquisition state of the specified event gate through name and numerical
identifier.
Syntax:
Bool GetEvnGateAckedStatus(String Name, Int Id)
Parameters:
Name = gate name
Id
= gate identifier
Returned value:
True = alarm has been acknowledged by operator
False = alarm not has been acknowledged by operator
Related functions:
GetEvnGateValue(), GetEvnGateMsg()
Example:
if(GetEvnGateAckedStatus(EVN3,ID3)==false) then
API
GetStrGateMsg(EV3,ID3);
end
9.7.5.3
GetEvnGateGateID
Description
Returns the GateID of the indicated event/alarm gate.
Syntax
String GetEvnGateGateID(Int Index)
Parameters
int Index = gate index in the event/alarm gates list.
Returned value
GateID as string value.
Related functions
GetEvnGateNID()
Example
string GateID;
GateID = GetEvnGateGateID (10);
9.7.5.4
GetEvnGateNID
Description
Returns the Gate NID of the indicated event/alarm gate.
Syntax
Int GetEvnGateNID(Int Index)
Parameters
int Index = gate index in the event/alarm gates list.
Returned value
Gate NID as integer value.
Related functions
GetEvnGateGateID()
87
88
Example
int GateNID;
GateNID = GetEvnGateNID (10);
9.7.5.5
GetEvnGateMsg
Description:
Returns the message of the specified event gate through name and numerical identifier.
Syntax:
String GetEvnGateValue(String Name, Int Id)
Parameters:
Name = name of the gate you want to read
Id = identifier of the gate you want to read
Valore restituito:
message of the event gate
Funzioni inerenti:
GetEvnGateValue()
Example:
GateA_Msg= GetEvnGateMsg(GateA_Name,1);
9.7.5.6
GetEvnGateValue
Description
It returns the value of the specified event gate through name and numerical identifier.
Syntax
Bool GetEvnGateValue(String Name, Int Id)
Parameters
Name = name of the gate you want to read
Id = identifier of the gate you want to read
Returned value
value of the selected event gate
Related functions
GetEvnGateMsg()
Example
GateModified= GetEvnGateValue("Gate0001",1);
API
9.7.5.7
GetTotalEventGates
Description
Returns the number of event/alarm gates defined in the application.
Syntax
int GetTotalEvnGates()
Parameters
Returned value
The number of event/alarm gates defined in the application.
Related functions
GetTotalDigGates(),GetTotalCmpGates(),GetTotalNumGates(),GetTotalStrGates()
Example
TotalGates=GetTotalEvnGates();
9.8
Generic
9.8.1
Beep
Description
It sends out an acoustic signal.
Syntax
Void Beep()
Parameters
Returned value
Related functions
Example
Beep();
9.8.2
CloseKeyboard
Description
Close the keyboard actually opened.
Syntax
CloseKeyboard()
Parameters
89
90
9.8.3
CloseSession
Description
Already open session is closed
Syntax
Void CloseSession()
Parameters
(none)
Returned value
(none)
Related functions
Example
CloseSession();
9.8.4
CloseWindow
Description
It closes the window from which the function is called.
Syntax
Void CloseWindow()
Parameters
Returned value
Related functions
WindowIsOpen()
Example
CloseWindow();
API
9.8.5
91
EnableShutdown
Description
Enable / Disable computer automatic power off after an exit of supervision session.
Syntax
EnableShutdown(Bool Flag)
Parameters
Flag = true for automatic computer power off on supervision session exit.
false for no computer poer off on supervision session exit.
Returned value
Related functions
GetShutdownStatus()
Example
Function void DisablePCOff()
EnableShutdown(false);
power off disabled
end
Function void EnablePCOff()
EnableShutdown(true);
power off enabled
end
9.8.6
Exec
Description
Executes a program
Syntax
Int Exec(String ProgName)
Parameters
ProgName = filename of the program
Returned value
value > 31 (on success)
Related functions
Example
if (Exec("c:\windows\command\command.com") > 31) then
DosShellExecuted=true;
end
// Computer
// Computer
92
9.8.7
ExecEx
Description
Executes a program
Syntax
Int ExecEx(String ProgName,int WindowType)
Parameters
ProgName = filename of the program
WindowType= If 1 then executes a program in a Maximized window
If 2 then executes a program in a Minimized window
If 3 then executes a program in a default size window
Returned value
value > 31 (on success)
Related functions
Example
if (ExecEx("c:\windows\command\command.com",1) > 31) then
DosShellExecuted=true;
end
9.8.8
FileOpenDialog
Description
Open a standard FileOpen Dialog.
Syntax
String FileOpenDialog( string Filename ,
string FilenameFilter,
int FilterIndex,
string InitialDir,
string DefaultExt,
bool HideReadOnly,
bool PathMustExist,
bool FileMustExist,
bool NoValidate,
bool NoChangeDir,
bool AllowMultiSelect,
bool CreatePrompt,
bool NoReadOnlyReturn,
bool NoTestFileCreate,
bool OverwritePrompt,
bool ShareAware,
bool ShowHelp)
API
93
Parameters
string FileName=name and directory path of the last file selected.
string FileNameFilter= file masks (filters)
int FilterIndex=filter selected by default when the dialog opens.
string InitialDir=current directory when the dialog opens.
string DefaultExt=default file extension.
bool HideReadOnly= removes the Open As Read Only check box from the dialog.
bool PathMustExist=generates an error message if the user tries to select a file name with a
nonexistent directory path.
bool FileMustExist=generates an error message if the user tries to select a nonexistent file.
bool NoValidate=disables checking for invalid characters in file names. Allows selection of file
names with invalid characters.
bool NoChangeDir= after the user clicks OK, resets the current directory to whatever it was before
the file-selection dialog opened.
bool AllowMultiSelect=allows users to select more than one file in the dialog.
bool CreatePrompt=generates a warning message if the user tries to select a nonexistent file,
asking whether to create a new file with the specified name.
bool NoReadOnlyReturn=generates an error message if the user tries to select a read-only file.
bool NoTestFileCreate=disables checking for network file protection and inaccessibility of disk
drives. Applies only when the user tries to save a file in a create-no-modify shared network
directory.
bool OverwritePrompt=generates a warning message if the user tries to select a file name that is
already in use, asking whether to overwrite the existing file.
bool ShareAware=ignores sharing errors and allows files to be selected even when sharing
violations occur.
bool ShowHelp=displays a Help button in the dialog.
Returned value
A string with path + file name if the "OK" button is pressed.
A string with "" if "ESC" button is pressed.
Related functions
FileSaveDialog()
Example
string FileName;
FileName=FileOpenDialog("",
"*.txt|*.dat",
filter patterns.
1,
Index
"C:\",
"*",
extension
true,
false,
false,
false,
false,
false,
//Filename .
//Filename filter &
//Filter
//Initial dir.
//Default
//
//
//
//
//
//
HideReadOnly
PathMustExist
FileMustExist
NoValidate
NoChangeDir
94
// CreatePrompt
//
false,
//
false,
false,
false);
// OverwritePrompt
// ShareAware
// ShowHelp
NoReadOnlyReturn
NoTestFileCreate
MessageBox(FileName,"File Selected");
9.8.9
FileSaveDialog
Description
Open a standard FileSave Dialog.
Syntax
String FileSaveDialog( string Filename ,
string FilenameFilter,
int FilterIndex,
string InitialDir,
string DefaultExt,
bool HideReadOnly,
bool PathMustExist,
bool NoValidate,
bool NoChangeDir,
bool AllowMultiSelect,
bool CreatePrompt,
bool NoReadOnlyReturn,
bool NoTestFileCreate,
bool OverwritePrompt,
bool ShareAware,
bool ShowHelp)
Parameters
string FileName=name and directory path of the last file selected.
string FileNameFilter= file masks (filters)
int FilterIndex=filter selected by default when the dialog opens.
string InitialDir=current directory when the dialog opens.
string DefaultExt=default file extension.
bool HideReadOnly= removes the Open As Read Only check box from the dialog.
bool PathMustExist=generates an error message if the user tries to select a file name with a
nonexistent directory path.
bool NoValidate=disables checking for invalid characters in file names. Allows selection of file
names with invalid characters.
bool NoChangeDir= after the user clicks OK, resets the current directory to whatever it was before
API
95
Returned value
A string with path + file name if the "OK" button is pressed.
A string with "" if "ESC" button is pressed.
Related functions
FileOpenDialog()
Example
string FileName;
FileName=FileSaveDialog("",//Filename .
"*.txt|*.dat",
filter patterns.
1,
Index
"C:\",
"*",
extension
true,
false,
false,
false,
false,
//
//
//
//
//
HideReadOnly
PathMustExist
NoValidate
NoChangeDir
false,
false,
// CreatePrompt
//
false,
//
false,
false,
false);
// OverwritePrompt
// ShareAware
// ShowHelp
AllowMultiSelect
NoReadOnlyReturn
NoTestFileCreate
MessageBox(FileName,"File Selected");
9.8.10 GetCurrentLanguage
Description
Returns the application current language
96
GetCurrentLanguage()
Parameters
Returned value
string with the name of language currently selected in the application
Example
string ProjLanguage;
ProjLanguage=GetCurrentLanguage();
9.8.11 GetProjectCaption
Description
Returns the current project caption
Syntax
String
GetProjectCaption()
Parameters
Returned value
string with the caption of current project
Related functions
GetProjectPath()
Example
ProjName=GetProjectCaption();
9.8.12 GetProjectName
Description
Returns the current project name
Syntax
String
GetProjectName()
Parameters
Returned value
string with the name of current project
Related functions
GetProjectPath()
API
Example
ProjName=GetProjectName();
9.8.13 GetProjectPath
Description
Returns the current project path
Syntax
String GetProjectPath()
Parameters
Returned value
string with the path of current project
Related functions
GetProjectName()
Example
ProjPath=GetProjectPath();
9.8.14 GetShutdownStatus
Description
Return the status enabled or disabled of computer automatic power off after an exit of
supervision session.
Syntax
Bool GetShutdownStatus()
Parameters
Returned value
True : computer automatic power off is enabled.
False : computer automativ power off is disabled.
Related functions
EnableShutdown()
Example
Function void Main()
if (GetShutdownStatus()==true) then
MessageBox(0,"Power off enabled","Status",0);
else
97
98
9.8.15 GetUserName
Description
It returns the current user name (the one used to be identified through the PasswordTemplate)
Syntax
String GetUserName()
Parameters
Returned value
Current user name
Related functions
GetUserGroups(),Logout()
Example
if (GetUserName() != "MASTER") then
MessageBox("It is necessary to alert the MASTER","ALARMS");
end
9.8.16 GetUserGroups
Description
It returns the groups associated with the current user name
Syntax
Integer GetUserGroups()
Parameters
Returned value
An integer value that represents in binary format the groups associated with the current
UserName
For example: if the current User is associated with groups 1,3 and 7 the function GetUserGroups()
will return the following value : 69.
[2^0 * 1] +
(Group 1)
1+
[2^1 * 0] +
(Group 2)
0+
[2^2 * 1] +
(Group 3)
4+
[2^3 * 0] +
(Group 4)
0+
API
[2^4 * 0] +
(Group 5)
0+
[2^5 * 0] +
(Group 6)
0+
[2^6 * 1] +
(Group 7)
64+
[2^7 * 0] +
(Group 8)
0+
[2^8 * 0] +
(Group 9)
0+
[2^9 * 0] +
(Group 10)
0+
[2^10 * 0] +
(Group 11)
0+
[2^11 * 0] +
(Group 12)
0+
[2^12 * 0] +
(Group 13)
0+
[2^13 * 0] +
(Group 14)
0+
[2^14 * 0] +
(Group 15)
0
Related functions
GetUserName(),Logout()
Example
Groups=GetUserGroups();
9.8.17 HexStrToInt
Description
Converts an hex number to integer
Syntax
Int HexStrToInt(String HexValue)
Parameters
HexValue = string containing hex number
Returned value
the integer conversione of the hex number
Related functions
IntToHexStr()
Example
int RedColor;
RedColor=HexStrToInt("FF0000");
99
100
9.8.18 Keyboard
Description
View the keyboard specified by the name.
The keyboard must be defined by Keyboard Builder tool.
This function is utilized for touch screen applications.
Following there are some keyboards examples built with Keyboard Builder
SYntax
Keyboard(String Name)
Parameters
Name = keyboard name to open
Returned value
None
Related functions
CloseKeyboard()
Example
Keyboard("NumericKeyboard");
9.8.19 IconMessageBox
Description
It shows on the screen a window containing text and the specified title, plus any combination of
predefined icons and push buttons. It waits for confirmation from the user.
Syntax
Int IconMessageBox(String Text, String Title, Int ButtonType, Int
IconType, Int DefaultButton)
API
Parameters
Text = the text in the window
Title = the title of the window
ButtonType = indicate the button contained in the message box
IconType = display an icon in the message box
DefaultButton = indicate the default button
ButtonType:
1
message box contains three push buttons: Abort, Retry,
Ignore
2
message box contains one push buttons: OK
3
message box contains two push buttons: OK, Cancel
4
message box contains two push buttons: Retry, Cancel
5
message box contains two push buttons: Yes, No
6
message box contains three push buttons: Yes, No,
Cancel
IconType
1
exclamation-point icon appears in the message box (iconexclamation)
2
exclamation-point icon appears in the message box (iconewarning)
3
icon consisting of a lowercase letter i in a circle appears in the message box
(iconinformation)
4
icon consisting of a lowercase letter i in a circle appears in the message box
(iconasterisk)
5
question-mark icon appears in the message box (iconquestion)
6
stop-icon appears in the message box (iconstop)
7
stop-icon appears in the message box (iconerror)
8
stop-icon appears in the message box (iconhand)
DefaultButton
1
frist is the default button
2
second is the default
button
3
third button is the default
button
4
fourth is the default
button
Returned value
0 if there is not enough memory to create the message box
1 if Abort button was selected
2 if Cancel button was selected
3 if Ignore button was selected
4 if No button was selected
5 if OK button was selected
6 if Retry button was selected
7 if Yes button was selected
Related functions
QuestionBox(), InputDialog()
101
102
9.8.20 InputDialog
Description
It shows on the screen a dialog box containing a text, a specified title, a string field that can be
changed, and some buttons to confirm or undo; a string field is a string that the user can change
at will using the keyboard.
Syntax
String InputDialog(String Text, String Title, String InitText)
Parameters
Text = the text in the window
Title = the title of the window
InitText = the text that it is first shown in the string field
Returned value
the string field if the user confirms the change, a null string if he doesn't
Related functions
MessageBox(), QuestionBox()
Example
User=InputDialog("User's name", "Personalized access", "default");
9.8.21 IntToHexStr
Description
Converts an integer value into hex format
Syntax
API
103
9.8.22 Logout
Description
Current user is logout from supervisor (UserName is set up None)
Syntax
Void Logout()
Parameters
(none)
Returned value
(none)
Related functions
GetUserName(),GetUserGroups()
Example
Logout();
Value
Acoustic message
IconAsterisk
104
IconExclamation
IconHand
IconQuestion
OK
(if type parameter take none of this value then it play a single tone)
Returned value:
(none)
Related functions:
Beep()
Example:
MessageBeep(5);
9.8.24 MessageBox
Description
It shows on the screen a window containing text and the specified title. It waits for confirmation
from the user.
Syntax
Void MessageBox(String Text, String Title)
Parameters
Text = the text in the window
Title = the title of the window
Returned value
Related functions
QuestionBox(), InputDialog()
Example
MessageBox("You can now switch off", "Shutdown sequence:");
API
105
9.8.25 Play
Description
Plays an audio file with WAV extension
It is an obolete function. Refer to PlaySound() function.
Syntax
Void Play(String AudioFileName)
Parameters
AudioFileName = filename of the audio file
Returned value
Related functions
PlaySound()
Example
Play("Z:\Audio\WAV\Alarm.wav");
9.8.26 PlaySound
Description
Plays an audio file with WAV or MP3 extension
Syntax
Void PlaySound(String AudioFileName,bool WaitMode,int RepeatCounter)
Parameters
AudioFileName = filename of the audio file
WaitMode= if true the function waits untill the sound plaing is terminated.
RepeatCounter= number of time that the sound will be repeated. If it is "0" then the sound will be
repeated continuously and can be terminated with the StopSound() function.
Returned value
Related functions
StopSound()
Example
Play("Z:\Audio\WAV\Alarm.wav",false,0);
9.8.27 PrintString
Description:
Prints string on the specified device
Syntax:
106
Parameters:
Msg = messagge to print
Dev = device to print on(LPT1, LPT2, etc)
AddLF = add LineFeed
Returned value:
true (on success)
false (on failure)
Related functions:
-
Example:
PrintString (INIT Failed!,LPT1,True);
9.8.28 QuestionBox
Description
It shows on the screen a window containing text and the specified title. It waits for the user to
choose Yes or No.
Syntax
Bool QuestionBox(String Text, String Title)
Parameters
Text = the text in the window
Title = the title of the window
Returned value
true if the user chooses Yes
false if the user chooses No
Related functions
MessageBox(), InputDialog()
Example
Bool Engines = QuestionBox("Do I turn on the engines?","Engines
status");
API
107
9.8.29 RealToInt
Description
Converts a real value into an integer (discarding decimals)
Syntax
int RealToInt(Real Value)
Parameters
Value = integer value
Returned value
integer that is real value truncated
Related functions
Example
Temp=RealToInt(T0);
9.8.30 ShellExec
Description
The ShellExec function performs an action on a file. The file can be an executable file or a
document.
Syntax
Int ExecEx(String FileName,String Verb,String WorkDir,int
ShowMode,String Class,String Args)
Parameters
FileName = specify the name of the file to open or print. The function can open an executable file
or a document file. The function can print a document file. If the path is not included
with a name, the current directory is assumed.
Verb = specifies an action for the application to perform. This member defaults to "Open" if no
verb is specified.
WorkDir = specifies the name of the working directory. If this member is not specified, the current
directory is used as the working directory.
ShowMode = can be one of the values described below. If FileName specifies an executable file,
ShowMode specifies how the application is to be shown when it is opened. If
FileName specifies a document file, ShowMode should be zero.
0 = for document file.
1 = SW_SHOW.
2 = SW_SHOWMAXIMIZED.
3 = SW_SHOWMINIMIZED.
4 = SW_HIDE.
5 = SW_MINIMIZE.
108
9.8.31 Sleep
Description
It waits for a specified period of time expressed in milliseconds.
Syntax
Void Sleep(int MilliSeconds)
Parameters
Milliseconds = duration of the pause in milliseconds
Returned value
Related functions
Example
Sleep(1000);
9.8.32 StopFunction
Description:
Stops a running function
Syntax:
Int StopFunction (String FunctionName)
Parameters:
FunctionName = name of the function
Returned value:
0
on success
API
-1
unknown function
-2
109
Related functions:
Example:
int res;
res=StopFunction("Reader");
...
...
Function void Reader()
...
end
9.8.33 StopSound
Description
Stops plaing a sound started with PlaySound function
Syntax
Void StopSound()
Parameters
Returned value
Related functions
PlaySound()
Example
StopSound();
9.8.34 WindowIsOpen
Description
It returns the status of the window from which the function is called.
Syntax
Bool WindowIsOpen()
Parameters
Returned value
true if the window (e.g. a template), from which the function has been called up, is still open.
false if not.
110
Related functions
CloseWindow()
Example
StatoFinestraMadre=WindowIsOpen();
9.9
Internet
9.9.1
SendMail
Description
Sends an e-mail with an optional attachment files.
Works on a internet connection already active.
Syntax
string SendMail(
integer Timeout,
string AHostSMTPServer,
string AUserName,
string APassword,
string AFrom,
string ATo,
string ACC,
string ASubject,
string ABody,
bool AAttachmentPresent,
string AAttachment)
Parameters
Timeout = timeout for complete the operation (ms).
AHostSMTPServer : Host SMTP server
AUserName: user account for the SMTP server.
AUserPassword:password used for SMTP account authentication.
AFrom : source mail address .
ATo: destination mail address.
ACC: destination carbon copy recipients.
ASubject: mail subject.
ABody: mail body.
AAttachmentPresent: if true then send with attachment.
AAttachment:full path file name of the attachment.
Returned value
If no errors then an empty string is returned else the error message description is returned.
Example
Function void SendMailDemo()
//**********************************************************************
*******
// Send Mail demo procedure
//**********************************************************************
*******
API
111
string Ritorno;
bool AttachmentPresent;
if (GetDigGateValue("AttachmentPresent",0)==1) then
AttachmentPresent=true;
else
AttachmentPresent=false;
end
Ritorno=SendMail(GetNumGateValue("MailTimeout",0),
GetStrGateValue("HostSMTPServer",0),
GetStrGateValue("UserName",0),
GetStrGateValue("UserPassword",0),
GetStrGateValue("AddressFrom",0),
GetStrGateValue("AddressTo",0),
GetStrGateValue("AddressCC",0),
GetStrGateValue("MailSubject",0),
GetStrGateValue("MailBody",0),
AttachmentPresent,
GetStrGateValue("MailAttachment",0));
if Ritorno=="" then
MessageBox("Operation completed","Send Mail");
else
MessageBox(Ritorno,"Send Mail");
end
end
9.9.2
FTP
9.9.2.1
FTPConnect
Description
Open an FTP connection to a remote FTP server.
Syntax
integer FTPConnect(integer FTPPort,
string AHostFTPServer,
string AUserName,
string APassword,
bool
APassive,
integer Timeout)
Parameters
FTPPort: port number used for the FTP control channel
AHostFTPServer : Host FTP server
AUserName: user account for the FTP server.
AUserPassword:password used for FTP account authentication.
APassive: FTP data connection method: if "True" then uses Passive mode else if "False" then
uses active mode.
Timeout = timeout for complete the operation (ms).
Returned value
112
9.9.2.2
FTPDisconnect
Description
Close an FTP connection to a remote FTP server.
Syntax
Bool FTPDisconnect(integer Handle)
Parameters
Handle: Handle of the connection to close.
Returned value
True:if operation is completed successfully.
API
113
9.9.2.3
FTPGet
Description
Retrieves a file using FTP protocol from a remote FTP server.
Syntax
Bool FTPGet(integer Handle,
string SourceFileName,
string DestinationFileName,
integer TransferType)
Parameters
Handle: Handle of the already opened FTP connection.
SourceFileName: source file name (with full path optional).
DestinationFileName: destination file name (with full path optional).
TransferType : if 0 then file transfer in Binary mode else if 1 then file transfer in ASCII mode.
Returned value
True:if operation is completed successfully.
False:if there is an error.
Related functions
114
Example
Function void Get(int Connection)
//**********************************************************************
*******
// FTP Get
//**********************************************************************
*******
#modal
bool Ritorno;
Ritorno=FTPGet(Connection,GetStrGateValue("SourcePathFile",0),
GetStrGateValue("DestPathFile",0),
GetNumGateValue("TransferType",0));
if (Ritorno==false) then
MessageBox("Generic error","Error");
else
MessageBox("Operation completed successfully","Put file");
end
end
9.9.2.4
FTPPut
Description
Uploads a file using FTP protocol to a remote FTP server.
Syntax
Bool FTPPut(integer Handle,
string SourceFileName,
string DestinationFileName,
integer TransferType)
Parameters
Handle: Handle of the already opened FTP connection.
SourceFileName: source file name (with full path optional).
DestinationFileName: destination file name (with full path optional).
TransferType : if 0 then file transfer in Binary mode else if 1 then file transfer in ASCII mode.
Returned value
True:if operation is completed successfully.
False:if there is an error.
Related functions
FTPGet()
Example
API
115
9.10
Math
9.10.1 Abs
Description
it returns the absolute value of a real number
Syntax
Real Abs(Real Value)
Parameters
Value = number to process
Returned value
absolute value of the number
Related functions
Example
PosValue=Abs(NegValue);
9.10.2 ArcCos
Description
it returns inverse cosinus of a real value (value must be between -1 and 1)
Syntax
Real ArcCos(Real Value)
Parameters
Value = value to process
Returned value
116
9.10.3 ArcSin
Description
it returns inverse sinus of a real value (value must be between -1 and 1)
Syntax
Real ArcSin(Real Value)
Parameters
Value = value to process
Returned value
inverse sinus of the value
Related functions
ArcCos(), Sin()
Example
newval=ArcSin(value);
9.10.4 ArcTan
Description
it returns inverse tangent of a real value
Syntax
Real ArcTan(Real Value)
Parameters
Value = value to process
Returned value
inverse tangent of the value
Related functions
Tan()
Example
Theta=ArcTan(Y/X);
API
9.10.5 Cos
Description
it returns cosinus of a real value (angle in radians)
Syntax
Real Cos(Real Value)
Parameters
Value = value to process
Returned value
cosinus of the value
Related functions
Sin(), ArcCos()
Example
SinTheta=Sin(Theta);
9.10.6 Exp
Description
it returns exponential value of a real number (e^x)
Syntax
Real Exp(Real Value)
Parameters
Value = value to process
Returned value
exponential value
Related functions
Log()
Example
Delta=Exp(2.758);
9.10.7 Log
Description
it returns logarithm of a real value
Syntax
Real Log(Real Value)
Parameters
Value = value to process
Returned value
logarithm of the value
117
118
Related functions
Exp()
Example
SimilZero=Log(1.00001);
9.10.8 Mod
Description
it returns the division modulus of two integers
Syntax
Int Mod(int A, int B)
Parameters
A = dividend
B = divisor
Returned value
modulus of division
Related functions
Example
Resto=Mod(44,6);
9.10.9 Pow
Description
raising to power (x^n)
Syntax
Real Pow(Real Base, Real Exponent)
Parameters
Base = base to be raised
Exponent = exponent of the number
Returned value
number raised to power specified
Related functions
Sqrt()
Example
PowerOfTwo=Pow(2,8);
API
9.10.10 Rand
Description
it returns a random value generated from specified range
Syntax
Int Rand(Int Range)
Parameters
Range = max value generated
Returned value
random value between 0 and (Range-1)
Related functions
Example
LottoNo=Rand(90)+1;
9.10.11 Round
Description
it rounds up a value to a specified decimal
Syntax
Real Round(Real Value, Int Decimals)
Parameters
Value = value to be rounded
Decimals = decimal for operation
Returned value
rounded value
Related functions
Example
LastValue=Round(Sampled,3);
9.10.12 Sin
Description
it returns sinus of a real value (angle in radians)
Syntax
Real Sin(Real Value)
Parameters
Value = value to process
Returned value
sinus of the value
119
120
9.10.13 Sqrt
Description
it returns square root of a real value
Syntax
Real Sqrt(Real Value)
Parameters
Value = value to process
Returned value
square root of the value
Related functions
Pow()
Example
Val=Sqrt(A*B);
9.10.14 Tan
Description
it returns tangent of a real value (angles are in radians)
Syntax
Real Tan(Real Value)
Parameters
Value = value to process
Returned value
tangent of the value
Related functions
ArcTan()
Example
TanAlfa=Tan(Beta-Gamma);
API
9.11
Modem
9.11.1 ModemAvailable
Description
It checks if a GSM Modem is available on the serial port
Syntax
int ModemAvailable(int SerialPortNumber)
Parameters
SerialPortNumber = it is the number of the serial port
1 - means serial port COM1
2 - means serial port COM2
x - generic serial port COMx
Returned value
result:
0
GSM modem replies and it is ready
1
(internal) it is not possible to create listening thread
2
(internal) it is not possible to allocate memory for buffers
-1
serial port can not be opened
-2
serial port is already opened
-3
modem replies ERROR (may be this is not a GSM modem)
-4
modem's reply is not a standard reply (it is not OK or ERROR)
-5
modem does not reply
Related functions
ModemSetPIN() , ModemSetServicesCenter() , ModemSetTextMode() , ModemSendSMS()
Example
if (ModemAvailable(2) !=0) then
MessageBox("Modem on the COM2 is ready","MODEM");
end
9.11.2 ModemDial
Description
It calls a remote device through telephone line (you need a modem installed)
Syntax
Int ModemDial(int Channel, String Number, int TimeOut)
Parameters
Channel = the number of the communication channel (this channel must have
a remote protocol selected)
Number = the telephone number to dial
TimeOut = number of seconds to wait for connecting
Returned value
result:
0
Connected
-1
Init Failed (initialization failed)
-2
Dial failed (it cannot dial a number)
121
122
Related functions
ModemHangup()
Example
int res;
res=ModemDial(1,"800600600",30);
9.11.3 ModemHangup
Description
It closes the current remote connection
Syntax
void ModemHangup()
Parameters
Returned value
Related functions
ModemDial()
Example
ModemHangup();
9.11.4 ModemSendSMS
Description
Send a short text message to a SMS compliant receiver, a mobile phone for example
Syntax
int ModemSendSMS(int SerialPortNumber, string Number, string Message)
Parameters
SerialPortNumber =
API
-3
-4
-5
-6
-11
-12
123
Related functions
ModemAvailable() , ModemSetPIN() , ModemSetServicesCenter() , ModemSetTextMode()
Example
string message;
message = "ALARM: high temp" + GetNumGateValue("temp",11)+ " C";
ModemSendSMS(1, "+393491212121", message);
9.11.5 ModemSetPIN
Description
Set the PIN to use the SIM card inserted in the GSM modem
Syntax
int ModemSetPIN(int SerialPortNumber, string PIN)
Parameters
SerialPortNumber =
124
9.11.6 ModemSetServicesCenter
Description
It is necessary to set the center of services number in order to send SMS
Syntax
int ModemSetServicesCenter(int SerialPortNumber, string
ServicesCenterNumber)
Parameters
SerialPortNumber =
9.11.7 ModemSetTextMode
Description
Sometimes it is necessary to set the format of the SMS; this function set a text format for short
messages
Syntax
int ModemSetTextMode(int SerialPortNumber)
Parameters
SerialPortNumber = it is the number of the serial port
1 - means serial port COM1
2 - means serial port COM2
x - generic serial port COMx
Returned value
result:
API
0
1
2
-1
-2
-3
-4
-5
Related functions
ModemAvailable() , ModemSetPIN() , ModemSetServicesCenter() , ModemSendSMS()
Example
ModemSetPIN(2,"4488");
ModemSetServicesNumber(2,"+393492000300");
ModemSetTextMode(2);
9.12
Recipes
9.12.1 RecipeCreate
Description
It creates a recipe according to the defined model and parameters.
Syntax
Bool RecipeCreate(String Model, String Recipe, Bool ErrorMsg)
Parameters
Model = recipe model (existing)
Recipe = name of the recipe you want to create
ErrMsg = true if you want to display a message error
Returned value
true (if the operation has been successful)
false (if not)
Related functions
RecipeImport(), RecipeExecute()
Example
RecipeIsReady=RecipeCreate("Recipes", "Week 32", false);
9.12.2 RecipeExecute
Description
It sends the values concerning the specified recipe to the various devices.
Syntax
Bool RecipeExecute(String Model, String Recipe, Bool CompletionMsg)
Parameters
125
126
9.12.3 RecipeImport
Description
It saves the values concerning the model in the specified recipe.
Syntax
Bool RecipeImport(String Model, String Recipe, Bool CompletionMsg)
Parameters
Model = model whose values you want to read (existing)
Recipe = recipe you want to import the values to (existing)
ErrMsg = true if you want to display a message error
Returned value
true (if the operation has been successful)
false (if not)
Related functions
RecipeCreate(), RecipeExecute()
Example
RecipeImport (CurrModel,CurrValues, false);
9.13
Report
9.13.1 ReportAppendRecord
Description
This command is used for DAT report configured to "Save record on command". When this
command is executed,a new record will be appended to the present report file;if the file doesn't
exist,it will be created.
If the report is configured to be saved in the default report directory, ReportCreate() function can
be used to automatically create a new file.In this case the previous report file will be renamed from
(ReportName).001 to (ReportName).002 and a new file will be created with the name
(ReportName).001.
Syntax
API
ReportAppendRecord(String Name)
Parameters
Name = name of the report type (existing)
Returned value
-
Related functions
ReportCreate()
Example
ReportAppendRecord("ReportName");
9.13.2 ReportCreate
Description
It draws up a Report file.
Syntax
Bool ReportCreate(String Name)
Parameters
Name = name of the report type (existing)
Returned value
true (if the operation has been successful)
false (if not)
Related functions
ReportDisplay(), ReportPrint() , ReportSetFullPathFileName()
Example
FileCreatedFlag= ReportCreate("CurrentSystemStatus");
9.13.3 ReportDisplay
Description
It displays the last created Report file.
Syntax
Bool ReportDisplay(String Name)
Parameters
Name = name of the report file
Returned value
127
128
9.13.4 ReportGetPeriodType
Description:
Returns an integer indicating the report creation frequency
Syntax:
Int ReportGetPeriodType(String ReportName)
Parameters:
ReportName = name of the report file
Returned value:
0
Related functions:
ReportSetPeriodNone(),
ReportSetPeriodTime(),
ReportSetPeriodDayOfWeek(),
ReportSetPeriodDayOfMonth(),
ReportSetPeriodDayAndMonth()
Example:
GroupAReportTime = ReportGetPeriodTime(GroupAReportFileName);
9.13.5 ReportInsertText
Description
It insert text into a report during its creation.
This function must be used only inside a report.
Syntax
void ReportInsertText(String text)
API
129
Parameters
text = text that will be inserted into report
Returned value
Related functions
ReportInsertTemplate()
Example
ReportInsertText, ReportInsertTemplate example
Note: Restrictions
9.13.6 ReportInsertTemplate
Description
It insert template image into a report during its creation.
(Obsolete function - now replaced from ReportinsertTemplateEx)
This function must be used only inside a report.
Syntax
void ReportInsertTemplate(String text)
Parameters
text = template name which image will be inserted into report
Returned value
Related functions
ReportInsertText(),ReportInsertTemplateEx()
Example
ReportInsertText, ReportInsertTemplate example
Note: Template images are quite large, an image of a 1024x768 template is about 2.5Mbytes.
Restrictions
9.13.7 ReportInsertTemplateEx
Description
It insert template image into a report during its creation.
This function must be used only inside a report.
Syntax
130
Note: Template images are quite large, an image of a 1024x768 template is about 2.5Mbytes.
Restrictions
9.13.8 ReportInsertHistoricalAlarmsRTF
Description
This function automatically insert an historical alarms / events list in a "RTF" report.
Syntax
ReportInsertHistoricalAlarmsRTF(
int sDay,
int sMonth,
int sYear,
int sHour,
int sMin,
int sSec,
int eDay,
int eMonth,
int eYear,
int eHour,
int eMin,
int eSec,
int ListType,
bool ShowDescription,
string ColumnName1,
string ColumnName2,
string ColumnName3,
string ColumnName4,
string ColumnName5,
string ColumnName6,
string ColumnName7,
string ColumnName8,
string ColumnName9,
string ColumnName10,
string ColumnName11,
string ColumnName12,
string ColumnName13,
int FilterClass1,
API
string
string
string
string
string
string
131
FilterClass2,
FilterClass3,
FilterClass4,
FilterClass5,
FilterClass6,
FilterClass7)
PARAMETERS
sDay = start day
sMonth = start month
sYear = start year
sHour = start hour
sMin = start minutes
sSec = start seconds
eDay = end day
eMonth = end month
eYear = end year
eHour = end hour
eMin = end minutes
eSec = end seconds
DESCRIPTION
Start date / Time from which start to insert in the
report the historical alarms / events
ListType
0: show alarms
1: show events
2: show both alarms and events
True : show header description of each
configured column
False: don't show header description
There are at maximum 13 columns.
The type of data to show in each column is
specified by column
name identifier and can be one of the following
name:
"MESSAGE" : show the message of
alarm/event
"START_DATE": show start date of alarm/event
"START_TIME": show start time of alarm/event
"END_DATE": show end date of alarm/event
"END_TIME": show end time of alarm/event
"DURATION": show duration of alarm/event
"CLASS1": show class1
"CLASS2": show class2
"CLASS3": show class3
"CLASS4": show class4
"CLASS5": show class5
"CLASS6": show class6
"CLASS7": show class7
All the columns specified in ColumnName1..13
must be also specified in
ProjectManager->Configuration->Template->His
toricalAlarms or HistoricalEvents.
A NULL string ("") must be specified if the
relative column must not be displayed.
With these parameters is possible to specify a
ShowDescription
ColumName1
ColumName2
ColumName3
ColumName4
ColumName5
ColumName6
ColumName7
ColumName8
ColumName9
ColumName10
ColumName11
ColumName12
ColumName13
FilterClass1
132
Returned value
None.
Remarks
How to set columns width?
Each column is separated by a TAB char, so in the source report file must be set the tabulator of
each columns.
For example with Microsoft WordPad, tabulator can be set by selecting Format->Tabulator Menu
Item.
Example
ReportInsertHistoricalAlarmsRTF(
10,11,2005,0,0,0,
10,11,2005,23,59,59,
0,
true,
"MESSAGE",
"START_DATE",
"START_TIME",
"END_DATE",
"END_TIME",
"DURATION",
"CLASS1",
"CLASS2",
"CLASS5",
"",
"",
"",
"",
-1,
"",
"",
"",
"",
"",
"");
API
9.13.9 ReportInsertHistoricalAlarmsTXT
Description
This function automatically insert an historical alarms / events list in a "TXT" report.
Syntax
ReportInsertHistoricalAlarmsTXT(
int sDay,
int sMonth,
int sYear,
int sHour,
int sMin,
int sSec,
int eDay,
int eMonth,
int eYear,
int eHour,
int eMin,
int eSec,
int ListType,
bool ShowDescription,
string ColumnName1,
int ColumnWidth1,
string ColumnName2,
int ColumnWidth2,
string ColumnName3,
int ColumnWidth3,
string ColumnName4,
int ColumnWidth4,
string ColumnName5,
int ColumnWidth5,
string ColumnName6,
int ColumnWidth6,
string ColumnName7,
int ColumnWidth7,
string ColumnName8,
int ColumnWidth8,
string ColumnName9,
int ColumnWidth9,
string ColumnName10,
int ColumnWidth10,
string ColumnName11,
int ColumnWidth11,
string ColumnName12,
int ColumnWidth12,
string ColumnName13,
int ColumnWidth13,
int FilterClass1,
string FilterClass2,
string FilterClass3,
string FilterClass4,
string FilterClass5,
string FilterClass6,
string FilterClass7)
133
134
PARAMETERS
sDay = start day
sMonth = start month
sYear = start year
sHour = start hour
sMin = start minutes
sSec = start seconds
eDay = end day
eMonth = end month
eYear = end year
eHour = end hour
eMin = end minutes
eSec = end seconds
ListType
ShowDescription
ColumName1,
ColumnWidth1,
ColumName2,
ColumnWidth2,
ColumName3,
ColumnWidth3,
ColumName4,
ColumnWidth4,
ColumName5,
ColumnWidth5,
ColumName6,
ColumnWidth6,
ColumName7,
ColumnWidth7,
ColumName8,
ColumnWidth8,
ColumName9,
ColumnWidth9,
ColumName10,
ColumnWidth10,
ColumName11,
ColumnWidth11,
ColumName12,.
ColumnWidth12,
ColumName13,
ColumnWidth13,
FilterClass1
FilterClass2
FilterClass3
FilterClass4
FilterClass5
DESCRIPTION
Start date / Time from which start to insert in the
report the historical alarms / events
0: show alarms
1: show events
2: show both alarms and events
True : show header description of each
configured column
False: don't show header description
There are at maximum 13 columns.
The type of data to show in each column is
specified by column
name identifier and can be one of the following
name:
"MESSAGE" : show the message of
alarm/event
"START_DATE": show start date of alarm/event
"START_TIME": show start time of alarm/event
"END_DATE": show end date of alarm/event
"END_TIME": show end time of alarm/event
"DURATION": show duration of alarm/event
"CLASS1": show class1
"CLASS2": show class2
"CLASS3": show class3
"CLASS4": show class4
"CLASS5": show class5
"CLASS6": show class6
"CLASS7": show class7
All the columns specified in ColumnName1..13
must be also specified in
ProjectManager->Configuration->Template->His
toricalAlarms or
HistoricalEvents
A NULL string ("") must be specified if the
relative column must not be
displayed
Column Width identifier specify the maximum
number of chars for each column.
With these parameters is possible to specify a
view filter
for alarms/event in the report.
FilterClass1 is a number while FilterClass2 to
FilterClass7 are string of char.
API
FilterClass6
FilterClass7
135
Returned value
None.
Example
ReportInsertHistoricalAlarmsTXT(
10,11,2005,0,0,0,
10,11,2005,23,59,59,
0,
true,
"MESSAGE",30
"START_DATE",13
"START_TIME",13
"END_DATE",13
"END_TIME",13
"DURATION",15
"CLASS1",3
"CLASS2",10
"CLASS5",10
"",
"",
"",
"",
-1,
"",
"",
"",
"",
"",
"");
9.13.10 ReportLotTime
Description:
Returns a string with the following format:
DD/MM/YYYY - HH:MN:SS
Syntax:
String ReportLotTime (Int GG, Int MM, Int AAAA, Int HH, Int MN, Int SS)
Parameters:
GG = day
MM = month
AAAA = year
136
0, 0,
9.13.11 ReportPrint
Description
It prints out the last created Report file.
Syntax
Bool ReportPrint(String Name, Bool ViewPrintDlg)
Parameters
Name = name of the report file
ViewPrintDlg = true (it displays the printer preferences before printing)
false (it doesn't)
Returned value
true (if the operation has been successful)
false (if not)
Related functions
ReportCreate(), ReportDisplay()
Example
FileSuccesfullyPrinted= ReportPrint("SystemStatus");
9.13.12 ReportSetFullPathFileName
Description
Specify the file name (with absolute full path) that must be associated with the next report that will
be ceated.
This instruction is usually followed by ReportCreate()
Syntax
API
137
9.13.13 ReportSetPeriodDayOfWeek
Description:
Specifies the day of the week when report has to be created.
Syntax:
Bool ReportSetPeriodDayOfWeek (String ReportName,Int Day,Int syncHour,
Int syncMin,Int syncSec)
Parameters:
ReportName = name of the report file
138
Related fuctions:
ReportGetPeriodType(),
ReportSetPeriodNone(),
ReportSetPeriodTime(),
ReportSetPeriodDayOfMonth(),
ReportSetPeriodDayAndMonth()
Example:
ReportSetPeriodDayOfWeek(RepName,2,9,0,0); // tue by 9.00
9.13.14 ReportSetPeriodDayOfMonth
Description:
Specifies the day of the month when report has to be created.
Syntax:
Bool ReportSetPeriodDayOfMonth (String ReportNameInt Day,Int syncHour,
Int syncMin, Int syncSec)
Parameters:
ReportName = name of the report file
Day = day of month
syncHour, syncMin, syncSec = start time
Returned value:
true (on success)
false (when file doesn't exist or specified time parameters are wrong)
Related functions:
ReportGetPeriodType(),
ReportSetPeriodNone(),
ReportSetPeriodTime(),
API
139
ReportSetPeriodDayOfWeek(),
ReportSetPeriodDayAndMonth()
Example:
ReportSetPeriodDayOfMonth(RepName,24,9,0,0); // 24th by 9
9.13.15 ReportSetPeriodDayAndMonth
Description:
Specifies the day and month when report has to be created.
Syntax:
Bool ReportSetPeriodDayAndMonth (String ReportName, Int Day, int Month
Int syncHour, Int syncMin, Int
syncSec)
Parameters:
ReportName = name of the report file
Day = day
Month = month
syncHour, syncMin, syncSec = start time
Returned value:
true (on success)
false (when file doesn't exist or specified time parameters are wrong)
Related functions:
ReportGetPeriodType(),
ReportSetPeriodNone(),
ReportSetPeriodTime(),
ReportSetPeriodDayOfWeek(),
ReportSetPeriodDayOfMonth()
Example:
ReportSetPeriodDayOfMonth(RepName,24,1,9,0,0); // Jan
24th by 9.00
140
9.13.16 ReportSetPeriodNone
Description:
Specifies that the report must not be created
Syntax:
Bool ReportSetPeriodNone (String ReportName)
Parameters:
ReportName = name of the report file
Returned value:
true (on success)
false (on failure, may be that report doesn't exist )
Related functions:
ReportGetPeriodType(),
ReportSetPeriodTime(),
ReportSetPeriodDayOfWeek(),
ReportSetPeriodDayOfMonth(),
ReportSetPeriodDayAndMonth()
Example:
ReportSetPeriodNone(GroupAReportFileName);
9.13.17 ReportSetPeriodTime
Description:
Sets the report creation interval time
Syntax:
Bool ReportSetPeriodTime (String ReportName,Int OraPeriodo, Int
MinPeriodo,
Int SecPeriodo,Int OraSincron, Int
MinSincron,
Int SecSincron)
Parameters:
ReportName = name of the report file
API
OraPeriodo, MinPeriodo, SecPeriodo = interval between reports
OraSincron, MinSincron, SecSincron = start time
Returned value:
true (on success)
false (when file doesn't exist or specified time parameters are wrong)
Related functions:
ReportGetPeriodType(),
ReportSetPeriodNone(),
ReportSetPeriodDayOfWeek(),
ReportSetPeriodDayOfMonth(),
ReportSetPeriodDayAndMonth()
Example:
ReportSetPeriodTime(RepName,1,0,0,9,0,0); // every hours by 9.00
9.13.18 ReportShowCreationList
Description
Shows the list of the historical reports to be created
Syntax
Void ReportShowCreationList()
Parameters
Returned value
Related functions
ReportShowHistList()
Example
ReportShowCreationList();
9.13.19 ReportShowHistList
Description
Shows the historical reports list.
Syntax
Void ReportShowHistList()
141
142
Parameters
Returned value
Related functions
ReportShowHistList()
Example
ReportShowHistList();
9.13.20 ReportInsertText, ReportInsertTemplate example
For example we have to create a daily report containing alarms found during a day.
Alarms will be listed in a text file which line will rappresent date and time of the event.
ALARMS.TXT:
....
1/2/2001 09:16:58
1/2/2001 09:19:26
1/2/2001 09:21:39
1/2/2001 09:21:59
1/2/2001 09:22:19
1/2/2001 09:22:40
1/2/2001 09:23:00
....
This file describe how report will be.
ALARMS.RTF:
ALARMS FOUND:
{InsertAlarms()}
This is the function called inside the report:
ALARM.WLL:
Function void InsertAlarms()
string line;
int hh; int mn; int ss; int yy; int mm; int dd;
int h1; int m1; int s1; int h2; int m2; int s2;
int a;
int i=0;
int h=FileOpen("E:\ALARMS:TXT","rt");
While (FileEOF(h) == 0)
line=FileReadLn(h);
i=i+1;
if (FileEOF(h) == 0) then
ReportInsertText("Alarms at: "+line+Eol());
// convert date and time from text to numerical values
a=StrPos(line,"/"); dd=StrToInt(StrSubString(line,1,a-1));
line=StrDelete(line,1,a);
API
143
a=StrPos(line,"/"); mm=StrToInt(StrSubString(line,1,a-1));
line=StrDelete(line,1,a);
a=StrPos(line," "); yy=StrToInt(StrSubString(line,1,a-1));
line=StrDelete(line,1,a);
a=StrPos(line,":"); hh=StrToInt(StrSubString(line,1,a-1));
line=StrDelete(line,1,a);
a=StrPos(line,":"); mn=StrToInt(StrSubString(line,1,a-1));
line=StrDelete(line,1,a);
// making a time range starting 30" before and ending 30" after
ss=StrToInt(line);
s1=ss-30; m1=mn; h1=hh;
if (s1<0) then
s1=60+s1; m1=m1-1;
if (m1==-1) then
m1=59; h1=h1-1;
if (h1<0) then
h1=23;
end
end
end
s2=s1;
m2=m1+1;
h2=h1;
if (m2==60) then
m2=0; h2=h2+1;
if (h2==24) then
h2=0;
end
end
ChartSetTimeRange(dd,mm,yy,h1,m1,s1,dd,mm,yy,h2,m2,s2); //da -30" a +30"
// insert chart that show the problem found
ReportInsertTemplate("AlarmChart");
// template previously inserted AlarmChart
// contains only one chart object that show the gates where problems were found
ReportInsertText(Eol()+Eol()+Eol()+Eol());
end
end
FileClose(h);
end
144
9.14
String
9.14.1 CharToStr
Description
it makes a string of only one char
Syntax
String CharToStr(Int
ASCIICode)
Parameters
AsciiCode= ASCII code of desired char
Returned value
string with the char
Related functions
API
Eol(), StrToReal(), StrToInt(), IntToStr(), RealToStr(), StrToChar()
Example
FGender=CharToStr(70);
9.14.2 Eol
Description
it returns the EndOfLine string
Syntax
String Eol()
Parameters
Returned value
string of one char (EOL char)
Related functions
CharToStr()
Example
Line = "first line!" + Eol() + "second line!";
9.14.3 IntToStr
Description
Converts an integer value into its string representation
Syntax
String IntToStr(Int Value)
Parameters
Value = integer to conver
Returned value
string representation of the integer
Related functions
StrToInt(), StrToReal(), RealToStr(), ChatToStr()
Example
My=IntToStr(1975);
9.14.4 RealToStr
Description
Converts a real value into its string representation
Syntax
String RealToStr(Real Value)
Parameters
145
146
9.14.5 StrCase
Description
Converts a string to lower case or upper case.
Syntax
String StrCase(String S, Bool UpperCased)
Parameters
S = string to process
UpperCased = true (convert to uppercase)
false (convert to lowercase)
Returned value
The converted string
Related functions
Example
LowCase=StrCase("VaLUe",false); // LowCase= "value"
9.14.6 StrConcat
Description
Concatenates two strings.
Syntax
String StrConcat(String S1, String S2)
Parameters
S1 = first string
S2 = second string
Returned value
The string result of the concatenation of the two strings.
Related functions
StrDelete()
Example
API
text = StrConcat ("Name","Spock");
// text = "NameSpock"
9.14.7 StrDelete
Description
Deletes a part (substring) of a string.
Syntax
String StrDelete(String S, Int Start, Int Len)
Parameters
S = string to process
Start = starting position of the substring to delete
Len = length of substring
Returned value
The string without the specified substring.
Related functions
StrSubString(), StrPos()
Example
Res=StrDelete("it is not raining",7,4); // Res = "it is raining"
9.14.8 StrLen
Description
it returns the length of a string
Syntax
Int StrLen(String Value)
Parameters
Value = string to process
Returned value
the length of the string
Related functions
Example
NameLen = StrLen(Name);
9.14.9 StrOfChar
Description
Builds a string composed of the same char repeated.
Syntax
String StrOfChar(Int Chr, int Len)
Parameters
147
148
// = "BBBBBBBBBB"
9.14.10 StrPos
Description
Searches for a substring in a string.
Syntax
Int StrPos(String S, String SubStr)
Parameters
S = string to search in
SubStr = substring to search
Returned value
position of the substring (if found), otherwise 0
Related functions
StrDelete(), StrSubString()
Example
At=StrPos("it is not raining","not"); // At = 7
9.14.11 StrSubString
Description
Extracts a substring from a string.
Syntax
String StrSubString(String S, Int Start, Int Len)
Parameters
S = string to process
Start = starting position of the substring to extract
Len = length of the substring
Returned value
The substring specified by parameters.
Related functions
StrDelete(),StrPos()
Example
Res=StrSubString("it is not raining",7,4); // Res = "not "
API
9.14.12 StrToChar
Description
Returns a char contained in a string, specified by its position.
Syntax
Char StrToChar (String Str, Int Pos)
Parameters
Str = string to process
Pos = position of desired char (1 is the first char)
Returned value
The char of the string at the given position
Related functions
Eol(), StrToReal(), StrToInt(), IntToStr(), RealToStr(), CharToStr()
Example
Letter = StrToChar(InputField, i);
9.14.13 StrToInt
Description
it converts an integer value within a string to integer
Syntax
Int StrToInt(String Value)
Parameters
Value = string that contains number
Valore resituito
integer value
Related functions
StrToReal(), IntToStr(), RealToStr(), CharToStr()
Example
Thickness = StrToInt(InputDialog("Thickness", "Line","10"));
9.14.14 StrToReal
Description
it converts real value within a string to real format
Syntax
Real StrToReal(String Value)
Parameters
Value = string that contains value
Returned value
value converted to real
149
150
9.15
Template
9.15.1 TPageClose
Description
It closes the specified template page.
Syntax
void TPageClose(Integer Page)
Parameters
Page = number of page to close
Returned value
Related functions
Example
int genPage;
...
enPage = TPageOpen("Genesis");
MessageBox("Click to close","Genesis page");
TPageClose(genPage);
9.15.2 TPageOpen
Description
It opens a template page giving a specific name to it.
Syntax
int TPageOpen(String Name)
Parameters
Name = name to give to the page
Returned value
page number >1 (on success)
0 (on failure)
Related functions
Example
int mainPage;
mainPage=TPageOpen("Genoma Project");
API
151
9.15.3 TPagePrint
Description
Prints the template page that call this function
Syntax
Bool TPagePrint(Bool ViewPrintDlg)
Parameters
ViewPrintDlg = if true shows the print dialog before printing
Returned value
true (on success)
false (on failure)
Related functions
Example
if (TPagePrint(true)) then
MessageBox("Printed","RESULT");
else
MessageBox("Print failed","RESULT");
end
9.15.4 TemplateAlarmsStatus
Description
Open the alarms status template.
Syntax
void TemplateAlarmsStatus()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword()
Example
TemplateAlarmsStatus();
9.15.5 TemplateChart
Description
Open the chart template.
Syntax
152
9.15.6 TemplateDefineGroupNames
Description
It opens the define groups name dialog.
Syntax
void TemplateDefineGroupNames()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword(),
TemplateDefineGroupNames()
Example
TemplateDefineGroupNames();
9.15.7 TemplateDefinePagesAccess
Description
It opens the define pages access dialog.
Syntax
void TemplateDefinePagesAccess()
Parameters
Returned value
-
API
153
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword(),
TemplateDefineGroupNames()
Example
TemplateDefinePagesAccess();
9.15.8 TemplateDefineUsers
Description
It open the define user dialog.
Syntax
void TemplateDefineUsers()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword()
Example
TemplateDefineUsers();
9.15.9 TemplateDevicesStatus
Description
Open the devices status template.
Syntax
void TemplateDevicesStatus()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword()
Example
154
9.15.10 TemplateEventsStatus
Description
Open the events status template.
Syntax
void TemplateEventsStatus()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword()
Example
TemplateEventsStatus();
9.15.11 TemplateGatesStatus
Description
Open the gates status template.
Syntax
void TemplateGatesStatus()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword()
Example
TemplateGatesStatus();
9.15.12 TemplateHistAlarms
Description
Open the history of the alarms template.
Syntax
API
155
void TemplateHistAlarms()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword()
Example
TemplateHistAlarms();
9.15.13 TemplateHistEvents
Description
Open the history of the events template.
Syntax
void TemplateHistEvents()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword()
Example
TemplateHistEvents();
9.15.14 TemplateMakeReport
Description
Open the report generation template.
Syntax
void TemplateMakeReport()
Parameters
Returned value
Related functions
156
9.15.15 TemplateMultilanguage
Description
Open the multi language template.
Syntax
void TemplateMultilanguage()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword()
Example
TemplateMultilanguage();
9.15.16 TemplatePassword
Description
It open the password dialog.
Syntax
void TemplatePassword()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword()
Example
TemplatePassword();
API
157
9.15.17 TemplatePrinterSetup
Description
Open the printer setup template.
Syntax
void TemplatePrinterSetup()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword()
Example
TemplatePrinterSetup();
9.15.18 TemplateRecipe
Description
Open the recipe manager template.
Syntax
void TemplateRecipe()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword()
Example
TemplateRecipe();
9.15.19 TemplateSystemStatus
Description
Open the system status template.
Syntax
void TemplateSystemStatus()
158
9.15.20 TemplateUserChanges
Description
Open the user's operations template.
Syntax
void TemplateUserChanges()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
, TemplateGatesStatus() , TemplateAlarmsStatus() , TemplateEventsStatus() ,
TemplateHistAlarms() , TemplateHistEvents() , TemplateUserChanges() , TemplateChart() ,
TemplateMultilanguage() , TemplateMakeReport() , TemplateViewReport() , TemplatePassword()
Example
TemplateUserChanges();
9.15.21 TemplateViewReport
Description
Open the report manager template.
Syntax
void TemplateViewReport()
Parameters
Returned value
Related functions
TemplatePrinterSetup() , TemplateRecipe() , TemplateSystemStatus() , TemplateDevicesStatus()
API
159
9.16
Template objects
9.16.1 Generic
9.16.1.1 TObjEndUpdate
Description
Terminates the modify session of the object and update it.
When you want to set some object properties trough TObjSetPropertyBool(),TObjSetPropertyInt(),
TObjSetPropertyReal(),TObjSetPropertyString(),TObjSetPropertyUnsigned() functions,it is
necessary to call before the
TObjBeginUpdate() function to initialize the modify section area of the object.
After setting all needed properties, it is necessary to call the TObjEndUpdate() to update the
object.
Syntax
Void TObjEndUpdate(Int Id)
Parameters
Id = identifier of the object. It is the number set in "ID" property object trough Template Builder.
Returned value
Related functions
TObjSetPropertyBool(),TObjSetPropertyInt(),TObjSetPropertyReal(),TObjSetPropertyString(),
TObjSetPropertyUnsigned(),TObjBeginUpdate()
Example
...
TObjBeginUpdate(100);
TObjSetPropertyReal(100,"ScaleMin",20);
TObjSetPropertyReal(100,"ScaleMax",80);
TObjEndUpdate(100);
...
9.16.1.2 TObjFunction
Description
Send a command to a specified object.
For example, for the Chart object there is the possibility to open some configuration windows (like
chart set or time range configuration) or to simulate the forward ,rewind , reset zoom button .
In this way you can use your own button, label, or bitmap objects to manipulate the Chart object.
Syntax
Void TObjFunction(Int Id,int Function)
Parameters
160
Example
...
TObjFunction(1,3);
...
9.16.1.3 TObjGetH
Description
It returns the height of the specified object.
Syntax
Int TObjGetH(Int Id)
Parameters
Id = identifier of the object
Returned value
Height of the object
Related functions
TObjGetW(), TObjSetSize()
Example
ObjHeight=TObjGetH(ObjID);
9.16.1.4 TObjGetPropertyInt
Description
Return an Integer property of the specified object.
Syntax
Int TObjGetPropertyInt(Int Id, string PropertyName)
Parameters
Id = object identifier. It is the number set in the "ID" property of the object (see Template Builder).
PropertyName = name of the property to read. Refer to the object help in the Template Builder to
know the list of properties that can be read trough this function.
Value = value to set.
Returned value
Numeric value of the property
Related functions
API
161
Example
...
int Index;
Index=TObjGetPropertyInt(100,"ItemSelected");
...
9.16.1.5 TObjGetStatus
Description
It returns the status of the specified object.
Syntax
Int TObjGetStatus(Int Id)
Parameters
Id = identifier of the object
Returned value
status of the object
Related functions
TObjSetStatus()
Example
CurrStatus=TObjGetStatus(CurrObject);
9.16.1.6 TObjGetText
Description
It returns the text of the specified object; of course this function is useless to the objects that don't
have a text (e.g.: BitMap).
Syntax
String TObjGetText(Int Id)
Parameters
Id = identifier of the object
Returned value
text of the object
Related functions
TObjSetText()
Example
Caption=TobjGetText(CurrObj);
162
9.16.1.7 TObjGetW
Description
It returns the width of the specified object.
Syntax
Int TObjGetW(Int Id)
Parameters
Id = identifier of the object
Returned value
Width of the object
Related functions
TObjGetH(), TObjSetSize()
Example
ObjWidth=TObjGetW(ObjID);
9.16.1.8 TObjGetX
Description
It returns the abscissa of the specified object through its identifier.
Syntax
Int TObjGetX(Int Id)
Parameters
Id = identifier of the object
Returned value
the abscissa of the specified object
Related functions
TObjSetXY(),TObjGetY()
Example
posX=TObjGetX(CurrObj);
9.16.1.9 TObjGetY
Description
It returns the ordinate of the specified object through its identifier.
Syntax
Int TObjGetY(Int Id)
Parameters
Id = identifier of the object
Returned value
API
163
164
Example
...
TObjBeginUpdate(100);
TObjSetPropertyBool(100,PropertyName,true);
TObjEndUpdate(100);
...
9.16.1.12 TObjSetPropertyInt
Description
Modify an Integer property of the specified object.
Syntax
Void TObjSetPropertyInt(Int Id, string PropertyName,Int Value)
Parameters
Id = object identifier. It is the number set in the "ID" property of the object (see Template Builder).
PropertyName = name of the property to set. Refer to the object help in the Template Builder to
know the list of properties that can be set trough this function.
Value = value to set.
Returned value
Related functions
TObjSetPropertyBool(),TObjSetPropertyReal(),TObjSetPropertyString(),
TObjSetPropertyUnsigned(),TObjBeginUpdate(),TObjEndUpdate()
Example
...
TObjBeginUpdate(100);
TObjSetPropertyInt(100,"DecimalNumber",1);
TObjEndUpdate(100);
...
9.16.1.13 TObjSetPropertyReal
Description
Modify a Real property of the specified object.
Syntax
Void TObjSetPropertyInt(Int Id, string PropertyName,Int Value)
Parameters
Id = object identifier. It is the number set in the "ID" property of the object (see Template Builder).
PropertyName = name of the property to set. Refer to the object help in the Template Builder to
know the list of properties that can be set trough this function.
Value = value to set.
API
165
Returned value
Related functions
TObjSetPropertyBool(),TObjSetPropertyInt(),TObjSetPropertyString(),TObjSetPropertyUnsigned()
,TObjBeginUpdate(),TObjEndUpdate()
Example
...
TObjBeginUpdate(100);
TObjSetPropertyReal(100,"ScaleMin",20);
TObjSetPropertyReal(100,"ScaleMax",80);
TObjEndUpdate(100);
...
9.16.1.14 TObjSetPropertyString
Description
Modify a String property of the specified object.
Syntax
Void TObjSetPropertyString(Int Id, string PropertyName,String Value)
Parameters
Id = object identifier. It is the number set in the "ID" property of the object (see Template Builder).
PropertyName = name of the property to set. Refer to the object help in the Template Builder to
know the list of properties that can be set trough this function.
Value = value to set.
Returned value
Related functions
TObjSetPropertyBool(),TObjSetPropertyInt(),TObjSetPropertyReal(),TObjSetPropertyUnsigned(),
TObjBeginUpdate(),TObjEndUpdate()
Example
...
TObjBeginUpdate(100);
TObjSetPropertyString(100,"DescriptionText","Hello World");
TObjEndUpdate(100);
...
9.16.1.15 TObjSetPropertyUnsigned
Description
Modify an Unsigned Integer property of the specified object.
Syntax
Void TObjSetPropertyUnsigned(Int Id, string PropertyName,Unsigned int Value)
Parameters
Id = object identifier. It is the number set in the "ID" property of the object (see Template Builder).
PropertyName = name of the property to set. Refer to the object help in the Template Builder to
know the list of properties that can be set trough this function.
166
9.16.1.16 TObjSetSize
Description
It changes the size of the specified object through its identifier.
Syntax
Void TObjSetSize(Int Id, Int w, Int h)
Paramentri
Id = identifier of the object
w = width
h = height
Returned value
Related functions
TObjGetW(),TObjGetH()
Example
TObjSetSize(CurrObj,50,50);
9.16.1.17 TObjSetStatus
Description
It changes the status of the specified object.
Syntax
Void TObjSetStatus(Int Id, Int status)
Parameters
Id = identifier of the object
Status = new status
Returned value
Related functions
API
167
TObjGetStatus()
Example
TObjSetStatus(ObjNotIdentified,0);
9.16.1.18 TObjSetText
Description
It changes the text of the specified object; of course this function is useless to the objects that
don't have a text (e.g. BitMap).
Syntax
Void TObjSetText(Int Id, String text)
Parameters
Id = identifier of the object
Text = new text
Returned value
Related functions
TObjGetText()
Example
TObjSetText(NuovoObj,"New");
9.16.1.19 TObjSetXY
Description
It changes the position of the specified object through its identifier.
Syntax
Void TObjSetXY(Int Id, Int x, Int y)
Paramentri
Id = identifier of the object
x = new X-axis
y = new Y-axis
Returned value
Related functions
TObjGetX(),TObjGetY()
Example
TObjSetXY(CurrObj, 100, 100);
168
9.16.2 Chart
9.16.2.1 ChartEndDrawingFlagReset
Description
Resets the end drawing flag.
When a template containing a chart object is opened, ChartEndDrawingFlag returns true only
after the supervisor have drawn all charts.
Syntax
void ChartEndDrawingFlagReset()
Parameters
Returned value
Related functions
ChartEndDrawingFlagStatus()
Example
ChartEndDrawingFlagReset();
TOpenPage("ChartContainer");
while ( ChartEndDrawingFlagStatus() == false )
end
9.16.2.2 ChartEndDrawingFlagStatus
Description
Returns the status of the End Drawing Flag.
When a template containing a chart object is opened, ChartEndDrawingFlag returns true only
after the supervisor have drawn all charts.
Syntax
Bool ChartEndDrawingFlagStatus()
Parameters
Returned value
True (if chart is drawn)
False (otherwise)
Related functions
ChartEndDrawingFlagReset()
Example
ChartEndDrawingFlagReset();
TOpenPage("ChartContainer");
while ( ChartEndDrawingFlagStatus() == false )
end
API
169
9.16.2.3 ChartSetTimeRange
Description
Sets start date time and end date time parameters of a template chart contained in a template.
The time range property of Chart object has to be External, External start or External stop.
Syntax
void ChartSetTimeRange(int
int
int
int
Parameters
sDay = start day
sMonth = start month
sYear = start year
sHour = start hour
sMin = start minutes
sSec = start seconds
eDay = end day
eMonth = end month
eYear = end year
eHour = end hour
eMin = end minutes
eSec = end seconds
Returned value
Related functions
ChartSetTimeRangeStartWidth(),ChartSetTimeRangeEndWidth()
Example
ChartSetTimeRange (24,1,1975,0,0,0 ,24,1,2000,0,0,0);
9.16.2.4 ChartSetTimeRangeStartWidth
Description
Sets the start date time and time range parameters of a template chart contained in a template.
The time range property of Chart object has to be External, External start or External stop.
Syntax
void ChartSetTimeRangeStartWidth(int sDay,int sMonth,int sYear,
int sHour,int sMin,int sSec,
int Width)
Parameters
sDay = start day
sMonth = start month
sYear = start year
sHour = start hour
sMin = start minutes
sSec = start seconds
Width = Time range (sec)
170
Returned value
Related functions
ChartSetTimeRange(),ChartSetTimeRangeEndWidth()
Example
ChartSetTimeRangeStartWidth (24,1,1975,0,0,0 ,3600);
9.16.2.5 ChartSetTimeRangeEndWidth
Description
Sets the end date time and time range parameters of a template chart contained in a template.
The time range property of Chart object has to be External, External start or External stop.
Syntax
void ChartSetTimeRangeEndWidth(int sDay,int sMonth,int sYear,
int sHour,int sMin,int sSec,
int Width)
Parameters
sDay = end day
sMonth = end month
sYear = end year
sHour = end hour
sMin = end minutes
sSec = end seconds
Width = Time range (sec)
Returned value
Related functions
ChartSetTimeRange(),ChartSetTimeRangeStartWidth()
Example
ChartSetTimeRangeEndWidth (24,1,1975,0,0,0 ,3600);
9.16.3 HistAlarmsView
9.16.3.1 HisViewEnablePrintOnCreation
Description
Automatically prints the alarms historical view or events historical view after the template is
opened.
Syntax
void HisViewEnablePrintOnCreation()
Parameters
-
API
171
Returned value
Related functions
Example
HisViewEnablePrintOnCreation();
9.16.3.2 HisViewSetTimeRange
Description
Sets the time range of an historical view contained in a template.
The Time range property of HistView object has to be External, External start or External stop.
Syntax
void HisViewSetTimeRange(int
int
int
int
Parameters
sDay = start day
sMonth = start month
sYear = start year
sHour = start hour
sMin = start minutes
sSec = start seconds
eDay = end day
eMonth = end month
eYear = end year
eHour = end hour
eMin = end minutes
eSec = end seconds
Returned value
Related functions
HisViewSetTimeRangeStartWidth(),HisViewSetTimeRangeEndWidth()
Example
HisViewSetTimeRange (24,1,1975,0,0,0 ,24,1,2000,0,0,0);
9.16.3.3 HisViewSetTimeRangeStartWidth
Description
Sets the start date time and time range parameters of a Historical Alarms object contained in a
template.
The time range property of Historical Alarms object has to be External, External start or External
stop.
Syntax
void HisViewSetTimeRangeStartWidth(int sDay,int sMonth,int sYear,
int sHour,int sMin,int sSec,
int Width)
172
Parameters
sDay = start day
sMonth = start month
sYear = start year
sHour = start hour
sMin = start minutes
sSec = start seconds
Width = Time range (sec)
Returned value
Related functions
HisViewSetTimeRange(),HisViewSetTimeRangeEndWidth()
Example
HisViewSetTimeRangeStartWidth(24,1,1975,0,0,0 ,3600);
9.16.3.4 HisViewSetTimeRangeEndWidth
Description
Sets the end date time and time range parameters of a Historical alarms object contained in a
template.
The time range property of thet object has to be External, External start or External stop.
Syntax
void HisViewSetTimeRangeEndWidth(int sDay,int sMonth,int sYear,
int sHour,int sMin,int sSec,
int Width)
Parameters
sDay = end day
sMonth = end month
sYear = end year
sHour = end hour
sMin = end minutes
sSec = end seconds
Width = Time range (sec)
Returned value
Related functions
HisViewSetTimeRange(),HisViewSetTimeRangeStartWidth()
Example
HisViewSetTimeRangeEndWidth(24,1,1975,0,0,0 ,3600);
Part
174
10
Language Elements
10.1
Introduction
The language is made up of basic elements (letters, numbers, punctuation, etc.), semantic rules
and a syntax that specify the correctness of the commands that can be created.
The instructions are expressions involving some variables and functions thanks to operators
provided by the language itself.
The variables are memory areas where you can store the needed data. They are called variables
because they can have various values.
There are several categories or types of variables. Their difference depends on the information
they represent and on how much memory they take up.
The functions are set of instructions that are grouped together, in order to avoid writing them
again, and because so they represent a kind of instruction more complex.
This way it is possible to 'enrich' the language with a sort of new instructions.
The operators are the same you can find in elementary mathematics with the addition of some
new ones.
To simplify the writing of the code in a certain language there are some structures such as
conditions, cycles, conditioned cycles etc.
The conditions are blocks of instructions carried out only if the condition actually takes place.
The cycles are blocks of instructions carried out a defined number of times.
The conditioned cycles are blocks of instructions carried out until the condition takes place.
The expressions let you create complex elements using simple ones.
All these instructions are written in text files that the interpreter is going to decode and execute.
10.2
Foreword
The language files interpreted by RunTime have the extension WLL (e.g. Filatoio2.wll).
For the language interpreter there's no difference between capitals and small letters (this is the
so-called case insensitive):
(the double slash // specifies the beginning of a comment)
Real Value;
Real value;
The interpreter reading this code fragment will spot an error because he will notice that the
element value has been defined twice.
Later on you will understand better the meaning of 'to define' and that 'element' is only a generic
term that in the specific cases can mean 'variable', 'function', 'constant' etc.
It is important to separate the elements with spaces or something, otherwise they will be
considered as a single unit.
realValue;
If you wanted to declare the variable Value you have made a mistake: the interpreter sees only
Language Elements
175
10.3
Variables
They are elements containing the values to manipulate during the execution of a program or a
function..
In the language there are two types of variables:
Global and so visible to all the program functions even if they are in different files (global
visibility)
Syntax:
Global Type Name [= Default value]
Type is the type of variable (see Types).
Name is the name you want to give to the variable.
Example:
Global Real ExactTemperature;
Global Int AbsoluteZero=-273;
Local, that is to say defined in each function. They can be used only within the function
context (local visibility)
Syntax:
Type Name [= Default value]
Type is the type of variable (see Types)
Name is the name you want to give to the variable.
Example:
Function Int AbsoluteTemperature(integer T0)
Real TemperaturePT01;
//
Real TemperaturePT02;
//
...
End;
definition
// code
// end of function
The variable Temperature PT01 is local to the function AbsoluteTemperature and so can't be
used outside it. Anyway you can use the same name for another local variable in another function.
176
10.4
Types
10.4.1 Introduction
The variables contain different information and, depending on the information they contain, they
are divided into categories or types; there are different types of variable:
32 bit integer signed values
Int
Real
Bool
String
10.4.2 Integer
They are 32 bit integer values with signand can represent up to a billion
Example
Int Counter;
Int Difference = -1;
10.4.3 Real
They are real value with floating point that can store number with high precision
Example
Real pi;
Pi=3.141592;
10.4.4 Boolean
They are boolean values so they can have only two states true or false.
Example
Bool LedState;
LedState=GetDigGateValue("LEDPORT",0);
10.4.5 String
they are string of char with different length.
Example
String Name="Mark";
String Surname="Red";
String Iniziali;
INIZ = StrSubString (Name,1,1)+StrSubString (Surname,1,1);
10.5
Functions
They allow to join together more instructions and so create a complex instruction, and, at the
same time, avoid code redundancy.
A function is characterized by:
Language Elements
177
a return value that can be either a type or void. This means that the function doesn't return
anything
a name (case insensitive) that identifies the function throughout the program
a list of parameters (optional) . They are the values the function needs in order to be
operative.
directives (optional). They are special commands that enrich the functions
It's better to give the functions meaningful names in order to simplify work. So if a function deals
with the calculation of the temperature in Kelvin degrees, then you can call it
'CalculateTemperatureK'.
Syntax:
Function Type Name([Parameter List)
[Directives]
[Local Vars]
Instructions
End
#Startup
178
// Digital
int in2;
input 2
// Digital
while (WindowIsOpen())
Language Elements
Sleep(10);
179
end
End
here
Putting properly into columns the instructions allows a better reading and understanding of a
function.
You can call up functions when you open or close a Template, or by using commands (e.g. a
Button) defined in the Template itself.
N.B.: You can't execute a function if it is already being executed.
10.6
Instructions
10.6.1 Introduction
Every instruction must end with ';'. Let's see now the various instructions and structures the
language is made up of.
Reserved words like end, if, while etc don't need ';' .
10.6.3 Assignment
it's used when you wanto di give a new value to a variable.
Syntax
VarName = Expression;
Example
NumeroDiPID=((9*Var1)/(1-Var3))*(2-Var2);
Temp=TriggerValue-CurrValue;
180
Example
Function void Caller()
...
Int A;
...
..
ASqr=Quadrato(A); // here the 'Caller' call function 'Quadrato'
...
...
End
Function int Quadrato(int Numero)
int Quad;
Quad=Numero*Numero;
Return (Quad); // here ends 'Quadrato' and program
// return to the Caller
End
Language Elements
181
End
10.7
Expressions
The expressions are the elements the language is based on.
An expression can be a constant, a variable or a complex equation. It doesn't perform an action
but it is simply evaluated.
As in the mathematical expressions the elements are linked by logic and mathematical operators.
The result of an expression is a value that in its turn can be used as an element of another
expression; this way it is possible to put together even very complex formulas.
Here are some examples of expressions:
3
constant
ValueGateA
log(14)
4+ValueGateB
GateAon && GateBon
// a numerical
// a variable
// a function returning a value
// the addition operator is there
// the boolean AND operator is there
182
// complex expression
Calculating the expression you obtain a value that must be used as a parameter, if given to a
variable, for a function, or as a test in a condition:
A=3;
B=ValueGateA;
StartScale (log(14), 4+ValueGateB);
if (GateAon && GateBon) then
ActivateAlarm();
end
Delta= Delta*2 + Alfa + 2*exp(Beta-Gamma-D);
The operators used in the equations have, as it happens in mathematics, a different priority; so to
make the writing of the equations more flexible and easy to understand you can use the round
brackets.
AverageValue=(GateA+GateB+GateC) / 3;
The logic expressions are often found when some condition is required, as in the while cycles
and in the if..then conditions.
if ( (A==12 && D<100) && (B==0 || C>=120) ) then
end;
10.8
Operators
The operators are language elements that link different expressions so as to allow the formation
of more sophisticated ones.
There are logic operators (And, Or, ) whose result is true or false, and algebraic operators
(+,-,) whose result is a numbe'.
Logic operators
==
equality
!=
inequality
>=
majority or equality
<=
minority or equality
>
majority
<
minority
&&
AND
||
OR
Algebraic operators
+
addition
Language Elements
-
subtraction
product
division
NB: If you need division modulus you've to use the API MOD().
NB2: You can use addition operator also for strings.
183
184
Index
-C-
176
-++-*/
182
-==
179
-AAbs 115
Advanced use of the keyboard 19
Analyse 31
Analyse project 31
API Functions - Introduction 38
ArcCos 115
ArcSin 116
ArcTan 116
Arrange icons 32
Assignement 179
-BBeep 89
BitAnd 38
BitMask 38
BitNot 39
BitOr 39
BitXor 40
Bool 176
Cascade 32
ChartEndDrawingFlagReset 168
ChartEndDrawingFlagStatus 168
CharToStr 144
ChartSetTimeRange 169
ChartSetTimeRangeEndWidth 170
ChartSetTimeRangeStartWidth 169
Close 26
CloseSession 90
CloseWindow 90
CmpGateExists 79
Colors 35
Condition 180
Contents 33
Copy 30
Cos 117
Cut 29
-DDateTimeToSeconds 42
Delete 30
DeviceEnableCommunication
DeviceName 52
DigGateExists 75
DirectoryCreate 55
DirectoryDelete 55
DirectoryGetCurrent 56
DirectorySetCurrent 56
Do 181
Do While 181
Do While Cycle 181
51
-EEnableShutdown 91
Environment setup - Introduction
Eol 145
EvnGateExists 86
Exec 91
ExecEx 92
Exit 29
exit current function 179
35
Index
Exp 117
Expressions
function call
181
-FFileAttrFound 56
FileAttrFoundEx 57
FileClose 58
FileCopy 57
FileDelete 58
FileEof 59
FileExist 59
FileFindClose 60
FileFindCloseEx 60
FileFindFirst 60
FileFindFirstEx 61
FileFindNext 61
FileFindNextEx 62
FileGetAttr 62
FileGetSize 63
FileMove 63
FileNameFound 64
FileNameFoundEx 64
FileOpen 65
FileOpenDialog 92
FilePos 66
FileRead 66
FileReadLn 66
FileRename 67
FileSaveDialog 94
FileSeek 67
FileSetAttr 63
FileSize 68
FileSplitPath 68
FileWrite 69
FileWriteLn 69
Find 30
Floating point value 176
For 180
For Cycle 180
Foreword 174
FTPConnect 111
FTPDisconnect 112
FTPGet 113
FTPPut 114
Function 176
179
-GGetBit 40
GetCmpGateGateID 79
GetCmpGateNID 80
GetCmpGateValue 80
GetCmpGateValueAsString 81
GetCurrentLanguage 95
GetDateString 43
GetDayFromSeconds 43
GetDayOfMonth 44
GetDayOfWeek 44
GetDeviceRxErrors 52
GetDeviceTxErrors 53
GetDigGateCommunicationStatus 75
GetDigGateGateID 76
GetDigGateNID 76
GetDigGateProp 77
GetDigGateValue 77
GetEvnGateAckedStatus 86
GetEvnGateGateID 87
GetEvnGateMsg 88
GetEvnGateNID 87
GetEvnGateValue 88
GetHour 44
GetHourFromSeconds 45
GetMilliseconds 45
GetMinute 46
GetMinuteFromSeconds 46
GetMonth 47
GetMonthFromSeconds 47
GetNumGateCommunicationStatus 70
GetNumGateGateID 70
GetNumGateNID 71
GetNumGateProp 71
GetNumGateValue 72
GetNumGateValueAsString 72
GetProjectCaption 96
GetProjectName 96
GetProjectPath 97
GetSecond 47
GetSecondFromSeconds 48
GetShutdownStatus 97
GetStrGateCommunicationStatus 82
185
186
GetStrGateGateID 82
GetStrGateNID 83
GetStrGateProp 84
GetStrGateValue 83
GetTickCount 48
GetTimeString 49
GetTotalCmpGates 81
GetTotalDigGates 78
GetTotalEvnGates 89
GetTotalNumGates 73
GetTotalStrGates 85
GetUserGroups 98
GetUserName 98
GetYear 49
GetYearFromSeconds 50
Global (global variables) 175
-M-
-HHelp 33
HexStrToInt 99
HisViewEnablePrintOnCreation 170
HisViewSetTimeRange 171
HisViewSetTimeRangeStartWidth 171
-IIconMessageBox 100
If 180
If then else 180
Index 33
InputDialog 102
Int 176
Integer 176
Integer variable 176
Introduction 12
IntToHexStr 102
IntToStr 145
IsDeviceCommunicationEnabled
IsDeviceCommunicationKo 54
Istructions - Introduction 179
-KKeyboard
100
174
Menu - Introduction 25
Menu Edit - Introduction 29
Menu File - Introduction 25
Menu Help - Introduction 32
Menu Search - Introduction 30
Menu Syntax - Introduction 31
Menu Window - Introduction 32
Message Beep 103
MessageBox 104
Minimize all 32
Mod 118
ModemAvailable 121
ModemDial 121
ModemHangup 122
ModemSendSMS 122
ModemSetPIN 123
ModemSetServicesCenter 124
ModemSetTextMode 124
-NNew 26
NumGateExists
74
-OOpen 26
Operators 182
53
-PPaste 30
Play 105
PlaySound 105
Pow 118
Preferences 30
Print 28
Index
Print Setup 29
PrintString 105
Projects 27
-QQuestionBox
106
-RRand 119
Real 176
Real value 176
RealToInt 107
RealToStr 145
RecipeCreate 125
RecipeExecute 125
RecipeImport 126
Reopen 28
Replace 31
Report: Note 144
ReportAppendRecord 126
ReportCreate 127
ReportDisplay 127
ReportGetPeriodType 128
ReportInsertHistoricalAlarmsRTF 130
ReportInsertHistoricalAlarmsTXT 133
ReportInsertTemplate 129
ReportInsertTemplateEx 129
ReportInsertText 128
ReportInsertTemplate example 142
ReportLotTime 135
ReportPrint 136
ReportSetFullPathFileName 136
ReportSetPeriodDayAndMonth 139
ReportSetPeriodDayOfMonth 138
ReportSetPeriodDayOfWeek 137
ReportSetPeriodNone 140
ReportSetPeriodTime 140
ReportShowCreationList 141
ReportShowHistList 141
ResetBit 41
ResetDeviceRxErrors 54
ResetDeviceTxErrors 54
return 179
returning a value 179
Round
119
-SSave 26
Save As 27
Search again 31
SendMail 110
SetBit 41
SetDateTime 50
SetDigGateValue 78
SetNumGateValue 74
SetStrGateValue 84
ShellExec 107
Sin 119
Sleep 108
Speedbar 17
Sqrt 120
StopFunction 108
StopSound 109
StrCase 146
StrConcat 146
StrDelete 147
StrGateExists 85
String 176
StrLen 147
StrOfChar 147
StrPos 148
StrSubString 148
StrToChar 149
StrToInt 149
StrToReal 149
-TTan 120
TemplateAlarmsStatus 151
TemplateChart 151
TemplateDefinePagesAccess 152
TemplateDefineUser 153
TemplateDevicesStatus 153
TemplateEventsStatus 154
TemplateGatesStatus 154
TemplateGroupNames 152
TemplateHistAlarms 154
TemplateHistEvents 155
187
188
TemplateMakeReport 155
TemplateMultilanguage 156
TemplatePassword 156
TemplatePrinterSetup 157
TemplateRecipe 157
TemplateSystemStatus 157
TemplateUserChanges 158
TemplateViewReport 158
text strings 176
The first step 14
The use of the clipboard 23
The use of the mouse 21
Tile 32
TObjBeginUpdate 163
TObjEndUpdate 159
TObjFunction 159
TObjGetH 160
TObjGetStatus 161
TObjGetText 161
TObjGetW 162
TObjGetX 162
TObjGetY 162
TObjSetPropertyBool 163
TObjSetPropertyInt 160, 164
TObjSetPropertyReal 164
TObjSetPropertyString 165
TObjSetPropertyUnsigned 165
TObjSetSize 166
TObjSetStatus 166
TObjSetText 167
TPageClose 150
TPageOpen 150
TPagePrint 151
Types - Introduction 176
-WWhile 181
While Cycle 181
WindowIsOpen 109
-UUndo 29
UnsignedGetTickCount
51
-VVariables
175
189