Quantcast
Channel: OSIsoft Users Community
Viewing all 1120 articles
Browse latest View live

Testing notifications with predefined data sets

$
0
0

Hi, sometimes some of my notifications do not behave as expected and I have spent a lot of time to find why simply because I have always worked with live (real-time) data, and therefore I have had to wait for the right triggering conditions to occur in order to debug them and to try new settings.

 

So, my question is if it is possible to run and test notifications on predefined data sets in order to check their behavior in a "controlled environment".

If this is possible, I would appreciate if someone suggests me some guidelines about how this can be implemented.


ProcessBook - Show tag descripton in tooltip

$
0
0

Hi!

 

When I pass the mouse over a value in ProcessBook a tooltip with Average, minimum, maximum, etc, is shown (please, see an example in the attached file). I would like to show in this tooltip the tag's description as well. That way my user will be able to know what is that value.

 

Is there any way to do such a thing?

Attached Images

  • Sem título.png

Excel datalink "average" thru VBA

$
0
0

Hello,

 

For some reasons, I won't be able to use datalink formulas in my sheet, so I have to do everything thru VBA.

I am trying to implement this formula.

=PIAdvCalcExpVal("('piTAG')";"25/08/14 02:00:00";"25/08/14 05:00:00";"average";"time-weighted";"interpolated";"60m";0;1;0;"piServer")

And I am using this code

    Dim srv As Server
    Dim pt As PIPoint
    Dim val As NamedValues
    Dim dtI As New PITimeFormat
    Dim dtF As New PITimeFormat

    Set srv = Servers("piServer")
    Set pt = srv.PIPoints("piTAG")

    dtI.InputString = CStr("25/08/2014 02:00:00")
    dtF.InputString = CStr("25/08/2014 05:00:00")
    
    Set val = pt.DATA.Summaries(dtI, dtF, btInside, asAverage, 3)
    Dim point As PIValues
    Set point = val("Average").Value

But I can't access the final value for this average over the time. I just want one value, like the formula gives me.

the "point" variable doesn't give me the value, only three properties: Count (3), Direction (dForward) and ReadOnly(false).

 

What am I doing wrong?

 

How to sum a value per day using expressions

$
0
0

I need to creat an expression using DATA SET that sum the day's maximum values from the begining of the month until now. How can I do it?

Visual Studio 2013 data transfer

$
0
0

Have a nice day everyone,

 

I am really new about PI server and also Visual Basic. It is my hobby to make little programs. we are using PI but i really dont know which version or etc. I just want to transfer a tag's current value to visual basic form. Do you know the way or do you know any tutorial related with this issue ? thank you for your time and answers.

 

Element Relative Display

$
0
0

Hi guys,

 

I am having one motor running status tag in every child element ,but that is in boolean data type.Now i have created one Element relative display,based on that child elements.When i am changing the child element selection based on that Status tag it have to Show " Running " or "Not Running" in String format in PB display.I knew that using PE it can be done.But i dont like to prefer that method because in that method i have to create separate tag for every status Tag. Is there any way to do that in any other way?.Thank you very much for spend your time and answers in advance.

Excel VBA - Late Binding x Early Binding

$
0
0

Hello!

 

Here I am again, looking for help at the only place on internet where people really know about PI :)

 

I have a code (Excel VBA) that starts like this:

Dim srv As Server
Dim pt As PIPoint
Dim ptd2 As IPIData2
Dim val As NamedValues
Dim pv As PIValues
Dim dtI As New PITimeFormat
Dim dtF As New PITimeFormat

The problem is that when I run this Excel Workbook on a computar that doesn't have PI installed, it gives me an compilation error. Since it's not a runtime error, I am not able to handle this error.

 

What I think it could be a solution is to do late binding, so I would do something like this

Dim srv as Object
set srv = CreateObject("PISDK.Server")

So it will give me an runtime error and I will handle it and show an proper error message.

 

How can I do this? Which objects should I create for each one of my variables?

 

Thank you!

Get data from tags without object

$
0
0

Dears:

 

is there a function or procedure to gte values from tags but without objects(like trends, value etc), if there is who can help me with this.

thanks!!!!

 

 

 


What else can cause Header Data Mismatch if not corrupted archive?

$
0
0

Dear Please help Expert

 

i received error status: "[-11002] Record Header Data Mismatch".

 

Then

 

I unregistered the archive, make a copy & run the command.

 

E:\PI\bin>piarchss -if E:\piarch_2013-03-11_17-06-15.arc -of  E:\20130311.repair  

After register the new archive, its still giving the same Record Header Data Mismatch error.

 

Then

I run the command

E:\PI\adm>pidiag -archk E:\20130311.repair > e:\log2.txt

 

It seems like there is no corruption in the archive. What else can cause Header Data Mismatch if not corrupted archive?

 

When I try

E:\PI\bin>piarchss -if E:\piarch_2013-03-11_17-06-15.arc -of  E:\20130311B.repair -f 0 

 

Fatal error in PI subsystem piarch_offline: Failed to load input or initialize output offline-archive-file, status: [-15030] generic mismatch

 

ProcessBook Screens

$
0
0

I have developed the two PB Screens. In first  PB Screen I have kept five buttons .Those five buttons means five different location .Each location had  10 Attributes and 10 child elements .Each child element had 15 attributes .Now my requirement is when I am clicking the button in that first Screen, it have to open Second Screen . In Second Screen I have to display Each location attributes value and Child elements value .

 

So I displayed the location attributes directly using Tags .For child elements I had displayed using Element relative display.Every Location had same set of attributes .Each locations Child elements had same set of attributes.If I am using the above method means I have to create 5 screens to display. So I don’t like to do that .Is there any method to do that  with single screen ?Thank you very much for your time and answers in advance.

bom('*') vs monthly('*')

$
0
0

When using a totalizer. What is the difference in result expression between using bom('*'') and monthly('*') when getting the results of a tag starting at the beginning of the month until current time

Setting default value for a PI tag

$
0
0

All,
 
   I want to set a default value for a PI tag (instead of 'Pt Created') when it is first created.For ex: NA or -999999. Is there a way to set the default value? I did set a default value in the template but that doesn't work. Please see the image attached.
 
Thanks,
Arti

Attached Images

  • PITag.GIF

Coresight - multiple instances

$
0
0

I am looking to install Coresight in addition to the PI systems we have in place. I am considering having 2 instances of Coresight but have not come across any documentation on this subject. The installation steps does suggest that it is possible. If anyone would like to share their exprience or advise in this area or on the configuaration below. Thanks.

 

- The 2 Coresight sites installed on 2 web servers.

- The 2 Coresight databases for the sites on the same MS SQL Server.

Alternate Between Displays

$
0
0

I'm new here and new to any VBA work.  I am running a process display (.pdi) on a large tv, displaying the contents of the single display on fullscreen.  It includes a trend and several values.  I don't have room to add trends for more information, as the data would be too small to see. 

 

How do I create a second display file (.pdi), with the trend I also want to display on my tv, and alternate between the two displays for, say 15 seconds each.  I just want it to switch back and forth between two displays and potentially others if requested. 

 

Thanks for any info or recommendations.  I don't know the timer code I'm going to need.  I would like to start the timer upon opening the original .pdi and then just switch between the two.

PI WEB API 401 error

$
0
0

Hi,

 

I'm trying to display PI data in an ASP.NET (C#) site on a flot (3rd Party) chart.

 

I have IIS installed on a virtual server, with PIWEBAPI installed also. I can browse the PI Web API through the server and I have access so no trouble with permissions. 

 

I'm connecting through a download string of: "https://ochil.pulse.local/piwebapi/streams/P0kbw8-mOkqEm5YsuTg5RZ7gAi0AAAQlJBRVJJQUNIXFNJTlVTT0lE/recorded"

 

(Ochil being the server, pulse the network)

 

This is just to bring sinosoid data into a flot chart and establish a connection and verify that it can be done.

 

my simple code is here:

 

http://pastebin.com/z0nVymPf

 

http://pastebin.com/FU5rCpEm

 

http://pastebin.com/kq4Yyt0d

 

all the code should do is take the download string and return the recorded data into the flot chart on the asp.net application.

 

I get a 401 unauthorised error with the download string causing the error

 

Any help would be greatly appreiciated! 

 

Thanks

 

James :)

 

 

 

 

 

 

 


Get all points

$
0
0

Hi All,

     I want to develop an .net (c#) application to get all point (with a criteria) from a server. I create the following code. But this only work if I have a timer object created, if not,  i dont receive any data. Do you know how to do it without use the timer object?

 

Thanks,

 

pointList =

new PISDK.PointList();

pointList = _piserver.GetPoints("Tag='*Service Hours'", status);

timer1.Enabled =true;

 

 

private void timer1_Tick(object sender, EventArgs e)

{

ShowResults();

}

 

 

private void fShowResults()

{

 

object sNada="";

 

string s = "";

 

if (status.Status == PISDKCommon.CallStatusConstants.csCancelCompleteWithErrors || status.Status == PISDKCommon.CallStatusConstants.csCompleteWithErrors)

{

s = status.Result.ToString();

}

 

else

{

 

 

foreach (PISDK.PIPoint pt in pointList)

{

sNada = pt.Name;

listBox1.Items.Add(sNada);

 

// MessageBox.Show("aa->" + pt.Name);

}

timer1.Enabled = false;

 

if (_piserver.Connected)

fCerrarPI();

}

}

 

Performance equation to calculate the 4th thursday of November

$
0
0

Hi guys,

 

I'm trying to calculate a performance equation to identify the Thanksgiving day (the 4th thursday of November). I can't find a function like this:

  • WeekDayMonth(n, weekday, month, year)

For example: If we know the day of 4th (n=4) thursday (weekday=5) of current november (month=11, year=2014)

  • WeekDayMonth(4, 5, 11, 2014) = 27/11/2014

Is there any way to calculate this in a PE?

 

Is there any API for PEs to make this function and deploy it in a PI server?

 

The final PE could be:

 

if ParseTime("*")  = WeekDayMonth(4, 5, 11, Year("*")) then 1 else 0

 

Thank you in advance

Pi tab on ribbon MS Excel

$
0
0

I had made various changes and upgrades to system. Now Pi add-in and SMT add-in show up under add-ins tab in menu command group. Is there a way to get the Pi tab back on the ribbon.

 

 

Changing mimics in full view without selecting in AF structure

$
0
0

Hello there! We have created an identical mimics with different tags using AF structure. Now, we want to see it in 100% view but we dont want to select to AF structure to change the data. How to create a link in the mimic itself to change from graphic to graphic without selecting in AF structure.

 

For example.

 

Gas Turbine

-GT # 1

-GT # 2

-GT # 3

 

HRSG

-HRSG # 1

-HRSG # 2

-HRSG # 3

 

Thanks.

Create Calculated Dataset and Add To Trend (VBA)

$
0
0

 I am trying to create a new calculated dataset in VBA and then programmatically adding it to an existing trend.

 

Using the example in VBA Language Reference help, I came up with this code:

  Dim MyDatasets As Datasets
  Dim MyDataset As PIExpressionDataset
  Dim MyDataPoints As DataPoints
  Dim MyDataPoint As DataPoint
  Dim MyPlaceHolders As Placeholders
  Dim MyPlaceHolder As Placeholder
  Dim MyColumn As String
  Dim MyColumns As Columns
  Dim MyDisplay As Display
  Dim MyDisplays As Displays
  Dim MySymbols As Symbols
  Dim MyTrend As Trend
  Dim MyTrace As Trace
  Dim Application As Object
  
  Set MyDatasets = Application.Datasets
  Set MyDataset = MyDatasets.Add("NewCalc", Nothing, True, 1, True, pbDatasetPIExpression)
  Set MyDataset = MyDatasets.GetDataset("NewCalc")
  MyDataset.Expression = "If TagVal('TAG','*') = DESIREDSTATE Then 'TAGTODISPLAY' Else NoOutput()"
  MyDataset.RefreshInterval = 3600
  MyDataset.ColumnName = "Value"
  MyDataset.Interval = "10m"
  MyDataset.Description = "Calculated Dataset"
  MyDatasets.SetDataset MyDataset

  Set MyPlaceHolders = MyDataset.Placeholders
  Set MyPlaceHolder = MyPlaceHolders.Item(1)
  MyPlaceholder.SetValue("Value1", pbcPlaceholderText)
  Set MyColumns = MyDataset.Columns
  MyColumn = MyColumns(1)
  Set MyDisplays = Application.Displays
  Set MyDisplay = MyDisplays.Item(1)
  Set MySymbols = MyDisplay.Symbols
  Set MyTrend = MySymbols.Item("Trend1")
  MyTrend.AddTrace (MyColumn)
  MyTrend.CurrentTrace = "MyTrace"
  Set MyDataPoint = MyTrend.DataPoint
  Set MyPlaceHolders = MyDataPoint.Placeholders
  Set MyPlaceHolder = MyPlaceHolders.Item(1)
  MyPlaceHolder.Value = "NewValue"

However, I encounter multiple errors with this. I'm not all that sure my dataset I create is completely valid. 

It doesn't like the syntax MyPlaceholder.SetValue line, it is requiring an expression of the form MyPlaceholder.SetValue() = __.  Also, VBA is saying the I haven't defined what a trace was (Dim MyTrace As Trace).  The final major issue I am having with this is the last line (MyPlaceHolder.Value = "NewValue") is saying "Can't assign to read-only property". 

 

 

Could someone help me come up with a functioning VBA code to get the dataset into a graph?

Viewing all 1120 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>