Training Exercises

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

ProViewDS

ProViewDS Support Team

Revision 2 ©2016 Copyright DYNICS, Inc.


Copyright Notice

©2016 DYNICS, Inc. All Rights Reserved.

No part of this publication may be reproduced in any form or by any means – electronic, mechanical,
photocopying, recording or otherwise – without prior permission in writing from DYNICS, Inc.

ProViewDS and ProView Mobile are brands of DYNICS.

Microsoft® is a registered trademark of Microsoft Corporation, in the United States and/or other
countries.

All other brands or names are property of their respective holders.

Disclaimer of Warranties and Liability

The information contained in this document is for information purposes only. You assume full
responsibility for the appropriate use of information contained herein, and use of associated software.

While DYNICS takes pride in providing accurate and up-to-date information about software product
installation and use, this document may contain omissions or inaccuracies. Without limiting the
foregoing, DYNICS, Inc. disclaims any and all warranties, expressed or implied, including the warranty or
merchantability and fitness for a particular purpose. DYNICS, Inc., including its officers, directors,
employees or agents, does not warrant or guarantee the accuracy or completeness of its information or
services, and specifically disclaims liability for any damages, including special or consequential damages,
arising out of the user of such information or software, even if DYNICS, Inc. has been advised in advance
of the possibility of such damages. The user of the software described and the information contained
herein is subject to the DYNICS, Inc. standard license agreement, which must be executed by the buyer
or user before the use of the software or such information.

8/22/2016 ProViewDS – Training Exercises 2


Contents
Contents ........................................................................................................................................................ 3

Displays and Layouts ..................................................................................................................................... 4

Exercise 1 .................................................................................................................................................. 4

Exercise 2 .................................................................................................................................................. 6

Exercise 2.1 ........................................................................................................................................... 6

Exercise 2.2 ........................................................................................................................................... 9

Devices ........................................................................................................................................................ 14

Exercise 3 ................................................................................................................................................ 14

Alarms ......................................................................................................................................................... 16

Exercise 4 ................................................................................................................................................ 16

Exercise 5 ................................................................................................................................................ 19

Trend ........................................................................................................................................................... 21

Exercise 6 ................................................................................................................................................ 21

Datasets ...................................................................................................................................................... 27

Exercise 7 ................................................................................................................................................ 27

Report ......................................................................................................................................................... 31

Exercise 8 ................................................................................................................................................ 31

Build, Publish and Tracking ......................................................................................................................... 33

Exercise 9 ................................................................................................................................................ 33

8/22/2016 ProViewDS – Training Exercises 3


Displays and Layouts
Exercise 1

Goal: Create the Menu display with 7 buttons to switch between the project’s displays.
This menu should look like the figure below:

1. Click on the Draw environment.


2. Click on the icon in the top toolbar to create a new display and change the name
to “Menu”.
3. Change the background color as shown below:

8/22/2016 ProViewDS – Training Exercises 4


4. Change the Width to 124 and the Height to 708.

5. Click on the icon in the Draw toolbar to create a new button.


6. Draw a button in the display like this:

7. Click on the button and change the Text property in the Button to “Main”.

8. Double-click on the “Main” button to Open the dynamics configuration


9. Configure the Shine dynamic dialog as shown below:

8/22/2016 ProViewDS – Training Exercises 5


10. Click on the icon on the top toolbar for the Display Preview.
11. Close the Display Preview.
12. Copy the “Main” button 6 times and change the Text on the buttons to:
Device
Alarm OnLine
Alarm History
Trend
Dataset
Report
14. Select all 7 buttons using the Shift key
15. In the bottom toolbar, click on the icon to Align Left and on the icon to
Vertically Space Evenly.

Exercise 2

Goal: Create the Main display. It will simulate two areas where the temperature is increasing
and we need to use two fans to stabilize or to decrease the temperature.
Exercise 2.1

Goal: Create a new symbol

1. Right-click in the current display and select Insert Symbol.


2. Select “Fan” from the Category list.
3. Choose the RotateBlower2 symbol and click on the “Close” button.

8/22/2016 ProViewDS – Training Exercises 6


4. Insert the RotateBlower2 in the display by moving your mouse to the display page and
clicking anywhere.
5. Right-click on the symbol and click on Unmake symbol.
6. You have now two pieces of the fan, double-click on the blades of the fan to configure
the rotation in the Dynamics settings

Tips & Tricks


Use #ParameterName to create a parameter which will be set for each symbol. As shown above,
we are creating the parameters “Control” and “Rotate”. So that, when you insert this symbol,
you will be able to set those parameters. Also, after “:” you can create a default value.
“#Control:Client.SimulationDigital” is creating a parameter called “Control” which has
“Client.SimulationDigital” as the default value.

7. Create an ellipse to be the fan background.

Tips & Tricks


On the bottom toolbar you can find the options to move the objects to either the front or back
of the others.

8. Create a Text Output just below the fan and configure the dynamic output as shown
below:

8/22/2016 ProViewDS – Training Exercises 7


9. Select all the objects you have created to make your fan, right-click and select “Make
new Symbol”.

10. Configure your new symbol like this:

8/22/2016 ProViewDS – Training Exercises 8


11. To use your new symbol, just right-click on any display, click “Insert Symbol…” and
select the symbol you want. You can double click on the inserted symbol to set its
parameters.
Exercise 2.2

Goal: Create the main display

1. Click on the Edit environment and Tags section.


2. On Objects tab, create the tags as shown below:
Name Type Parameters Array
area Integer
temperature Integer 2
fan2Enabled Digital 2
fan1Enabled Digital 2

3. Click on Draw environment and click on the icon in the top toolbar to create a
new display.
4. Configure the new display in the DisplaySettings as shown below:

8/22/2016 ProViewDS – Training Exercises 9


5. Right-click in new display and select Insert Symbol.
6. Choose the “FanTraining” symbol you created in the previous exercise and click the Ok
button.
7. Using others symbol from the library and the new FanTraining symbol, draw the
MainPage display as shown below:

8. Configure the comboBox as shown below:

8/22/2016 ProViewDS – Training Exercises 10


9. Configure the gauge symbol as shown below:

10. Configure the new FanTraining symbols as the figures below:


Fan 1

8/22/2016 ProViewDS – Training Exercises 11


Fan 2

12. Configure the Switch symbols as the figures below:


Switch 1

8/22/2016 ProViewDS – Training Exercises 12


Switch 2

13. In the “Codebehind” tab, configure the DisplayIsOpen function as below:

public void DisplayIsOpen()


{
if(@Tag.temperature[@Tag.area] < 100) {
@Tag.temperature[@Tag.area] += 1;
}

if(@Tag.fan1Enabled[@Tag.area] == 1) {
@Tag.temperature[@Tag.area] -= 1;
}

if(@Tag.fan2Enabled[@Tag.area] == 1) {
@Tag.temperature[@Tag.area] -= 1;
}

if(@Tag.temperature[@Tag.area] <= 0) {
@Tag.temperature[@Tag.area] = 0;
}
}

14. Go to the Menu display.


15. Add the Dynamics Action to the Main button and set the action to OpenDispay =
“MainPage”.
16. Click on the Edit environment and the Displays section.
17. Click on the Layouts tab.
18. Configure the Startup layout as shown below:

8/22/2016 ProViewDS – Training Exercises 13


Devices
Exercise 3

Goal: Create a communication driver using the “Modbus Master – TCP and RS232” protocol over
TCP/IP interface.
1. Click on the Edit environment and the Tags section.
2. Create the tags shown below:
Name Type
modbus000001 Digital
modbus000002 Digital
modbus000003 Digital
modbus400001 Integer
modbus400002 Integer
modbus400003 Integer

3. Click on the Edit environment and the Devices section.


4. Click on the Channel tab.
5. Click on the “Create New…” button.
6. Select the “Modbus Master – TCP and RS232” protocol.
7. Select the TCP interface and click the Ok button.
8. Double-click on the ProtocolOptions cell and switch the encoding to RTU TCP.
9. Click on the Nodes tab.
10. Type “modNode” in the Name cell.
11. Select the modbus channel in the “Channel” cell and configure the PrimaryStation.
12. Press the Enter key to accept the configuration.
13. Click on the Points tab and configure as shown below:

8/22/2016 ProViewDS – Training Exercises 14


TagName Node Address DataType AccessType
Tag.modbus000001 modNode 000001 Native ReadWrite
Tag.modbus000002 modNode 000002 Native ReadWrite
Tag.modbus000003 modNode 000003 Native ReadWrite
ag.modbus400001 modNode 400001 Native ReadWrite
Tag.modbus400002 modNode 400002 Native ReadWrite
Tag.modbus400003 modNode 400003 Native ReadWrite
14. Click on the Draw environment and create a new Display called “DevicePage”.
15. Set the Width and Height to 900 x 708. This display should look like:

16. Go to the “Menu” display.


17. Add the Dynamics Action to the Device button and set the action to OpenDisplay =
“DevicePage”.

8/22/2016 ProViewDS – Training Exercises 15


Alarms
Exercise 4

Goal: Create an Alarm Online to show the real-time alarms.


1. Create a new Tag as configured below:

Name Type
FilterAlarm Text

2. Click on the Edit environment and the Alarms section.


3. Create two new alarm groups in Groups tab as configure as shown below:

Name AckRequired Sound Show LogEvents


Warning No None List Active
PayAttention Yes Beep List All

4. Click on the Items tab and configure the items as shown below:

TagName Condition Limit Group Message


Tag.temperature[2] Lo 20 Warning Area 2 -­­ Temperature is Lo
Tag.temperature[2] Hi 80 Warning Area 2 -­­ Temperature is Hi
Tag.temperature[1] Hi 80 Warning Area 1 -­­ Temperature is Hi
Tag.temperature[1] Lo 20 Warning Area 1 -­­ Temperature is Lo
Tag.temperature[2] HiHi 90 PayAttention Area 2 -­­ Temperature is HiHi
Tag.temperature[2] LoLo 10 PayAttention Area 2 -­­ Temperature is LoLo
Tag.temperature[1] LoLo 10 PayAttention Area 1 -­­ Temperature is LoLo
Tag.temperature[1] HiHi 90 PayAttention Area 1 -­­ Temperature is HiHi

5. Click on the Draw environment and create a new display called “AlarmOnlinePage”.
6. Click on the icon to draw an AlarmWindow object in the display and configure it as
shown below:

8/22/2016 ProViewDS – Training Exercises 16


Note: the FILTER input filed
has curly brackets around the
tagname. Ex. {Tag.FilterAlarm}
The reason for that is this field
is a TEXT (STRING) field; if you
want to embed dynamic tag
values on that string they
should be inside the brackets.
If you put the mouse over the
field, the tooltip will always
show what is the expected
syntax to that field.

7. Add the other elements to the display to make the AlarmOnlinePage display look like the
figure below:

8/22/2016 ProViewDS – Training Exercises 17


8. Configure the filters buttons with:
All

Alarms

Warning

8/22/2016 ProViewDS – Training Exercises 18


9. Configure the Dynamics of the “Ack All” button with the Action ToggleValue as
“Alarm.AckAll”.
10. Configure the Dynamics of the “Turn Off Beep” button with the Action ToggleValue as
“Client.AlarmBeepOff”.
11. Go to Menu display.
12. Add the Dynamics Action to the Alarm OnLine button and set the action to OpenDispay =
“AlarmOnLinePage”.

Exercise 5

Goal: Create an Alarm History to show the history of alarms.


1. Create two new tags as shown below:

Name Type
StartDate DateTime
EndDate DateTime

2. Click on Draw environment and create a new display called “AlarmHistoryPage”.


3. Click on icon to draw an AlarmWindow object in the display and configure it as
shown below:

8/22/2016 ProViewDS – Training Exercises 19


4. Right-click on icon and choose the Date picker control to select the start and end
date.
5. Configure the display as shown below:

6. Configure the Date picker and DateTimeTextBox control as shown below:


StartDate

EndDate

6. Go to the Menu display.


7. Add the Dynamics Action to the Alarm History button and set the action to
OpenDisplay = “AlarmHistoryPage”.

8/22/2016 ProViewDS – Training Exercises 20


Trend
Exercise 6

Goal: Create a Trend to show the real-time values.


1. Click on the Edit environment and the Tags section.
2. Click on Templates and create a new Template called “Trend”.
3. Configure the members below in the Trend template.
Name Type Parameters
ref Reference Integer
cursor Double
pen Integer

4. Create the new tags below:


Name Type Parameters Array
trend Trend 2
cursorposition Double

cursorDateTime DateTime

5. Click on the Historian tab.


6. Create a new Historian table called “SaveOnChange” and configure as shown below:

7. Configure the Historian as shown below:


TagName HistorianTable
Tag.temperature[1] Historian.Table.SaveOnChange
Tag.temperature[2] Historian.Table.SaveOnChange

8. Click on the Draw environment and create a new display called “TrendPage”.

8/22/2016 ProViewDS – Training Exercises 21


9. There are two options to draw a Trend object under the icon: a Trend Window and a
Trend Window Legacy. Create one of each on the display and configure them as below:
Trend Window
a. Configure the TrendWindow as shown below:

b. The object should look like the figure below:

8/22/2016 ProViewDS – Training Exercises 22


Trend Window Legacy

Note: Generally, the Trend Window is recommended over the Trend Legacy, however, the Trend
Legacy works with iOS, while the Trend Window does not.

a. Configure the LegacyTrendWindow as shown below:

b. In the top right corner, check the box “Cursor Enable” and click on “Settings”
c. Your cursor settings should be configured as below:

8/22/2016 ProViewDS – Training Exercises 23


d. The object should look like the figure below:

10. Create two Combo-Box objects on the display and configure them as below:
Combo-Box1 – Pen1

Combo-Box2 – Pen2

8/22/2016 ProViewDS – Training Exercises 24


11. Click on CodeBehind tab and configure as shown below:

private TTrendWindow trendLegacy;


private TTrendChart trend;

public void DisplayOpening()


{
if(trendLegacy == null) {
trendLegacy = CurrentDisplay.GetControl("Trend1") as TTrend-
Window;
}
if(trend == null) {
trend = CurrentDisplay.GetControl("TrendTemperature") as
TTrendChart;
}
if(trendLegacy != null) {
trendLegacy.Opacity = 0.4;
}
if(trend != null) {
trend.Opacity = 0.4;
}
}

12. Create a rectangle above the Trend Legacy as shown below

13. On the rectangle Dynamics, set the MoveDrag like the figure below:

8/22/2016 ProViewDS – Training Exercises 25


14. Go to Menu display.
15. Add the Dynamics Action to the Trend button and set the action to OpenDispay =
“TrendPage”.

8/22/2016 ProViewDS – Training Exercises 26


Datasets
Exercise 7

Goal: Create a Database and a DataGrid to see to see the data.

1. Select the “Edit” environment and the Tags section.


2. Click on “Templates” and create a new template called “Employee”.
3. Configure the members below in the Employee template.

Name Type
Admission DateTime
Name Text
Identification Integer

4. Create the new tag below:

Name Type
Employee Employee
5. Using the Windows Explorer, go to <ProViewDS installation folder> \pv-2014.2
6. Run the TDatabaseBuilder.exe
7. Click on the File menu and New Database. Call it “Training”.
8. Right-click on Tables and click on New Table. Call is “Employees”.
9. Configure three columns, as shown below:

10. Save it (by default it will be saved in the user’s documents).


11. Click on Data in the Employees table and insert some data for each column.

12. Go back to ProViewDS, click on the Edit environment and the Datasets section.
13. Click on DBs tab and on Create new…
14. Select the “TDB 4 direct connection” as the Provider and click the Ok button.

8/22/2016 ProViewDS – Training Exercises 27


15. Double-click on ConnectionString cell and fill the DataSource field with the complete path
of the Training.tdb4 file (it should be located in User -> Documents).
16. Click the Test button.
17. Click on the Tables tab
18. Configure a table name as “TBEmployees”
19. Select the “Provider1” in DB cell
20. Select the “Employees” in TableName cell
21. Configure the Mapping cell as shown below:

22. Click on Draw environment and create a new display called “DatasetPage”.
23. Click on the icon and draw a DataGrid in the display. Configure the DataGrid as shown
below:

8/22/2016 ProViewDS – Training Exercises 28


24. The DatasetPage should look like the figure below:

25. Configure Dynamic Action of the buttons with the ToggleValue command with the
respective Dataset commands:
Dataset.Table.TBEmployees.Select
Dataset.Table.TBEmployees.Next
26. To Export the grid to Excel, create a new button labelled “Export to Excel”
27. Set the new button to run a script on from the Dynamics -> RunScript option
28. Change the “DisplayOpening” method as shown below:

TDataGridWindow grid;

public void DisplayOpening()


{
@Dataset.Table.TBEmployees.SelectCommand();
grid = this.CurrentDisplay.GetControl("MainGrid") as TDataGridWindow;
}

29. In the CodeBehind, create and edit the script as shown below:

8/22/2016 ProViewDS – Training Exercises 29


public void MouseLeftButtonDown1(object sender,
System.Windows.Input.MouseButtonEventArgs e)
{
System.Windows.Forms.SaveFileDialog saveFileDialog1 =
new System.Windows.Forms.SaveFileDialog();
saveFileDialog1.Filter = "Excel files (*.xls)|*.xls";
saveFileDialog1.FilterIndex = 2;
saveFileDialog1.RestoreDirectory = true;
if (saveFileDialog1.ShowDialog() ==
System.Windows.Forms.DialogResult.OK)
{
string path = saveFileDialog1.FileName;
this.grid.GridControl.DataGridObj.ExportToExcel(path);
//here is where we actually export the file
}
}

Important Info
The saved file will be compatible with Excel, however, an alert message might appear depending
on your Excel version. The file will still be accessible. There is also an option to save as “xml”
format. In that case, the user must to open the file by the Excel menu instead of double-clicking
on the file.

30. Go to the Menu display.


31. Add the Dynamics Action to the Dataset button and set the action to OpenDispay =
“DatasetPage”.

8/22/2016 ProViewDS – Training Exercises 30


Report
Exercise 8

Goal: Create a report in XPS format and show it in the display.


1. Create the new tag as shown below:

Name Type
ReportFile Text
2. Click on the Edit environment and the Reports section.
3. Configure as shown below:

4. Click on the TextEditor tab and configure as the figure below:

5. Click on the Draw environment and create a new display called “ReportPage”.

6. Right-click on the icon and select the Report Viewer and add it to the display.
7. Configure the Report Viewer as shown below:

8/22/2016 ProViewDS – Training Exercises 31


8. The ReportPage should look like the figure below:

9. Configure the Save button to run the expression:


Report.Report1.SaveCommand()
10. Go to the Menu display.
11. Add the Dynamics Action to the Report button and set the action to OpenDispay =
“ReportPage”.

8/22/2016 ProViewDS – Training Exercises 32


Build, Publish and Tracking
Exercise 9

1. Click on the Run environment and the Build section.


2. Click on the “Build…” button and wait until finished.
3. Click on the Publish section
4. Click the “Publish” button.
5. Check if the Training _v1.0.trun was created correctly.
6. Click on the Info environment and the Track section.
7. Click on the Changes tab
8. Click on the icon on Top toolbar and type Administrator with no password.
9. Click on “Tracking” comboBox and choose Enabled.
10. Create a new tag and go back to Track and Changes tab
11. Check if the creating tag event was recorded.

8/22/2016 ProViewDS – Training Exercises 33

You might also like