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

Deleting PI tags and compacting archives

$
0
0

Hi

 

we want to remove a redundant site's tags and data from our PI collective.

It is over 10,000 Pi tags in scope.

 

Is the best way to bulk delete the tags to do this in a script and use PICONFIG from the command line?

 

Once we have deleted the tags is there a way to remove the data from the PI archives?

 

Thnaks, Mark


Trying to do PE equivalent in VBA

$
0
0
Hello,

I am trying to formulate a running formulation batch end calculator, which must do all its work in VBA before putting it as a text value in PI. I can do this really easily in Excel and i can get snippets via PI Calcs PE, but now I need to do it all in VBA in PI.

To start, I need to know the start time of the formulation, for this i need to look at the formulation volume when it equals 0. In PI datalink, thats easy, but how to do it in VBA in PI?


Then once i have this time stamp, i then need to get the time stamps of each of the batches as they are passed to the batch volume tag.

Lastly, I then must search between the times of these batch volumes for lab results and add them all up.


I thought I could use PISDK and something like this to start off with to get the formulation volume start time but it just gives me a single large number that keeps on increasing :-(

In PE I can juse use this:
FindEQ('blnd1vol.pv','*','*-2d',1)
But i find i cant use PE in VBA, GRRRRRRRR

So, PISDK I tried this:

Sub Test()
 
 
Dim srv As Server
Dim ipiCalc As IPICalculation
Dim vals1 As PIValues
Dim expr1 As String, StartTime As String, endTime As String
Dim testTimes As Variant, cnt As Long, I As Long
 
Dim bCheck As Boolean, bValCheck As Boolean
 
    StartTime = "*"
    endTime = "*-2d"
    expr1 = "'Blnd1vol.pv'<1"
 
Dim data As pisdk.IPICalculation
Set data = pisdk.Servers.DefaultServer
Set ipiCalc = data
   
Set vals1 = ipiCalc.Calculate(StartTime, endTime, expr1, stRecordedValues, "")
 
Debug.Print vals1(1).Value
 
End Sub
But as you can guess, it doesnt work.


Anyone provide any help or a better way of doing this?

An example of data that I get out of excel
Sample Name    Sample Date        Volume              Density
                       30/11/2014 02:29    0              
Blender A            30/11/2014 04:30   1250                 0.7426
Batch 1                                    2132                   
Blender A            30/11/2014 07:00   3189                 0.7604
Batch 2                                    4296                   
                                              
Sub Batch          1                                2132       0.7426
Sub Batch          2                                2164       0.7604
Quality                                  4296       0.7515

Thanks

How to create performance equation to show crew on 12-hour swing shift?

$
0
0

How to create performance equation to show crew on 12-hour swing shift for 4 crews?

 

Our mill has a 12 hour swing shift with 4 rotating crews (E, F, G, H crews)

 

How could I get this to show the current crew for trending purposes through a performance equation?

 

See attached spreadsheet for schedule.  

Attached Files

PI Processbook: How do you 'fit all', prevent 'open in new window', identify dead links and fix back button for thousands of PI pages?

$
0
0

Hi,

I am very new to PI Processbook and I am trying to fix a few of its functionalities. I would like to know how to:

1) Automatically 'fit all' of the content in the display when a button on the page is pressed.

2) Prevent 'opening in a new window' when a button on the page linking to a display is pressed

3) Determine buttons which are 'dead links' (i.e. existing buttons which are linked to deleted pages)

4) Fix the back button on the browser toolbar (Currently, if I view pages A B C D C in that order, pressing back takes you to page B instead of D).

 

I am already working with 2000+ existing PI displays and so I think maybe add-ins would be the way to go since the solutions should apply to all of the displays. Unfortunately, I am only a beginner VB programmer. Any help on any of these points would be much appreciated.

 

 

How To Loop Through The Values of AF Table Using AFSDK

$
0
0
Greetings to my fellow PI Geeks:
 
I need some help looping through an AF Table. I am not finding answers doing a variety of searches on this topic. In C# I am able to connect to the default AF database and identify the target table. Unfortunately I cannot seem to find out how to parse through it and perform operations using the retrieved values. Here is my function:
 
        public HtmlString parseAndPrintAFTable()
        {
            HtmlString theEnvelopePlease = null;
            string content = "";

            //# Connect to the default AF server:
            PISystems piSystems = new PISystems();
            PISystem thisPISystem = piSystems.DefaultPISystem;

            //# Find and select an AF Database:
            AFDatabase targetAFDatabase = thisPISystem.Databases.DefaultDatabase;

            //# Find and select an AF Table:
            AFTables thoseTables = targetAFDatabase.Tables;
            foreach (AFTable thisTable in thoseTables)
            {
                if(thisTable.Name == "theTargetTable")
                {
                    //# Here is where I need help:
                    foreach (value in theTargetTable)
                    {
                         //# perform operations on the retrieved values:
                    }
                }
            }

            //# Return the data for display in an HTML format:
            theEnvelopePlease = new HtmlString(content);
            return theEnvelopePlease;

        }

Your help with this is appreciated.

 

Top 25 values

$
0
0

Hi, fokes

 

First post and just started learning. I need to create a formula using all historical data to list the top 25 flow values to date including the time stamp. Not sure if this is best done in Processbook or Excel? As this is run only periodically, would it be a performance equation? Didn't see any premade functions like Largest(x1,x2,x3...). Thanks for any ideas.

Update a new PI tag with actual value

$
0
0

Hello,

When you create a tag for the first time its value will show as "Pt Created" until a change in tag value occurs.

I have a system where we get the position indication for some breakers (1=Closed, 2=Open).

These indications will be shown in a picture. Now the problem is that these breakers could be in the current position for months before they change status (Open -> Closed or vice versa). Is there a way to force an update of the value to replace "Pt Created" with the actual value, even if the timestamp is older than Pt created?

 

B.R.

 

Morgan

VBA code to force ProcessBook to open another file

$
0
0

Hi,

 

I am trying to use a code to force processbook to open a file in my server.

 

The users are copying the files from server to their local PC and doing changes on display, and I lose control over the changes.

 

The code I tried using is:

Private Sub Display_Open()

Const path = "\\myserver\processbook\display1.pdi"

Dim d1

    If ThisDisplay.Path <> path Then
    
    Application.ActiveDisplay.Close (True)
    
    Set d1 = Application.Displays.Open("\\myserver\processbook\display1.pdi", True)

End If


End Sub

 What I need: when the user open the file in their PC, the code run and open the display saved in the server and close the display saved in their PC... But when a run the code above, the display is closed and the other display doesn´t open.

 

Have you any idea?

 

Thanks

Allan


Maximum 5 minute average

$
0
0

I apologize if this question has been asked before.

 

Is there a way in PI Datalink to calculate when the maximum 5 minute rolling average of a tag over the course of a set timeframe?  For example, what was the highest 5 minute average of the sinusoid tag yesterday?

 

Thanks

VBA Code to populate Batchview query

$
0
0

Would like vba example of batchview query to return results to excel. want to be able to group on unit, recipe,product, and view about 10 - 20 other tags. Developing average, std dev, max, min and for each of the 10 to 20 tags. Link and corrolate to other odbc data set on batchid. I can do the vba stuff just new to PI BatchView. TIA

Time integration of calculated value

$
0
0

I am trying to perform an energy balance calculation in Process Book.  Given the generation, I want to use a simple calculation to estimate the auxiliary load and than time integrate this value to calculate an estimated auxiliary load MWh.  I can use a calculation like TagTot('Gen','t','*')*24 to do the calculation for generation for which there is an existing tag.  How do I use the TagTot function to calculate MWh based on a calculated value like (0.03*'Gen'+0.3)?

 

 

4 tracce nel trend

$
0
0
Good Morning
I need to include in trend 4 track and have a chance with Comandbutton to eliminate them.
 
I attach files
 
greetings
Pierpaol

Attached Files

Error:UOMs 'cubic foot per second' and 'foot' must belong to the same class.

$
0
0

We have an AF attribute that had UOM as ft3/s. I changed it to ft in the template and checked in the changes. While most of the objects got updated, I see the following error for some of the objects:

 

UOMS 'cubic ft per second' and 'foot'  must belong to the same class.

 

Note: The objects that updated successfully and the one's that have the error above share the same template. The display UOM for object is same as template.

 

Any thoughts?

 

 

 

 

XMLDeliveryChannel for Complex Data Type

$
0
0

Hi,

 

I am using XML Delivery Channel dll to transfer PI data from PI System to Webservices.

 

I could able to transfer data for one record in single http request from PI system to webservice successfully.

 

But my requirement is  to transfer mutiple record simultaneously in one single http request.

 

May be this is example of complex data type. 

 

so My question is how to transfer data for complex data type using XML Delivery channel ?

 

Could anyone please help me to explain me how to do this?

 

Thanks

Pramod

TraceCount in Datalink

$
0
0

Hi all,

 

I am very new here and and very new to Pi, so please forgive my newbie questsions.

I have been trying to automate some reports from Datalink and Process Book using VBA and have noticed some of the functions available in process book do not seem to be available in datalink. For example: TraceCount and AddTrace are not available in my Datalink VBA, is this correct or do i not have the correct reference librarys turned on?

 

If they are not available are there other ways to amend Trends?

 

Cheers

 

Luke


Input from excel file to PI?

$
0
0

Hi,

 

Is there any way to automatic input data from excel files in to PI?

We get a file every week with the same setting on email.

How much manual work will it demand?

 

-A-

How can I change the "connection type" in PI SDK?

$
0
0

Dear all,

 

My PI Server's version is "PI 3.4.390.18".

After the PI SDK has installed in my computer, the default setting of "connection type" is "PI2".

 

The problem is that I can't connect to my PI Server correctly.

Plz help check the attached file,thx! 

 

I wanna ask for the help that if there's a solution or some way to modify the "connection type" into " PI3"?

oOR how can i solve THIS Problem? T~T

 

 

 

Attached Images

  • SDK Error.jpg

I need help for Pirecalc

$
0
0

I must recalculate a tag

 

I have deleted wrong result in the result tag and wrong parameters in the source tag (bad input) with the pipetest the result is correct.

 

I have lauched this but the system not recalculate the tag

pirecalc.png
D:\pi\bin\PIRECALC.exe "/EXECUTE=COV2IDR___0M001_Q, 03-nov-14 10:45:00,04-nov14 13:30:00"
 
 
if you launch this series of commands the system recalculates properly where am I wrong?
 
D:\pi\bin\PIRECALC.exe "/EXECUTE=COV2IDR___0M001_Q, 03-nov-14 10:45:00"
D:\pi\bin\PIRECALC.exe "/EXECUTE=COV2IDR___0M001_Q, 03-nov-14 11:00:00"
D:\pi\bin\PIRECALC.exe "/EXECUTE=COV2IDR___0M001_Q, 03-nov-14 11:15:00"
D:\pi\bin\PIRECALC.exe "/EXECUTE=COV2IDR___0M001_Q, 03-nov-14 11:30:00"
....
D:\pi\bin\PIRECALC.exe "/EXECUTE=COV2IDR___0M001_Q, 04-nov-14 13:30:00"
 
 

  

Attached Images

  • pirecalc.png

editing PI Treeview with attribute parents causes web page to be time out

$
0
0

When I implement PI Webpart, clicking an attribute parents on PI treeview breaks the web part page, and finally the page is to be time out.

Many I know what the root reason is??

 

Please find attached.

Version information is as belows;

 

PI Server Version : PI Server 2012

PI Webpart Version : 2010

Datalink Server Version : 2010

MS Sharepoint Version : MOSS 2010 Enterprise

 

Attached Images

  • Attribute_Parents_error.jpg

Use Didjuntions Operators with Point Type Digital

$
0
0

Hi everyone.

 

I´m triying to configure a PE using 3 tags, which are configurated as Digital In Point Type. The problem is that I´m not able to use disjuntions Operators with this kind of Tags in this way:

 

Equation= 'PE_pru' OR 'PE_pru2' OR 'PE_pru3'

 

This message returned by SMT.

 

Error -2147219650: PI PE syntax error in Expression. [-12315] Performance Equation: Function has bad argument data type.

 

The PE is possible to be configurated as whatever type.

 

The question if there is a function capable to convert Digital Name in an integer or similar in order to be able to use Logical operators or if there is other option to carry out the logical equation.

 

Thanks in Advance.

Viewing all 1120 articles
Browse latest View live