Академический Документы
Профессиональный Документы
Культура Документы
Table of Contents
Exercise 1 - Simple ACE calculation ............................................................................................................. 5
Objectives ......................................................................................................................................... 5
Introduction ....................................................................................................................................... 5
Exercise ............................................................................................................................................ 5
Step-by-step solution ........................................................................................................................ 8
Exercise 2 - Pump statistics part one ....................................................................................................... 16
Objectives ....................................................................................................................................... 16
Introduction ..................................................................................................................................... 16
Exercise .......................................................................................................................................... 16
Step-by-step solution ...................................................................................................................... 19
Exercise 3 - Pump statistics part two ....................................................................................................... 24
Objectives ....................................................................................................................................... 24
Introduction ..................................................................................................................................... 24
Exercise .......................................................................................................................................... 24
Step-by-step solution ...................................................................................................................... 27
Exercise 4 - Using PI ACE Manager ........................................................................................................... 32
Objectives ....................................................................................................................................... 32
Introduction ..................................................................................................................................... 32
Exercise .......................................................................................................................................... 32
Step-by-step solution ...................................................................................................................... 35
Exercise 5 - The PI Module DataBase ........................................................................................................ 41
Objectives ....................................................................................................................................... 41
Introduction ..................................................................................................................................... 41
Exercise .......................................................................................................................................... 42
Step-by-step solution ...................................................................................................................... 44
Exercise 6 - The Power of Multiple Contexts -- part 1................................................................................. 52
Objectives ....................................................................................................................................... 52
Introduction ..................................................................................................................................... 52
Exercise .......................................................................................................................................... 52
Step-by-step solution ...................................................................................................................... 55
Exercise 7 - The Power of Multiple Contexts -- part 2................................................................................. 62
Objectives ....................................................................................................................................... 62
Introduction ..................................................................................................................................... 62
Exercise .......................................................................................................................................... 62
Step-by-step solution ...................................................................................................................... 65
Exercise 8 - Deploy an ACE module ........................................................................................................... 73
Objectives ....................................................................................................................................... 73
Introduction ..................................................................................................................................... 73
Exercise .......................................................................................................................................... 73
Step-by-step solution ...................................................................................................................... 76
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 1
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 2
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 3
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 4
Objectives
Use the ACE wizard to build the code and register the calclulation
Introduction
This is a simple calculation to get familiar with the process of building ACE modules.
Conceptually, this could compare to a switching valve that redirects two input flows
towards the output depending upon the status of the valve.
Exercise
Part A
Open Visual Studio 6 or Visual Studio .Net and create a new calculation
PI server name: localhost
PI ACE Executable name: Class_Ex1
PI ACE Class Module name: Valve
Part B
Use the following tag as input and outputs
Tag
ACE usage
Description
BA:Active.1
Input
Valve status
Flow1
Input
Flow2
Input
Flowout
Output
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 5
Part C
Use the following logic to write the appropriate code.
Part D
Debug, test and register your calculation to run every 10 seconds with normal
priority. Validate the result of your calculation with a graphical display in PI
ProcessBook
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 6
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 7
Step-by-step solution
Part A
1. Open VB6 or VB .Net and select the New option in the PIACEWizard
menu.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 8
Part B
1. Select input and output tags
Part C
1. Write the code needed in VB .Net
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 9
Part D
1. Debug your calculation in VB .Net (press F5 for step by step line
processing in VB .Net 2003 or F10/F11 in VB .Net 2005).
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 10
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 11
3. Test your module (VB. Net and VB6 will exhibit the same user interface)
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 12
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 13
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 14
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 15
Objectives
Use the PIACE methods to calculate an operating time and an average consumption
Introduction
The goal of this exercise is to calculate daily statistics about a pump. Given the
instantaneous consumption and the state of the pump, we would like to derive its
daily operating time in hours and its running cost. We also need to validate data
quality to make sure our calculations make sense.
Exercise
Part A
Open Visual Studio 6 or Visual Studio .Net and create a new calculation
PI server name: localhost
PI ACE Executable name: Class_Ex2
PI ACE Class Module name: Runtime
Part B
Use the following tag as input and outputs
Tag
ACE usage
Description
Pump:Consumption
Input
Instantaneous Watts
Pump:Operation
Input
Pump status
Pump:Runtime
Output
Pump:Costs
Output
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 16
Part C
Use the following logic to write the appropriate code.
The uptime is evaluated when the pump status is Active and accumulated
from 12:00AM to current time (Hint: use the .TimeEQ method)
The total cost from 12:00AM to current time can be estimated by multiplying
the average consumption by the price of electricity, which is about
7.23cents/KWh, and by the total time elapsed since midnight (Hint: use the
.Avg method and the time functions PIHour and PIMinute).
Our cost estimate will not be realistic if the data for the consumption is not
good. Make sure that at least 95% of the data has good quality, otherwise
write a Bad data status to the cost (Hint: use the .PctGood method).
Part D
Debug, test and register your calculation to run every minute with normal priority.
Validate the result of your calculation with a graphical display in PI ProcessBook
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 17
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 18
Step-by-step solution
Part A
1. Open VB6 or VB .Net and select the New option in the PIACEWizard
menu.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 19
Part B
1. Select input and output tags
Part C
1. Write the code needed
Use PIHour() and PIMinute() to get the total elapsed time (number of
hours). We are rounding the uptime to the minute.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 20
3. Or in VB .Net
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 21
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 22
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 23
Objectives
Use the PIACE methods to calculate the number of starts for that pump
Introduction
Following the previous exercise, we would like to calculate the number of starts for
this pump. A start is defined as the transition from the Inactive status to the
Active status.
Exercise
Part A
Open Visual Studio 6 or Visual Studio .Net and create a new calculation
PI server name: localhost
PI ACE Executable name: Class_Ex3
PI ACE Class Module name: Starts
Part B
Use the following tag as input and outputs
Tag
ACE usage
Description
Pump:Operation
Input
Pump status
Pump:Starts
Input
Pump:Starts
Output
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 24
Part C
Use the following logic to write the appropriate code.
On new event for the pump status, you need to validate the previous status of
the pump (Hint: use the .PrevVal method)
If the hour of the previous timestamp is greater than the hour of the current
timestamp (trigger event), you need to reset the number of start to 0 because
we have just crossed over midnight (Hint: use the .PrevEvent, PIHour and
PIMinute methods)
Part D
Debug, test and register your calculation to run every minute with normal priority.
Validate the result of your calculation with a graphical display in PI ProcessBook
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 25
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 26
Step-by-step solution
Part A
1. Open VB6 or VB .Net and select the New option in the PIACEWizard
menu.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 27
Part B
1. Select input and output tags
Part C
1. Write the code needed
Use .PrevVal to get the previous value and .PrevEvent to get the previous
timestamp
If the number of start doesnt need to be updated, make sure to force the
value to be identical.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 28
3. Or in VB .Net
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 29
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 30
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 31
Objectives
Introduction
The PI ACE Manager is a utility tool used for monitoring and modifying properties of
any ACE Context, ACE Module or ACE Executable on any PI 3.3 Server. It can also
allow the users to start and stop the calculation of any PI ACE components.
Exercise
Part A
Start PI ACE Manager and consult all PI ACE Statuses. Toggle between
ACE 1.x or ACE 2.x depending upon the type of platform you used to
develop your modules (VB6 or VB.Net).
Set the default display to the platform you use the most.
Part B
Part C
Change the Message Log Level for SimpleCalc to all types of messages and
look for new messages in the PI server log file using PI SMT3.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 32
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 33
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 34
Step-by-step solution
Part A
1. Start the PI ACE Manager by selecting PI ACE Manager from the Start /
Programs / PI System.
2. As the PI ACE Manager screen will appear, notice that the left pane is a
tree view of all PI ACE Executables, Modules and Contexts stored on a
given PI Server. Multiple PI Servers can be added for display.
Notice the structure:
First Level:
PI Server (localhost)
Second Level:
Executable (MyACE)
Third Level:
Modules (SimpleCalc)
Fourth Level:
3. The right pane displays information for any selected item in the left pane.
Explore items on the left pane and consult the information supplied on the
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 35
Note 2:
Note 3:
If an Executable has more then one module, they are all going to
stop/start when the take out of service or resume calculation
functions are used.
3. From the PI ACE Manager, select the SimpleCalc Module on the left
pane. Choose the Take out of service option from the Module Menu. In
the right pane, the SimpleCalc module is now Out of Service but MyACE
executable is still on. Resume Calculation on the SimpleCalc module by
selecting it and by running the command from the Module menu. In the
right pane, the statuses for the executable and the module should be On.
Note 1:
Note 2:
4. From the PI ACE Manager, select in the left pane the context named
localhost for the module Units under the executable Performance. From
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 36
Note 2:
Note 3:
Since a module can have more than one context, only the selected
context selected will be stopped/started while the module is still
running.
Part C
1. Select localhost context from SimpleCalc module. From Context Menu,
select Edit Schedule and Priority command or right click on localhost and
select Edit Schedule and Priority.
2. Change the priority of this calculation to High with the Priority combo box.
Change the clock based calculation to a natural based calculation by
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 37
3. Again, using the localhost context, select from the Context menu or by
right clicking the Message Log Level command to get the following
window:
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 38
5. Select Pump:Consumption from Input tags. Through the tag menu or right
click menu, select the Edit Tag Options.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 39
6. Use the Clamping combo box and select Both to restrict the min and max
values of the consumtion to the tags zero and (zero + span) respectively.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 40
Objectives
Introduction
The goal of this exercise is to create a structure in the PI ModuleDatabase with
modules, aliases and properties that would represent a small chemical plant called
Myplant.
Page 41
Exercise
Part A
Start the PI ModuleDataBase Editor and create the structures of modules, aliases
and properties according to the following table.
PI module
Parent Module
Aliases
Properties
Name
Name
Name
Tag
Name
Type
Value
MyPlant
PI ModuleDB
--
--
--
--
--
SectionA
MyPlant
Unit11
SectionA
Flow
BA:LEVEL.1
Design
Double
65
Part B
Import the existing structure with PI MDB builder and use it to create the others units
and section.
PI module
Parent Module
Aliases
Properties
Name
Name
Name
Tag
Name
Type
Value
Unit12
SectionA
Flow
SINUSOID
Design
Double
32
Unit66
SectionA
Flow
CDT158
Design
Double
80
SectionB
MyPlant
Unit34
SectionB
Flow
BA:CONC.1
Design
Double
45
Unit37
SectionB
Flow
CDEP158
Design
Double
12
Part C
Insert linked modules for Unit11 and Unit12 under module SectionB using the PI
MduleDB Editor.
Part D
Open the ProcessBook PDI named Class_Ex5.PDI and select different unit in the
tree view to update the trend with the tag linked to the corresponding alias.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 42
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 43
Step-by-step solution
Part A
1. Open the PI Module DataBase Editor from the Start menu.
2. Expand and select the PI Module DB module and create a new module by
right clicking and selecting New PIModule...
3. Enter the module name MyPlant and click Save and Close.
4. Create the module SectionA repeating steps 2 and 3 while module MyPlant is
selected.
5. Create the module Unit11 repeating steps 2 and 3 while module SectionA is
selected.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 44
corresponding
tag
name
8. Create a new property by right clicking in the PI Properties tab on the right
hand side of PI Module DataBase Editor.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 45
10. Here is what you should obtain (right-click to show alias & properties values)
Part B
1. Open MS Excel and go to the PI-SMT/MDBBuilder/Import Items menu.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 46
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 47
8. Use the export menu (select the module MyPlant) to update the structure.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 48
Part C
1. Select module Unit11 and copy it.
2. Select module SectionB and paste a linked module by right clicking and
choosing Insert Linked Module "Unit11"
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 49
Part D
Open the ProcessBook PDI named Class_Ex5.PDI and select different units in the
tree view to update the trend with the tag linked to the corresponding alias.
Part E
Open the ProcessBook PDI named Class_Ex5.PDI and select different units in the tree
view to update the trend with the tag linked to the corresponding alias.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 50
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 51
Objectives
Use PI ACE Wizard to create and register a new calculation using aliases for inputs.
Introduction
In this exercise, we want to monitor the input flow for each unit we have created in
exercise 5. We want to write an alarm status in a string whenever the rate of change
of the flow over the last 10 minutes is greater than 25% of the average of the flow
for the same period. The calculations are scheduled every 2 min. and offset by 15
sec. from each others.
Exercise
Part A
Open Visual Studio 6 or Visual Studio .Net and create a new calculation
PI server name: localhost
PI ACE Executable name: Class_Ex6
PI ACE Class Module name: Contexts
Part B
Use the following context \\localhost\MyPlant\SectionA\Unit11
Use the following items as input and outputs
Alias
ACE usage
Description
flow
Input
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 52
ACE usage
Description
Flow_alarms
Output
Part C
Use the following logic to write the appropriate code.
You need to evaluate the rate of change of the flow and compare it to the
average (Hint: use the .Range and .Avg methods)
The text of the alarm is as follow: High changes in flow name_of_tag .You
may declare a local string variable to build the text message (Hint: us the
.Tag method)
Part D
Debug, test and register your calculation to run every 2 minute with normal priority.
Add the others contexts using the ACE Manager to run your module against all
units. Validate the result of your calculation with a graphical display in PI
ProcessBook
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 53
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 54
Step-by-step solution
Part A
1. Open VB6 or VB .Net and select the New option in the PIACEWizard
menu.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 55
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 56
Part C
1. Write the code In VB6
1. Or in VB .Net
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 57
Part D
1. Debug and test your calculation
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 58
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 59
4. A PI ProcessBook display showing the input data (alias flow) along with
your calculated output string tag (Flow_Alarms). Noticed that we use the
same tag to report alarms for all the flows. One alarm tag for each flow
could have been used.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 60
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 61
Objectives
Use PI ACE Wizard to create and register a new calculation using aliases for inputs and
outputs.
Introduction
In this exercise, we want again to monitor the flow of each unit we have created in
exercise 5. We want to set the questionable flag of the value to true if the value is
smaller than the limit set by the corresponding property in the PI ModuleDB.
Exercise
Part A
Open Visual Studio 6 or Visual Studio .Net and create a new calculation
PI server name: localhost
PI ACE Executable name: Class_Ex7
PI ACE Class Module name: Property
Part B
Use the following context \\localhost\MyPlant\SectionA\Unit11
Use the following items as input and outputs
Alias
ACE usage
Description
flow
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 62
Declare and set a PIModule variable to the module used as the current
context (Hint: use the GetPIModuleFromPath function)
Retrieve the value of the PIProperty called Design (Hint: Use the
.PIProperties() method of a PIModule variable)
Compare the current value to the design value and set the questionable flag
to true if the value is smaller (Hint: use the .IsQuestionable method)
In VB .Net, you will need to add a reference to the PISDK (COM reference)
and import it.
Part D
Debug, test and register your calculation to run every minute with normal priority and
an offset of 8 sec. Add the others contexts using the ACE Manager to run your
module against all units. Validate the result of your calculation with a graphical
display in PI ProcessBook
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 63
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 64
Step-by-step solution
Part A
3. Open VB6 or VB .Net and select the New option in the PIACEWizard
menu.
Part B
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 65
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 66
Part C
2. Write the code In VB6
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 67
Part D
5. Debug and test your calculation
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 68
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 69
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 70
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 71
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 72
Objectives
Develop a simple ACE module using your neighbors computer as the main PI server
Introduction
In this exercise, we want to simulate a development environment where the user is
not working on the PI server. To do so, you will connect to another PI server and
use it as your reference for developing the ACE module.
Exercise
Part A
Create a PI connection to your neighbors computer
Part B
Open Visual Studio 6 or Visual Studio .Net and create a new calculation
PI server name: neighbors computer
PI ACE Executable name: student_firstname
PI ACE Class Module name: Deploy
Part C
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 73
Tag
ACE usage
Description
sinusoid
Input
Random value
aceout
output
--
Part D
Use the following logic to write the appropriate code.
Part E
Debug and test your calculation. Deploy it on your neighbors computer and register
it to run every minute with normal priority. Validate that your module runs correctly
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 74
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 75
Step-by-step solution
Part A
Part B
1. Define your module server and name
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 76
Part C
1. Create a new output tag named aceout
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 77
Part D
1. Write the code needed In VB6
Part D
1. Debug your calculation and test your module
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 78
Part E
1. Copy/paste the folder of your new module from your computer to your
neighbors computer
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 79
3. Add your neighbors computer in your ACE manager and browse to your
new module to register it
4. Start your module and validate that there are no error message and that
the aceout tag has a value (you can use SMT3 to browse tag on a
different server)
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 80
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 81
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 82
Objectives
Use a module level variable to keep last snapshot value for a trigger tag
Use the UserDefinedTermination routine to write a specific status and message when ACE
stops
Introduction
In this exercise, we would like to compare the current snapshot of our trigger tag
with the previous snapshot and write the result in a string tag.
We also want to write the state "ACE stopped" for our output tag when the
calculation is stopped. At the same time, a message should be logged by the PI
Message subsystem.
Exercise
Part A
Create a new digital state named ACE stopped" in the SYSTEM set for state
315.
Then create a new PI ACE Module with the following properties (using the PI
ACE Wizard in VB .Net):
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 83
Part B
For any new event of the tag DataSource, write in the tag SnapUpdate a string
containing the date and time of the event, the previous and the current value of the
snapshot of DataSource.
Hint 1: use a module level variable to store the snapshot value from calculation to
calculation;
Hint 2: use the UserDefinedInitialization routine to first initialize the variable that
will store the snapshot value from one calculation to the next.
Hint 3: you can include the PITimeServer library to help converting the execution time.
Part C
In the UserDefinedInitialization routine, write code to log the process ID of your
calculation at startup.
Hint 1: you can include the System.Diagnostics library;
Hint 2: use the .ID property of the object process.
Part D
In the UserDefinedTermination routine, write code to force a value of ACE
stopped"in the output tag SnapUpdate and log the following User message: "ACE
Calculation has been stopped"
Part E
Test and start/stop the module to see if the code performs as expected. Verify the
PI system log with PI SMT3.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 84
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 85
Step-by-step solution
Part A
1. Using PI Point Builder or PI SMT, create a string tag named SnapUpdate.
2. Using PI Point Builder, add the state ACE stopped at state 315 in the SYSTEM
table.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 86
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 87
I
2. Initialize this variable to the current value of DataSource
3. Write the date, time, old and new values of the snapshot
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 88
Part C
1. Make sure you have added the System.Diagnostics reference. Then get the
process ID and log a message to the PI message log
Part D
1. Add the code to the ModuleDependentTermination to write the ACE stopped
status and log a message in the PI server.
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 89
The information contained in this guide is confidential and may be subject to revision.
No part of this publication may be reproduced or transmitted, in any form or by any
means without prior permission of OSI software.
All rights reserved, OSI software Inc. 2006
Page 90