Google+Reliance on YouTubeReliance on TwitterRSS FeedČesky

Reliance 4 – Example projects

Here you can find all the example projects supplied along with the Reliance 4 SCADA/HMI system. To view the detailed description of an example, please click on its name. To download the example, please click on the Download button next to the example. All example projects below are a standard part of the Reliance 4 Installation Package.



View/Hide Details:View Details Hide Details


Complete archive

Type

Project name

Edited

Download

ZIP archive

The ZIP archive contains all example projects shipped with the Reliance 4 SCADA/HMI system. Unpack the archive contents to the folder where you have installed Reliance 4.

2.8.2010

Download

The following tables contain the example projects divided into the thematic groups.



Demos

Type

Project name

Edited

Download

AirCondition is an interactive visualization project designed to demonstrate functions of basic graphical components. Simple scripts are also used in the project to simulate the environment in an office. The project is translated into several languages (English, Russian, Czech, Dutch, and Turkish).

You are enabled to control the input and output fan, recuperator, cooler, heater, humidifier and to simulate the cleanliness of both the input and output filter or errors. A simple physical model of the office environment (temperature and humidity) is simulated with three scripts.

06/19/2009

Download

BoilerRoom is an interactive project designed to demonstrate functions of basic components, such as Button, Display, Active Picture, Pipe, Progress Bar, and Real-Time Trend, for the visualization of the water-heating process in a central heating gas boiler. The project also demonstrates how to use alarms, trends, reports, and event and periodic scripts. Within the project, several users with different access rights are defined through the User Manager (you can log on with an empty password). A similar visualization project is created step by step during the Reliance 4 training courses.

06/19/2009

Download

Factory is an interactive project designed to demonstrate functions of basic components, such as Button, Display, Pipe, Picture, Progress Bar, for the visualization of a simple chemical production process. Four basic chemicals are mixed together in a boiler (the mixing ratio can be defined manually or via recipes). The final product is stored in a tank and fed to moving tank trucks. A truck is represented as a picture and a progress bar grouped together. The movement of the truck is achieved by dynamically changing the X coordinate using scripts.

At runtime, the project starts in the automatic mode (script-controlled), but you can switch the mode by clicking on the Manual mode button located on the bottom part of the visualization window. Based on the data table (database) to which all important process values are logged, you can easily create a trend or report.

06/19/2009

Download

SMS is a project designed to demonstrate sending and processing text messages via scripts. To successfully run the project, it is required that SMS Driver be installed and a GSM modem connected (e.g., Siemens M20 Terminal).

The project contains the periodic script StatusSMS and two event scripts – RecievedSMS and SendSMS. To select the type of GSM modem and specify the communication options including the SMS service center number, bring up the Project Structure Manager and choose the SMS page for the selected computer.

06/19/2009

Download

Tannery is a project designed to demonstrate how to use the Reliance system for the control of the chemical process of leather tanning. The project contains about 250 tags and is based on a real industrial process.

After the project is started, select the top left drum to run the process visualization. The visualization window contains a set of tanks interconnected via pipes with valves and pumps. The toolbar contains control (Pause, Restart, Recipe) and configuration commands (Settings). The Time shrink option allows you to specify the speed of the simulation. The visualization runs in an automatic mode (script-controlled).

06/19/2009

Download

Alarms/Events

Type

Project name

Edited

Download

The project SendAlarmsUsingGroups_TwoAreas demonstrates how to send alarm/event information to certain users based on the alarm/event groups defined in the project. The alarm/event information can be sent via E-mail or SMS (text messages) as the alarms/events occur, end or get acknowledged.

In the Project Options dialog, 5 alarm/event groups are defined (Project > Alarms/events > Groups). The groups are defined based on two criteria: alarm severity (the "TrivialAlarms", "SeriousAlarms", "CriticalAlarms" groups) and alarm area ("Area1", "Area2").

In the Device Manager, the "Area1" and "Area2" folders are defined to represent the areas where particular devices (PLCs, telemetry systems, etc.) are located. In each folder, one device is defined. In each device, alarms named "TrivialAlarm1", "SeriousAlarm1" and "CriticalAlarm1" are defined that can be simulated through the buttons in the visualization window. Each alarm has an enumeration of the groups it belongs to (the "Advanced" tab, the "Alarm/event groups" property) based on alarm severity and area where the respective device is located.    

In the User Manager, users are defined in the "Area1" and "Area2" folders. Each user has an enumeration of the groups of alarms/events (the "Alarms/events" tab, the "Alarm/event groups" property) that he/she should be notified of. The group enumeration depends on alarm severity and the area that the user belongs to. The alarms that belong to the "TrivialAlarms" group are not sent to any users. The method of sending the information is specified by the "Send via E-mail" and "Send via SMS" options (the "Alarms/events" tab). Some users (technicians) are notified via E-mail and SMS, others (the directors and technical managers) are only notified via E-mail.

For the users to be notified via E-mail, it is necessary to enter a valid E-mail address (the "Basic" tab, the "E-mail" property).

For the users to be notified via SMS, it is necessary to enter a valid phone number (the "Basic" tab, the "Phone number" property).

In the Project Structure Manager, a computer named "PC1" is defined. On the "Alarms/events" tab, the "Send via E-mail", "Send via SMS", "On start", and "On end" options are active. The "Message text" property contains the necessary information and doesn't have to be altered.

To send information via E-mail, it is necessary to configure the options on the "E-mail" tab, especially the SMTP server address.

To send information via SMS, it is necessary to activate the "Start SMS driver" option on the "SMS" tab and configure the other options on this tab.

05/09/2011

Download

Components

Type

Project name

Edited

Download

DataGrid is a simple project designed to demonstrate basic features of the Data Grid component. There are several tags defined within the System device which are displayed in the data grid's columns (Array_Value, Array_FgColor, and Array_BgColor) and tags which control the global behavior of the component (Offset, Position, and RowCount). The Array_FgColor tag controls the font color. The Array_BgColor tag controls the background color. These tags are initialized in scripts.

After the project is started in the runtime software, you are enabled to set values in the data grid's cells.

06/19/2009

Download

DataTree_ControlArea is a project designed to demonstrate how to use the Data Tree component for the visualization of the control area tree structure. Tags of all basic data types listed in the tree structure (the Tags subtree) are defined within the System device. Two data tables are defined via the Data Table Manager to log the System device's tags. Two trends and two reports are also defined via the Trend Manager and the Report Manager to visualize historical data.  In addition, actions to display current and historical alarms/events, tables, and trends are defined via the Action Manager. These actions are connected to the data tree nodes. The Data Tree component's structure simulates the structure of the control area.

The Display cell is used to view the tag parameters (the Tags subtree). At runtime, you can also edit tag values using the displays located to the right of the tree. To activate commands or change the structure of the Data Tree component, it is required to log on. If you log on as the Edit user, you are allowed to edit the Data Tree structure (no password is required). If you log on as the Command user, you can execute actions, such as view trends, reports, or alarms/events list.

06/19/2009

Download

DataTree_Grid is a project designed to demonstrate how to use the Data Tree component to display non-array tags in a tabular format. The project contains ten virtual devices defined via the Device Manager. All virtual devices contain the identical set of tags. For each virtual device, one data table is defined via the Data Table Manager to log the tag values. The same number of trends are defined via the Trend Manager to display historical data.

An action is defined for each trend via the Action Manager. These actions are connected to the data tree nodes. Within the Data Tree component, a node is defined to display all tag values. For each tag displayed in the node's row, a cell is defined.

At runtime, you are enabled to change the tag values and to show trends via actions (a trend can be displayed by double-clicking on the trend icon).

06/19/2009

Download

DataTree_Localized is an example project designed to demonstrate how to use text strings in the Data Tree component which are translated into several languages.

The component is used to display the list of actions. For individual tree nodes, aliases are specified to be localized into different languages.

The tree nodes are connected to actions. At runtime, an action can be executed by double-clicking on the alias (the node description).

06/19/2009

Download

IPCamera_Axis is a project designed to demonstrate how to use the Axis IP Camera component to display and record data received from the Axis IP camera connected to the computer. To successfully run the project, it is required to have IP camera drivers installed on your computer (they are part of the Reliance 4 Add-On Pack installer).

Within the System device, the record and standby tags of type Bool are defined. The visualization window contains the Axis IP Camera component and two Button components. Before you run the project, the camera's URL or IP address and login information for the connected IP camera must be specified on the Functions page of the component's Properties dialog box.

06/19/2009

Download

IPCamera_Vivotek is a project designed to demonstrate how to use the Vivotek IP Camera component to display and record data received from the Vivotek IP camera connected to the computer. To successfully run the project, it is required to have IP camera drivers installed on your computer (they are part of the Reliance 4 Add-On Pack installer).

Within the System device, the Input and Output tags of type Word and the Record and Standby tags of type Bool are defined. The visualization window contains the Vivotek IP Camera component and four Button components. Before you run the project, the camera's URL or IP address and login information for the connected IP camera must be specified on the Functions page of the component's Properties dialog box.

06/19/2009

Download

RealTimeChart_Stacked is a project designed to demonstrate how to configure the Real-Time Chart component to show a horizontal stacked bar chart. Each bar of the chart consists of two differently colored parts whose size can be changed separately using a Display component. The total bar size is the sum of each part's size.

The component is configured in the following way:

1. Bring up the component's Properties dialog box and select the Horizontal bar type (Series > Properties > Type).

2. According to the example, the X/Y-value property must be specified for each point of the chart (Series > Data > X/Y-value).

3. Select the Stacked property as follows: Static > Properties > Series > Format > Multiple Bar.

06/19/2009

Download

SimpleTimeProgram is a project designed to demonstrate how to use the Simple Time Program component. Within the System device, the DataArray tag is defined to store the time program's configuration data. The remaining tags (auxiliary tags - stored in folders) are used to display this data in the visualization window.

The DecodeData event script is defined via the Script Manager to extract the data from the DataArray tag to the auxiliary tags. To configure the time program at runtime, click on the Configuration button. Upon configuration, the data from the DataArray tag is automatically decoded and displayed in the visualization window. The DataArray tag values are displayed in the table on the left side of the visualization window.

06/19/2009

Download

Databases

Type

Project name

Edited

Download

The AppendRecordsToDb project shows how to manually (randomly) write data to a data table via script. One record (row) in the 'Data1' data table contains the values of the following tags (columns): RecordTimeStamp, LongInt, String and Word.

The data that will be logged into the data table is stored in the array type tags (LongInt5, StringArray5 and WordArray5). The 'RecordTimeStamp' value is assembled from the MinuteArray5, HourArray5, DayArray5 before the record is logged into the data table. The 'BlockSamplingData' tag is connected to the 'Stop bit' parameter of the data table and to the corresponding button in the visualization window.

A sampling method of the data table is set to 'Script-controlled' – this means that the data can be logged only from a script via the AppendRecord command. The time stamp source is linked to the 'RecordTimeStamp' tag – records don't have to be logged in a chronological sequence.

The InitArrays script is defined in the Script manager and initializes the array tags. This script is executed at the project start via the AfterStartProject script. The SaveArray script is started via the 'Save array of records' button in the visualization window and performs an actual logging of records to the data table. Values of the RecordTimeStamp, Word, LongInt and String tags are set and the RDB.AppendRecord method is called inside the "For" statement (this sequence is performed five times). You can view the data logged in the data table via the trend or report viewer.

06/19/2009

Download

The AppendRecordToDb project demonstrates how to use the RDB.AppendRecord method to log data to the defined data table. The LongInt, String and Word named tags are defined in the System device. The values of these tags will be logged into the data table. The following tags are also defined in the System device: RecordTimeStamp containing the current time (the RSys.Now method) and BlockSamplingData which is linked to a button in the visualization window (you can enable/disable data logging with this button).

The 'Data1' data table contains the three items connected to the three tags mentioned above. A sampling method is set to "Script-controlled". Time stamp source is set to RecordTimeStamp tag and Blocking tag is set to BlockSamplingData. The SaveRecord event script is defined in the Script manager. This script sets the RecordTimeStamp to the current time and calls the RDB.AppendRecord method. Press the "Save record" button to start the script.

06/19/2009

Download

The LogDataToSQLServer project demonstrates how to log tag values to an external SQL server and how to visualize this data in the trend viewer. The example requires access to an SQL server (MS SQL Server is a part of the Reliance 4 Add-On Pack).

Several Word type tags are defined in the System device. Tag values are logged with a period of 5 seconds to the 'Pressures' and 'Temperatures' data tables defined in the Data Table Manager (the database type is SQL). The 'SQLServer' connection is defined in the project options on the SQL page (you may have to update some of the parameters). Notice that defined SQL connection is selected in the Project Structure Manager as a parameter for connected data tables (the SQL connection parameter on Basic page).

The main visualization window contains the four edit boxes connected to the Word type tags and two buttons that display trends.

06/19/2009

Download

The ODBCFromScript project shows how to access the ODBC databases in the Reliance 4 SCADA/HMI system via scripts. The project contains a script named 'Define', that contains the ReadDataFromSQLTable and WriteDataToSQLTable procedures. The procedures work with the "ADODB.Connection" object and related objects. The procedures are called from the ReadDataFromSQLTable and WriteDataToSQLTable scripts with parameters c_ConnectString and c_TableName. You have to set this parameters according to your database. To help you construct the c_ConnectString constant, see the "Project Options > SQL > Connection string" field (configure the connection via the "Edit connection string" command before you copy the string).

06/19/2009

Download

The RandomAccessToDataTable project demonstrates the manual (random) access (read/write) to the DBase type data table. The 'Records' data table is defined in the Data table manager. The 'Data acquisition method' parameter of this data table is set to 'Not specified' and the 'Archive files' parameter on the 'Advanced' tab is set to 'None'. The table contains the following items: Number, Length, Color and Material. The items are linked to corresponding tags. The records in the data table are accessed manually from a script. You can view the records stored in the data table via record viewer (the 'Report1' report).

The script that contains the procedure and function definitions is defied in the script manager. The script is named 'Init' and it is executed only once before all other scripts in a thread. The RDb.CreateTableObject command is used to create an instance of an object that will be used to access the 'Records' data table. For example to add a new record to the data table (the AppendRecord procedure) the following methods of the object are called: OpenTable, Append, SetFieldValue, Post and CloseTable. For more information on the TTable object see the 'Scripts' help file.

02/15/2009

Download

The SQLFromScript project demonstrates how to read and write data from/to SQL database via methods of the "ADODB.Command" and "ADODB.Connection" objects. The "ReadDataFromSQLTable", "WriteDataToSQLTable" and 'Define' scripts are defined in the project. The first two scripts are event scripts calling procedures defined in the 'Define' script (the script is started only once before all other scripts at the process – script engine – initialization). You have to set the "Connection string" in the 'Define' script according to your SQL server.  show The usage of SQL commands SELECT and INSERT is demonstrated in the procedures.

06/19/2009

Download

Data Exchange

Type

Project name

Edited

Download

The CommWithExternalProgram project is designed to demonstrate how to transfer data between the Reliance system and an external application via COM interface. The project contains the 'RandomValue' and 'Seconds' tags which are used to hold the data received from an external application. The project also contains the 'RelianceValue' tag which is used to send the data to the external program (you can set its value in the visualization window). The external application is located in the "<Project>\Apps" folder and it is automatically started with the visualization project (the "Project Options > Scripts > Other > After start project" parameter is set to a script that contains a command to run the program). Before the project is started for the first time, execute the external program manually to register the COM object.

The project's main visualization window contains two buttons connected to the scripts that start or stop the external application. The window also contains three Display components connected to the RandomValue, Seconds and RelianceValue tags. The Script Manager contains the Create_GlobalObject and Free_GlobalObject event scripts designed to start and stop the external application (the 'CreateObject' function is used to start the external application). The SendNewValue script is designed to send the value of the 'RelianceValue' tag to the external application (this is achieved by calling the 'SetValue' function of the external application). The last object defined in the Script Manager is the 'Read_ObjValues' periodical script (the period is 0.3 seconds), that reads the values from the external program (the GetRandomValue and GetSeconds functions of the external program are used to read the values).

The external application shows the current values of the two dynamically generated tags and the list of values received from the visualization. The external program is written in the Borland Delphi (Pascal) development environment (the source code is located in the "<Project>\Main\Apps\Source\External.zip" archive).

06/19/2009

Download

The DDE_Client project shows how to use the DDE protocol to exchange data between two Reliance projects. The DDE_Client project needs to be started in the Reliance Control software (and simultaneously the DDE_Server project needs to be started in the Reliance Control Server software). If both projects are successfully running, you can set the value in the DDE_Server project and the change is instantly visible in the DDE_Client project (and vise versa).

In the Device Manager (Reliance Design > Managers > Device Manager), there is a DDE device named 'R_CtlSrv_DDEServer'. The "DDE server" property has a value of 'R_CtlSrv', which is the DDE server's filename without an extension. Within the DDE device, there are tags defined in the Tags folder, which correspond to the tags defined in the project DDEServer.rp4. The tags are divided into folders T0 and T1 (just to be well-arranged). For each tag, the "DDE item" property is configured so it corresponds to the value of the "DDE item" property in the project DDEServer.rp4. Also, "Reading" and "Writing" properties can be configured.

In the Project Structure Manager (Reliance Design > Managers > Project Structure Manager), the device 'R_CtlSrv_DDEServer' is connected to the computer DDEClient. The "DDE topic" property is set to "DdeServer" (this is if the DDE server is the Reliance runtime software, i.e. Reliance View, Reliance Control, Reliance Server or Reliance Control Server).

06/19/2009

Download

The DDE_Client project shows how to use the DDE protocol to exchange data between the two Reliance projects. The DDE_Server project needs to be started in the Reliance Control Server software (and simultaneously the DDE_Client project needs to be started in the Reliance Control software). If both projects are successfully running, you can set the value in the DDE_Server project and the change is instantly visible in the DDE_Client project (and vise versa).

In the Device Manager (Reliance Design > Managers > Device Manager) there are two virtual devices (T0_Server and T1_Server), which contain internal tags (in the 'Tags' folder within each device). The tags are configured for DDE sharing (the 'Sharing' tab).

In the Project Structure Manager (Reliance Design > Managers > Project Structure Manager), two virtual devices are connected to the 'DDEServer' computer.

06/19/2009

Download

The ExportImportXLS project is designed to demonstrate how to access the MS Excel files via COM interface (the MS Excel application has to be installed on the same computer as the Reliance system). The Var_Float, Var_Int and Var_Str tags are linked to corresponding Display components in the main visualization window (the display's "Enable setting value" parameter is enabled). The values of these tags are exported/imported from/to *.xls or *.xlsx file. The ExportToExcel and ImportFromExcel event scripts (activated via buttons in the main window) are defined in the Script manager. The Excel file is named "Values.*" and it is located in the <Project> folder.

At the beginning of the ExportToExcel script, an instance of the 'Excel.Application' object is created. Afterwards the methods are called to create a new WorkBook and a new WorkSheet. The 'Cells' method is used to write the data to the cells. The workbook is stored via 'SaveAs' method.

At the beginning of the ImportFromExcel script, an instance of the 'Excel.Application' object is created. The "values.*" file is opened with the 'Open' method of this object. The values stored in the file are loaded via 'Cells' method.

06/19/2009

Download

The ExportToCSV project demonstrates how the scripts can be used to export the historical data into a text file (CSV). The project contains the AfterMidnight time script that is started each day one minute after the midnight (you can simulate the start of this script if you click on the button in the visualization window). The script starts the Temperatures_Air_ExportToCsv and Temperatures_Water_ExportToCsv scripts. These two scripts call the ExportYesterdayArchiveDbTable procedure with the required parameters. This procedure (which is defined in the 'Define' script) is designed to read the data from a data table and to export it into a text file. The project also contains a group of SmallInt type tags and two DBase data tables with periodical data logging. The exported files are stored in the <Project>\History\Data\xxxx\ folder, where xxxx represents a year.

06/19/2009

Download

Project ImportFromCSV demonstrates how to use the scripts to import data from a text file (CSV). The project contains the following tags: RoomNumber, Occupied, Date and Time. The ImportCsvFile event script is designed to load the data from a file to these tags. The visualization window contains a button that starts the script. After the script is finished the four Display components contain the data imported from the <Project>\Import.csv file.

06/19/2009

Download

The LogDataToFileAndDb project shows how to log tag values to a file and database via script. The main visualization window contains three display components (displaying the sine and cosine of a periodically incrementing angle) and two buttons that activate/deactivate data logging to the file or data table. The data is logged to the "<Project>\ History\ Data\ AngleData.txt" file and/or to the 'AngleData' data table (the sampling method for the data table is set to "Script-controlled"). You can browse the data logged to the data table in the Report viewer (the AngleData report).

An event script named 'Define' is defined in the Script manager. The script starts before all other scripts and sets the constants (the "Run on thread initialization" parameter on the "Advanced" tab is enabled). The "Calc_and_log" periodical script computes the sine and cosine and increments the 'Angle' tag by one degree every 200ms. The script also contains the 'Log_to_file procedure', that uses the "Scripting.FileSystemObject" object to log the data to the file, and the 'Log_to_database' procedure, that uses the "RDB.AppendRecord" method to log the data to the 'AngleData' data table.

06/19/2009

Download

Devices

Type

Project name

Edited

Download

AMiT is a project designed to demonstrate basic features of the AMiT PLC connected to the visualization application, i.e., reading/writing tag values, logging values to a data table, bit access, etc. Within the AMiT1 device, a group of tags containing current values (Sawtooth_1, Sawtooth_2, Sine, ARC_index) and current digital values (Bit1, Bit2, Bit3), and a group of array-type tags used to display the Real-Time Trend component are defined via the Device Manager. The current tag values are logged to the Database1 data table and can be displayed in Trend1 defined through the Trend Manager. Via the Real-Time Trend Manager, Trend1_RT is defined to be displayed directly in the visualization window.

The main visualization window contains several Display components connected to the Sawtooth_1, Sawtooth_2, and Sine tags whose values can be changed even if the AMiT1 device is not in the online mode, i.e., the Online property is not enabled (Project Structure Manager > PC1 > AMiT1 > Basic > Online), e.g., for testing purposes. If the device is not in the online mode, tag values can be set, but a connection with the device is not made.

06/19/2009

Download

DeviceCommErrorAlarm is a project designed to demonstrate how to replace the alarm automatically triggered by a device communication error with a custom alarm defined through the Device Manager. This alarm will remain active for the duration of the communication error. This is the difference from the alarm that is automatically triggered by Reliance when an error in the communication with a device occurs. It is an "event" type of alarm - it is triggered, but it does not remain active; Reliance does not check to see if the error condition still exists - this is a drawback).

Within the Modbus1 device, the CommError tag of type Bool is defined via the Device Manager. It is an internal tag (not a physical tag from a PLC). In addition, the CommError alarm defined within the same device is linked to the CommError tag. The alarm is triggered by the leading edge of the tag value (the off-to-on transition).

The Modbus1 device is connected to the PC1 computer via the Project Structure Manager. The communication options are defined through the Channel1 object which represents a communication channel. On the Advanced page of the channel properties, there are links to scripts to be executed when communication with the device is started, interrupted due to an error, and restored. To each script, an integer parameter representing the ID of the Modbus1 device is passed (a value of 1). If the project contained multiple devices, there would be the same scripts selected on the Advanced page (only the device ID numbers passed as parameters would differ).

The Define script which contains the definition of the SetDeviceCommError procedure is defined via the Script Manager. On the Advanced page of the script's Properties pane, the Run on thread initialization option is active to execute the script prior to any other script supposed to run in the same thread of execution. The SetDeviceCommError procedure is called from a script named DeviceCommError which executes every time that an error in communication with the device occurs, and from a script named DeviceCommStarted which executes every time that communication with the device is started or restored. The SetDeviceCommError procedure has the following parameters:

Device Id: ID of the device

CommError: the value of True or False (determines whether there is an error in communication)

The SetDeviceCommError procedure first converts DeviceId to device name and then writes the value of the CommError parameter to the internal tag CommError in the respective device by calling the RTag.SetTagValue method. This results in triggering a new alarm or ending the existing one.

07/02/2010

Download

OPC_DeviceCommStatus is a project designed to demonstrate how to use a script to determine the state of an OPC server by testing the quality of a tag. Via the Device Manager, you have to configure the OPCDevice1 device according to your local OPC server. The OPC group of this device contains an internal tag which is periodically tested in the script (if the tag quality is not 'Good', it means that the OPC server is not connected). For this purpose, the Random_UInt1 tag is used in the project. The project also contains the OPCDevice1Connected tag which, after the script is evaluated, contains information regarding the OPC device connection status and is linked to the Active Text component placed in the visualization window.

In addition, the Define script which is executed at the thread initialization is defined via the Script Manager. This script defines the procedure which evaluates the tag quality (it is more effective to define a procedure than to write the code directly into the script's body). The script reads the Random_UInt1 tag value with the RTag.GetTagValue method. Each method of the Reliance objects sets the value of the RError.Code property. If the value of this property is not equal to zero, an error occurs. To ensure that 'Bad' quality of the value is considered an error, the Treat invalid tag value as error option must be enabled (Project Options > Scripts > Other). The procedure is called from the UpdateOPCDeviceCommStatus script with the period of one second.

06/19/2009

Download

OPC_EmbeddedServer is a project designed to demonstrate how to connect Reliance's runtime software to an OPC server which is not running locally. The EmbeddedDevice1 device of type OPC is defined via the Device Manager. The OPC server Prog ID property allows you to select the OPC server for the device (e.g., from the local network). The PC1 computer, to which EmbeddedDevice1 is connected, is defined via Project Structure Manager. On the Driver page of the device's Channel1, the Connect to driver property is set to On remote computer. Also the computer name is specified (EmbeddedDevice1). The EmbeddedDevice1 computer is the second computer defined via the Project Structure Manager. This computer's only purpose is to identify the remote computer on which the OPC server is running. It holds the IP address of the OPC server (the Basic page).

Note: This type of connection to a remote OPC server is not advised because of certain drawbacks. The recommended way to connect to an OPC server is via Reliance's runtime software running on the remote computer. This means that the Reliance data server is running on the same computer as the OPC server and connection to other computers of the visualization project is provided via Server Connection Groups or via thin clients.

06/19/2009

Download

Teco_Databox is a project designed to demonstrate how to transfer data from/to the Databox memory of the Teco device. Via the Device Manager, the Tecomat1 device of type Teco and its IP address are defined. On the Databox page, the Enable reading/writing Databox option is active and the links to the respective tags defined within the System device are specified. The following tags are defined within the System device: The Control of type Byte tag is used to control the data transfer from/to the databox (0 – ready, 1 – read, 2 – write). The Status tag of type LongInt is connected to the Active Text component placed in the visualization window and indicates the activity which is being performed with the databox (Ready/Reading/Reading completed/Read error/Writing/Writing completed/Write error). The DataLength and DataOffset tags are used to define the range of data to be transferred from/to the databox. The current data range is accessed via the DataBuffer tag of type Array of Byte.

The visualization window contains a Data Grid component (Databox data) which displays the values of the DataBuffer tag and the corresponding index of the data in the databox (the IndexArray tag). The latter tag is automatically updated in the InitIndexArray script every time the databox is accessed (read or written).

06/19/2009

Download

Teco_ModemComm is a project designed to demonstrate how to make a connection to the Teco PLC via a modem connected to the computer's serial port. Within the System device, several tags of type Word are defined to monitor and control the state of the modem and the PLC device. The Modem1Control tag is used to control Modem1 – it connects the Combo Box component placed in the visualization window and the Modem1 object defined via the Project Structure Manager (on the Basic page, the Control property must be active and the tag specified). The Tecomat1Control tag is used to control Tecomat1 (allows selecting one of the following commands: Disconnect, Connect, 'Connect, read data and disconnect') – it connects the Combo Box component placed in the visualization window and the Channel1 object defined via the Project Structure Manager. The Tecomat1Status tag, which is also connected to the Channel1 object, is processed in the Tecomat1StatusChanged script and the result is shown in the visualization window. The Tecomat1Status tag is linked to the Status property via the Project Structure Manager (Tecomat1 > Channel1 > Advanced). Similar tags exist for Modem2 and Tecomat2. Also, the Tecomat1 and Tecomat2 devices and the required tags are defined via the Device Manager.

Through the Project Structure Manager, the Channel type of the Tecomat1 device is set to Dial-up (modem), the required Phone number is specified, and the Tecomat1Control and Tecomat1Status tags are connected on the Advanced page. In the Modems folder, the Modem1 object is defined and the Modem1Control tag is connected to the Control property of this object. The Tecomat1StatusChanged script is defined via the Script Manager. The script uses bit masking to extract information about the Tecomat1 device's state from the Tecomat1Status tag. Similar objects are defined for the Tecomat2 device.

06/19/2009

Download

Embedded Objects

Type

Project name

Edited

Download

The BoilerRoom_WindowTemplate project demonstrates using data structures and window templates. The visualization represents a boiler room with a gas boiler. Information related to particular devices (e.g. pump and burner), measured quantities (water and air temperature), and control parameters is arranged into data structures (Pump, Burner, MeasuredTemperature, ControlParameters - see the Data Structure Manager). These elementary structures are then contained in more complex data structures: Boiler and BoilerRoom.

Based on the data structure BoilerRoom, structured tags named Data are defined within the devices BoilerRoom1 and BoilerRoom2 (see the Device Manager). Then there are window templates corresponding to data structures Pump, Burner, MeasuredTemperature, and ControlParameters. These elementary templates are then contained in more complex templates (Boiler and BoilerRoom). The template BoilerRoom is then repeatedly used in normal visualization windows (BoilerRoom1, BoilerRoom2). Each time the template is used, the respective structured tag of type BoilerRoom must be specified.

06/19/2009

Download

Network Applications

Type

Project name

Edited

Download

BoilerRoom_MobileClient is a project based on the BoilerRoom demo. The project is designed to run on the PDA devices – it contains visualization windows (PDA - Overview, PDA - Trends, and PDA - Boiler) designed for a limited resolution. The windows can be viewed on mobile devices via Reliance Mobile Client (program designed to run on the Windows CE/Windows Mobile operation system with .NET Compact Framework 2.0 installed). You can also test the example in a Windows CE emulator.

You can find the computer (configuration/node) named PDA in the Project Structure Manager (all required objects such as user, trend, report, and data table are connected to this computer). On the Display page, the Initial window property of this computer is set to PDA - Overview. It specifies the first shown visualization window.

To access the visualization project on a mobile device, the device must be able to connect to the data server via a network connection. In this example, the data server computer is named Server1. All scripts run on the server computer and, in a real application, it would be connected to the PLC device. Before you can start the data server (Reliance Control Server or Reliance Server), export the PDA computer via the Project > Export for Remote Users command. If the data server is started, connect to its Web page from the PDA device and install the Reliance Mobile Client program files to the mobile device. For additional information, refer to the Reliance Mobile Client documentation.

06/19/2009

Download

BoilerRoom_MultipleServers is a project which adds a second server computer (Server2) to the BoilerRoom_ClientServer project. Server2 communicates to the BoilerRoom2 device. In this case, Server1 only communicates to the BoilerRoom1 device.

This project demonstrates how to configure a client computer to access data from both servers at the same time. The most important thing is creating two server connection groups for Client1 through the Project Structure Manager. Each group contains one server connection (Server1, Server2). To avoid displaying the top tray on the Server1 and Server2 computers, the TopTray window is disabled on the Display page (Disabled windows). To run the project, create shortcuts by using the Project > Create Shortcut command (for Client1, use Reliance Control, for Server1 and Server2, use Reliance Control Server).

06/19/2009

Download

BoilerRoom_ClientServer is a project which adds the network functionality to the BoilerRoom demo. A new computer named Client1 is added to the project through the Project Structure Manager. The already defined users, trends, and reports are connected to this computer (objects are only accessible from a specific computer if they are connected to it). In addition, a New Server Connection Group with a New Server Connection (Server1) are created. The Server computer property is set to Server1. This connection is used to connect the BoilerRoom1 and BoilerRoom2 devices and the same-named data tables to the Client1 computer (the Data transfer property is set to Network instead of Direct and directories for the data tables are set to $(HistoryData)\Client1\). The Address property (Server1 > Basic) is set to 127.0.0.1, which is the local address (if you want to run the example over the network, set this property to a real IP address or hostname).

The server part of the project should run in Reliance Control Server. The Computer name property should be set to Server1 (Project Options > Runtime > Start and Shutdown). The client part of the project should run in Reliance Control (set the Computer name property to Client1).

06/19/2009

Download

BoilerRoom_RedundantServers is a project which adds a second server computer named Server2 (a standby server) to the BoilerRoom_ClientServer project. A new client computer named Client2 is also added. The two new computers were added by duplicating the original configurations through the Project Structure Manager. A second server connection (pointing to Server2) is added to the Servers server connection group of the Client1 and Client2 computers. The connection priority is set so that Client1 is primarily connected to Server1 and Client2 is primarily connected to Server2. If one of the servers is not available (e.g., Server1 is terminated), Client1 automatically connects to the Server2 computer. If a client is not connected to its primary server, the availability of the primary server is periodically tested. At runtime, you can see the connections on the Network connections page in the System Information window.

06/19/2009

Download

ThinClientListFromScript is a project designed to demonstrate how to access the list of connected thin clients from a script. After the project is started in the runtime software, the main window contains a Display component with the number of connected thin clients (the ThinClients_Count tag) and a Data Grid component with detailed information about all connected thin clients. The Data Grid component is connected to array-type tags which are periodically updated in the GetThinClientList script. The script is started every 5 seconds and uses the RWS.GetThinClientList method to load the information about the thin clients to the ClientList array. Subsequently, this information is transferred to the array-type tags (ThinClients_xxxx) to be displayed by the Data Grid component.

06/19/2009

Download

ThinClientRequestHandlingFromScript is a project designed to demonstrate how to handle requests from thin clients (Reliance Web Client or Reliance Mobile Client). In the Web section of the Project Options dialog box, there is the HandleThinClientRequest script set to be executed when a thin client request is received by a data server (Reliance Server or Reliance Control Server). The client's request information (request type, unique session identifier, client IP address, etc.) is obtained using the RScr.GetCurrentScriptDataEx function. This information is written to the corresponding tags in the System device. The values of these tags are shown in Display components in the visualization window.

08/05/2010

Download

Reports

Type

Project name

Edited

Download

CustomReport_AVG is a project designed to demonstrate how to use a custom report of type FastReport to access an SQL database and to display a data grid containing hourly average values based on this data. A sample tag named ActFlow is defined via the Device Manager. The SQL type data table defined via the Data Table Manager is used to log the values of the sample tag. The SQL server is named (LOCAL)\SQLEXPRESS. It is a standard name set when Microsoft SQL Server 2005 Express Edition is installed with setup.bat.

Two custom reports are defined through the Custom Report Manager. The CustomReport_RealData object is used to display all historical data. The CustomReport_AVG object is used to calculate and display the sample tag's hourly average values for the last 24 hours. The ADODatabase component is used to make a link between a custom report and an SQL database. You have to set the database parameter of the ADODatabase component in the same way as the Connection string in the Project Options > Project > SQL dialog. The values from the data table are accessed via a dynamically generated SQL query (the query is generated in the FastReport script).

At runtime, you can change the tag value logged into the database and preview the reports via the corresponding buttons.

12/01/2011

Download

CustomReport_ADOChart is a project designed to demonstrate how to use a custom report of type FastReport to access an SQL database and to draw a trend based on this data. The TimeRange_From and TimeRange_Till tags (used to specify the time range) are defined via the Device Manager. A sample tag of type Word is also defined. The SQL type data table defined via the Data Table Manager is used to log the values of the sample tag. The SQL server is named (LOCAL)\SQLEXPRESS. It is a standard name set when Microsoft SQL Server 2005 Express Edition is installed with setup.bat.

A custom report named TemperatureReport is defined through the Custom Report Manager. The ADODatabase component is used to make a link between a custom report and an SQL database. You have to set the database parameter of this component in the same way as the Connection string in the Project Options > Project > SQL dialog. The values from the data table are accessed via a dynamically generated SQL query (the query is generated in the FastReport script).

After the SQL connection is properly configured, you can start the project in the runtime software. Log some records in the database (the value of the word-type tag is logged into the data table every 6 seconds). Select the Time range and display the custom report via the Show Report button.

10/06/2009

Download

CustomReport_ADOChart is a project designed to demonstrate how to use a custom report of type FastReport to visualize data from an SQL database in the form of a data grid. The project contains three virtual devices defined via the Device Manager. Each of this devices contains five tags (Tag1, ..., Tag5). Also, three SQL-type data tables are defined via the Data Table Manager. Each of this tables contains items corresponding to the tags in the virtual devices and has different settings of the Time stamp base property.  The SQL server is named (LOCAL)\SQLEXPRESS. It is a standard name set when Microsoft SQL Server 2005 Express Edition is installed with setup.bat.

Three custom reports designed to display data from the corresponding virtual devices are defined via the Custom Report Manager. The reports differ in the way the time stamp is decoded. Depending on the way a time stamp is logged, the Int64TimeToDateTime or UTCDateTimeToLocalDateTime conversion function is used. The ADODatabase and ADOTable components are used to make a link between the custom report and the SQL database. You have to set the database parameter of the ADODatabase component in the same way as the Connection string in the Project Options > Project > SQL dialog.

At runtime, you can set the tag values logged into the database and preview the reports via the corresponding buttons.

06/19/2009

Download

CustomReport_EquithermalCurve is a project designed to demonstrate how to print an equithermal curve via a custom report of type FastReport. To define the equithermal curve, fourteen tags are defined via the Device Manager. A custom report of type FastReport named Report1 is defined through the Custom Report Manager – the items of this report correspond to the tags defined within the System device. You can edit the report template via the Edit Report command. The template file is located in the <Project>\Main\CustomReports folder. At runtime, you can change the tag values in the visualization window using the Equithermal Curve or Display components.

The following script is used to draw the trend in the FastReport template:

ECChart.SeriesData[0].XSource :=VarToStr(<TempA$6>)+';'+VarToStr(<TempB$7>);

ECChart.SeriesData[0].YSource :=VarToStr(<TempEkvA$10>)+';'+VarToStr(<TempEkvB$11>);

06/19/2009

Download

CustomReport_Form is a project designed to show how to use a custom report of type FastReport to print a simple form. The main visualization window contains a form assembled of several Edit Box components. The components are linked to the corresponding tags defined within the System device. The CustomReport_CertificateOfPosting object is defined through the Custom Report Manager and contains items corresponding to the tags from the System device. At runtime, you are enabled to enter values to the form. To switch among the Edit Box components, use the Tab button. To preview and/or print the form, press the Display button. The project also demonstrates the use of multilanguage support. It is localized into Czech and English. If you switch the language of the project, the language is also changed in the text strings of the custom report.

06/19/2009

Download

CustomReport_HTML is a project designed to demonstrate how to use a Web page as a template for the custom report. The project contains several sets of tags organized to folders according to the technological unit (see the Device Manager). A Web custom report named WebReport is defined via the Custom Report Manager. The custom report contains items connected to the corresponding tags from the System device. The custom report template files are located in the <Project>\Main\CustomReports folder. This folder also contains a Microsoft Office Word document which is a source for the custom report template. The visualization window contains several components forming a table. You can set the tag values via this table.

06/19/2009

Download

CustomReport_Text is a project designed to demonstrate how to use a text custom report. Within the System device, five tags which contain water level values in tanks are defined. The TextReport custom report is defined via the Custom Report Manager. The custom report contains five items linked to the corresponding tags from the System device. The file Template.txt (custom report template) is located in the <Project>\Main\CustomReports folder. At runtime, you can set the tag values and generate the text report based on the current values.

06/19/2009

Download

Scripts

Type

Project name

Edited

Download

The AutomaticUserLogOff project demonstrates how to automatically log off the current user off the runtime software after a certain time of mouse and keyboard inactivity. The "LogoffUser" script defined in the Script Manager logs off the current user by calling the RUser.LogoffUser method. In order for the script to be run after a certain time of inactivity, some parameters in the project's main file (the one with a .rp4 extension) must be altered. The project's main file is a text file which can be opened for example with the Notepad program (Notepad.exe). The parameters are stored in a section named [Section50] and have the following meaning:

Param0 - inactivity time period (in milliseconds) after which the script (specified by Param2) should be run

Param1 - whether the script specified by Param2 should be run (0 - disabled, 1 - enabled)

Param2 - ID of the script to be run

Note: The script ID is displayed in the bottom left corner of the "Select Script" dialog.

Example:

[Section50]

Param0=20000

Param1=1

Param2=10

01/26/2011

Download

The DeclareArrayVar project shows how to define and use the global and local array variables. Main visualization window contains two buttons that start the UseGlobalVar and UseLocalArray scripts.

Event script named 'Define' that declares the global variable GlobalArrayVar1 is defined in the Script Manager. This script is executed only once and prior to all other scripts, because the parameter "Run on thread initialization" on the Advanced page is enabled (the script is also executed upon a possible forcible termination of the thread ). Each global array variable has to be declared only once to avoid the "Type mismatch" error.

The UseGlobalArrayVar script writes the data to a global variable named GlobalArrayVar1 whereas the UseLocalArray script modifies only a local variable named LocalArrayVar declared inside the DoSomethingWithLocalArrayVar procedure.

06/19/2009

Download

The DownloadAndSaveFile project shows how to download and save the file defined by an URL to a local computer. The project's main functionality is done in the 'DoDownloadAndSaveFile' script. This script downloads the file based on the string values of the 'FileURL' and 'FileName' tags. The 'FileURL' tag is linked to a display component in the visualization window and defines the source file name and address (the URL has to be entered with the leading "http://"). The 'FileName' tag is linked to the second display component and defines the target file. To start the script press the 'Download file' button.

The CreateObject command is used to create and instance of the "MSXML2.XMLHTTP" object. The 'open' and 'send' methods of this object are used to make the connection. The file is saved to the disk via methods of the "ADODB.Stream" object.

06/19/2009

Download

The ExtractBits project shows how to use scripts to extract bits from an integer tag and store the bit values in tags of type Bool.

In the Device Manager, there are the following tags defined within the "System" device:

"Status01" of type Byte, "StatusBits01" of type "StatusBits" which is a data structure (defined via the Data Structure Manager). The tag "StatusBits01" is a structured tag and contains several nested tags of type Bool to which a script will write the value of the respective bits of the tag "Status01".

In the Script Manager, you can find a script named "Define" that contains the definition of the procedure "ExtractBits". The script "Define" has the "Run on thread initialization" option active in order to execute prior to any other script supposed to run in the same thread of execution (the "Advanced" page of the "Properties" pane). The procedure "ExtractBits" is called from a script named "ExtractBitsFromStatus" which executes every time that the data of the tag "Status01" changes (see the properties of the script "ExtractBitsFromStatus"). The following parameters are passed to the procedure "ExtractBits":

Name of the device in which the source tag is defined: "System"

Name of the source tag: "Status01"

Name of the device in which the target tag is defined: "System"

Name of the target tag (including the character used to separate a structured tag and its nested tags): "StatusBits01/"

Array containing the numbers of bits to extract: BitNumbers_StatusBits01 = Array(0, 1, 4, 5)

Array containing the names of the fields of the data structure "StatusBits" (in the same order as bit numbers in the array BitNumbers_StatusBits01): TagNames_StatusBits01 = Array("ManualMode", "EmergencyMode", "CheckDevice", "Error")

To display the data of structured tags of type "StatusBits", the same-named window template is used (see the Window Manager). This template contains Display components linked to particular fields of the structure "StatusBits". The template is embedded into the window "MainWindow" through a Container component. The window also contains a Display component that displays the value of the tag "Status01" and enables you to change it.

The solution described above has proven to be very convenient. There may be many tags like "Status01" each of which contains status information on a machine used in the industrial process being visualized. It is very easy to add a new structured tag of type "StatusBits", a new script, and call the procedure "ExtractBits" with the respective parameters.

06/25/2010

Download

The GetCurrentScriptDataEx project shows how to pass a parameter from the Reliance system to the script and how to access it inside a script. The ScriptParamValue LongInt type tag, defined in the project, is linked to a display component. The EventScript script defined in the Script manager is linked to three buttons located in the visualization window. If you click the button, the number associated with the button is passed to the script, accessed inside the script, stored in the ScriptParamValue tag and shown in the Display component located below.

06/19/2009

Download

The GetFolderContents project demonstrates how to list the contents of a directory. The main visualization window contains the Display component (enter the name of a directory you want to list), the Button component (which starts the GetFolderContents script) and the two Table components. After the script is finished, the table to the left shows subdirectories and the table to the right shows the file list.

The GetFolderContents script defined in the Script manager uses the "Scripting.FileSystemObject" object to get the directory listing. The SubFolderNames and FileNames array tags are populated with the names of subfolders and files in this script. The SubFolderCount and FileCount tags hold the length of the respective lists.

06/19/2009

Download

The LogMessage project is designed to show you how to log a text to a file form a script. The main visualization window contains a button, that starts the 'LogMessageTest' script, that contains the 'LogMessage' procedure. This procedure is defined in the 'Define' script (also the functions for custom date and time formatting are defined in this script).

Access to the file is done via object named "Scripting.FileSystemObject", the "OpenTextFile" method of this object is used. If this method is called with the filename as a parameter, a new object is created (the numerical parameter defines the opening method, 1 – read only, 2 – write, 8 – append, and the logical parameter defines whether the file should be created if it doesn't exist). Now you can call the 'WriteLine' method of this object and write an arbitrary text to the file.

If the button in the main visualization window is pressed, a new directory named 'Logs' is created in the <Project> directory. The "ScriptLog.txt" file is created in this directory. The file contains the lines with a current date, time and example text.

06/19/2009

Download

The MoveTagElementValues project demonstrates how to use an event script to copy the first 10 elements from WordArray20 array to the positions 50-59 in the WordArray100 array. The RTag.MoveTagElementValues method is used to copy the values of array type tags. The script is started via a button in the visualization window.

06/19/2009

Download

The MoveTagValue project demonstrates how to copy a tag value between two devices. The project contains the AfterStartProject script. The script starts on the Runtime software start (see "Project options > Scripts > Other > After start project"). This script initializes the DataTime tag. The remaining scripts are event scripts linked to the buttons in the main visualization window. The scripts show how to use the 'RTag.MoveTagValue' method for the tags of different type. Visualization window contains the Display components showing values of source and target tags.

06/19/2009

Download

The ScriptDebugging project requires a debugging tool installed on your computer. You can use the Microsoft Skript Debugger application (it is shipped with the Reliance system as a part of the Add-On Pack). The visualization window contains two buttons that enable/disable script debugging function (this is done in the window registry via actions that execute the "ScriptDebuggerEnabled.reg" and "ScriptDebuggerDisabled.reg" files). Runtime program has to be restarted before the change takes place. Since the Reliance 4.1.3 you can also enable/disable the script debugging function via "Environment Options" in the development environment. If the debugging is enabled and the "Start script" button is pressed, the debugging tool is opened.

11/12/2009

Download

The ScriptTypes project demonstrates usage of the different script types. The main visualization window contains five panes, each demonstrating features of one script type. The first pane introduces the "Data change" script – if you change the value of A or B, C is automatically recalculated. The second pane introduces the "Periodic" script – the angle value is periodically incremented. The third pane introduces the features of the "Key" script – if you press the F5 button a dialog window is shown (all scripts run in the same thread and therefore other scripts are paused if the dialog is shown).

The fourth pane introduces the "Condition" script – if you enter a number bigger than 10 into the display component, the dialog window is shown. The last pane introduces the "Event" script – the buttons are linked to the binary tags. Alarm/event is defined and starts if the tag value changes from logical 0 to logical 1. A script is linked to the event of Alarm/event start. The script reads the text of this alarm and shows it in a dialog window.

06/19/2009

Download

SendEmail is a project designed to demonstrate how to send an email message from a script. Before any email can be sent, you have to set the information about the SMTP server. This can be done via the Project Structure Manager on each project computer's E-mail page. The main visualization window of the project contains Display components where the email's recipient, subject, attachments, and body can be specified. The Send Email button is used to activate the script which sends the email. The core part of the script is the RInet.SendMail method.

06/19/2009

Download

| Top |