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

Get timed value into vba

$
0
0

Hello All,

 

I just started to use vba an pisdk together.

 

I would like to get timed data from a pipoint into a vba variable.

 

Here is a quick code

 

Option Explicit
Dim srv As Server
Dim pt As PIPoint

Sub main()
Dim point As String
Dim a As Variant
Dim t As New PITimeFormat
Dim j(0) As Date
point = "364-FY-0288-UPV"

Set srv = Servers("xxx")

Set pt = srv.PIPoints(point)

t.InputString = Format(CDbl("4/24/2014 11:29:00 PM"), "dd-mmm-yyyy hh:mm:ss")

a = pt.Data.TimedValues(t)

End Sub

 

(I replaced server name by xxx) It does not work and a window pop up saying "Wrong number of argument or invalid property assigned".

 

Somebody could help me please?

 

Thank you.

 

 


PI Notifications - bulk import of contacts?

$
0
0

Hi all,

 

Is there anyway to bulk import contacts for use with PI Notifications? I am moving my email alerts in to PI, but I don't want to have to manually enter all the email contact details.

 

Also why does the Contacts force you to "search" for entries? Why not have a tree structure so I can zoom around to find the contact I want? More of a minor gripe, not a real question to be answered.

 

To clarify I'm using PI system Explorer 2012 to do all this.

 

Thanks for the help!

 

Col

Delete/Save data with PI-API with HA

$
0
0

Hello guys,

 

In my new journey with pi-api, i've wrote a script (python :D) to recalculate some calculated tags in my system.

I'm using this script directly in one of my servers and the informations of my script was deleted and wrote only on this server.

There are some trick to work with HA + pi-api? Like some function to chose work with buffer?

 

Thanks a lot!

Importing Data from a CSV file

$
0
0

Hello all.

 

I am fairly new to Pi and still trying to learn the systems capabilities. So, please be patient with me.

 

Currently, I am using software to connect to a chromatagraph and retrieve the previous days data for its measurements. When the software runs, it exports the data to a .csv file on the computer that is running the software. What I want to do is have this data imported each night after the nightly data collection session.

 

It is my understanding that I should be able to import the .csv data to our SQL server. From there, I should be able to import the data in to our Pi server. However, all of my searches on information on how to do this has been exhaustive.

 

Does anyone have any good reference material (that is quick and to the point) that I can read that will help me get this project off of the ground?

 

Thank you for your help.

Create a user to edit tag configuration that is not the admin account

$
0
0

Hi All,

 

I've been using the default pi administrators account to do point edits (instrument tag, description, etc) and I want to move away from that and use another account instead so that I can give the other people with PI access permissions their own login for traceabililty (at the moment everything is under the default admin account so you can't see who has changed what).

 

How do I set up the new user account to allow me to edit point configuration details? I've tried the PI user manual and thought I had everything setup but it doesn't work. I've created a new admin user and made it part of the piadmins group. The points I want to edit have their permissions set to ptowner=default pi admin account, ptgroup = piadmins. I thought creating the new user in the piadmins group would allow me to edit the tag configuration as the ptgroup = piadmins group. Am I missing something really simple?

 

Regards

 

Col

PI-Profile... anyone still in this area?

$
0
0

Hi Community,

 

For those that remember PI-Profile, this was a great tool for looking across a great number of like tags and finding outliers by setting up color limits.  This was geared especially for the Paper industry and areas which had a wide 2d product that had multiple measurements across its width.  However use cases extended nicely into comparing similar assets. 

 

I am interested if anyone is still using PI-Profile of old, or have you found a new 3rd party app?  Also if you've grown-your-own I'm interested in that as well.

 

Thanks!

Selecting multiple Pi tags

$
0
0

I know the tag names. How to retrieve only these specific multiple tags by using the serach tool? They do not have a pattern, so I cannot use * kind of search, I want to search by specific tag names.

Discrete Tag State Change Detection

$
0
0

Hi all,

 

New to PI scripting, so I was expecting that someone would give a kick-start.

 

I have to get time stamps of state changes of discrete tags (PLC diagnostics information), for example, in the past one week. Is it possible to do so directly with any function or no? The closest I could come was the sgn function, but it returned the number of hours/minutes for any specific tag which has been greater than or less than any specific value during the specified amount of time. It works with boolean tags as well but not the thing I want. Any help?


A datalink and PI-calc question for the really talented amongst you!

$
0
0

So here is a an issue I have, that i wondered if Pi could solve.
 
I Know in Procbook (and I use this capability) you can make Procbook calcaulate Steam Table data,
this is really usefull for me in the calcaulation of Steam tubine peformance data. In fact i have a "live" ST Heat rate Proc book page.
However for reporting requirments this data really needs to be in an Excel report format, with Average hourly test data used to calcaulate the Steam temps, flows and other information I need.
Gathering this into Excel via datalink is very easy.
Howvever, is there a way to gather enthalpy data as an hourly average, straight out of PI, and into excel, (via datalink) somehow using the "StmSI_hpt" expression available in procbook?
The problem is made worse by the fact this i have to work via a remote server access excell sheet. As the company ISIT security restrictions do not allow me to Directly acces the PI server as it sits on the process network. (please do not inform me of how this is not neccesary, I know its not, but the company ISIT have a policy and will not bend, it took me three years to get remote server access).
Also I understand i can copy and paste all my averages into a seperate spreadsheet then individulally calaulate the steam table data, and then produce the report.
Howevre i would much rather build just one spreadsheet that has direct access to the PI data, so reports are easily built by just entering the test run time and date into a sheet. This way the less knowledgeable in out team can produce the reports without a tedious amount of datashifting, and written procedures.
 
Ok, does anyone have a cunning plan.
 
Ian Fuller

PI Notification

$
0
0

Hi,

 

There is a PI TAG as XXXLASTMSGID, which keeps incrementing. Would like to set up a notification on the AF server (Using PSE), to check if the timestamp of the PI tag XXXLastMSGID isn't matching to the current time, then a notification has to sent.

How to get this done?

 

Created a new child element on the AF server, with data reference as PI Point mapping to the PI Tag XXXLastMSGID. Can view the value but 'm interested only in the timestamp. How to handle this?

 

 

 

 

String Builder not available as a selection from Drop Down in AF

$
0
0

Good morning all,

 

Has anyone seen string builder not be available as a selection when building elements in AF?  Am I missing a checkbox or something somewhere?

 

Thanks in advance,

Scott

Error with calculated value with PI-Datalink

$
0
0

I am working to get the maximum value of a tag, but the following error occurs in Error PI-Datalionk.jpg image.   Any idea of the cause of this error?

 

Thank you in advance.  

Attached Images

  • Error PI-Datalink.JPG

Event Frames - deep dive

$
0
0

Working to see if this scenario is doable using only PI-AF and event frames, no ACE, sorry ACE.

 

When a product is being made (Tag "ProcessState" = 1") I want to go to the midpoint in that time range and use a +/- 20sec window to understand the process variability.

 

The process State of course can be the ActiveTag in the event frame.  And thanks to Ales's hint in the youtube (http://www.youtube.com/watch?v=UbideDwhawg, 2:36) the Duration of the event (in seconds) can be - albeit a truly hidden feature - calculated.

 

But then we get to a limitation of AF in that I can't compute or reference timestamps different then those passed by the parent event frame.  Ideally inside the Event Frame I have attributes:

 - Analysis Start Time = Event Frame Start Time + 1/2 * Duration - 20seconds

 - Analysis End Time =  Analysis Start Time + 40 seconds

 - Variation

        - Pi Point data reference set to standard deviation

 

I was looking for a way to create a child event frame with these analysis start/end times but at least using the Event Frames Generator, which only triggers on PI tags, that also doesn't seem do-able.

 

Ideas community?

 

Migration to PI2014

$
0
0
How can I convert PiCalcVal function in excel into PiAdvCalcVal function without re-writing all of the formulas in an excel sheet when migrating to PI 2014? (64 bit)

I have an older excel sheet with PI 2007 (32 bit) formulae. Now on new 64-bit desktop with PI 2014 on it I´m not able to run this sheet without getting the "#Name?" Ni each cell containing a PiCalcVal. I have to translate it into the new PiAdvCalVal an change several parameters, ie "time-weighted". I´ve noticed there is an PI legacy add-on (COM) on the older desktop. How do I get it installed on the newone?

THANK YOU ALL in advance for your help

Jobs forums

$
0
0

What are good forums for both posting and searching for PI Server Admin positions?  Should that/could that be part of this Community?


PI Datalink Calculation Mode

$
0
0

I frequently encounter large spreadsheets with many individual PI Datalink functions that are incredibly difficult to modify/use.

 

Is it possible to use a programmatic solution to override the "triggered" recalculation even when putting Excel into "Manual" mode.  Maybe using a sheet event to enforce manual but reset to automatic on exit?  Thoughts???

Populating Access w/ Excel PI data VBA

$
0
0

Hello,

 

I'm new to the PI system but fairly experienced with VBA. First some background on the application.

 

I have been tasked with creating an Access database to store production data from our plant. The production data can be gathered directly with the PIAdvCalcVal tag. I have written VBA code in an Excel spreadsheet to automatically update the data when the spreadsheet is opened. This works fine when I run it by itself. I then created a linked table in Access referencing this spreadsheet. So far, so good. I have an AutoExec macro in Access that opens the Excel spreadsheet when Access is opened. In this scenario, Excel is acting somewhat like a backend database for Access (I know this is backwards to the way it should be).

 

I run into a problem when I open Access and the macro in Excel tries to update the PI data. An error appears in the cells that have the PI data that says the formula contains unrecognizable text in the formula. When I step through the calculations Excel does not recognize the PIAdvCalcVal( portion of the formula. I get a #Name? error in each cell with the PI data. I think what's happening is that the macro runs before the PI add-in can load.

 

Code in Excel:

Sub GetPIData()
Dim today, datediff As Long
Dim i, daterow, formulastartdaterow, formulaenddaterow As Integer
Dim formula As String
Dim daterange As Range
Dim xlapp As Excel.Application

today = Date

'date of last production entry
daterow = Range("B1").End(xlDown).row

'difference between today's date and last entered production date. i.e. Over the weekend.
datediff = today - Cells(daterow, 1).Value
      
formulastartdaterow = daterow + 1
formulaenddaterow = daterow + datediff - 1

'Check if the calculations have already been done today
'Might capture this in the Access VBA code?
If datediff > 1 Then
    'copy dates and target production down to today
    Cells(daterow, 1).Select
    Selection.AutoFill Destination:=Range("A" & daterow & ":A" & daterow + datediff), Type:=xlFillDefault
   
    Cells(daterow, 9).Select
    Selection.AutoFill Destination:=Range("I" & daterow & ":I" & daterow + datediff - 1), Type:=xlFillDefault
   
    For i = formulastartdaterow To formulaenddaterow
       
        Cells(i, 2).FormulaR1C1 = "=ROUND(PIAdvCalcVal(""FI5038.PV"",Summary!RC[-1],Summary!R[1]C[-1],""average"",""time-weighted"",0,1,0,""grnrvr-pi"")*24,0)"
        Cells(i, 3).FormulaR1C1 = "=RC[6]-RC[-1]"
        Cells(i, 8).FormulaR1C1 = "=RC[-5]-SUM(RC[-4]:RC[-1])"
   
    Next i
Application.CalculateFullRebuild

 

Code in Access:

Public Function GetProductionFromExcel()
Dim Path As String
Dim objXL As Excel.Application
Dim xlWB As Excel.Workbook

 
Set objXL = New Excel.Application
objXL.Visible = True

Path = "S:\Granger Reliability\Loss Accounting\PI Data for Loss Accounting.xlsm"
Set xlWB = objXL.Workbooks.Open(Path)

End Function

 

 

Any help would be greatly appreciated.

 

Trend auto-update

$
0
0

I have what is probably a simple question for which the answer is eluding me.  I'm a PI ProcessBook user (still learning).  I have two workbooks that have trends in them that do not auto-update (end timestamp stays at the point when you opened the display).  In order to see current data, I have to either revert the time scale or double-click the trend (to maximize it).  This has only been an annoyance until recently.  Now we have two large video walls used by our customers and we want to display several of my PI displays there, but we don't want the users to have to interact in order to have up-to-date data.  On each of these pages where I'm having this problem there are other data points or trends that are updating on their own. 

 

I suspect it's based on how the trends are built, but I can't find anything different in them (and in fact, one of them was created as a copy of another that was modified).  I do noticed that the time stamp for one of the ones that aren't updating show like this (5/19/2014 8:24:27.247 AM) where the ones that are updating show like this (5/19/2014 8:30:07 AM).  Not sure if that is helpful. The other trend that isn't updating displays a static 24 hours (today) with trends for today, yesterday, and 7 days ago - so no updating time stamp there to compare with.

 

Being new to this forum, I'm not sure what information will be helpful for solving this issue.  Let me know and I'll provide what I can.

Thanks in advance for your time and help!
Kelly

El Paso Electric

PI Test Server

$
0
0

What is the best way to build a PI test server? Our existing PI server is 2012 and runs on Windows 2012 as a VM. The test server will be in the same domain as the live server.

 

We have considered a PI server restore on a new VM or replicating the live server and changing names/IP address.

 

We know that we will need a test server license and that is in progress.

 

Any suggestions, pros, cons, and warnings would be appriciated.

 

Chris Massie

Hood Container

 

Average rate while running

$
0
0

Hi,

 

I'm trying to set up an average rate while operating, based on a tonnes per hour tag of a conveyor belt. The 24hr average is simple enough, but we have intermittent feed. When we run into problems, we leave the belt running, but stop feeding the plant, so filtering by a run state won't work.

 

I want the average over 24hrs for my tag, but I don't want to include any time periods where the value of the tag is below 20. For example, if we've run off and on for 18hrs out of the last 24 at 1380tph, I want an expression that tells me the rate while operating yesterday was 1380, not 1035.

 

Can anyone please explain how to filter out the time?

It might be round-about, but is there a way of calculating the number of hours where the rate was >20 as well?

 

Thanks.

Viewing all 1120 articles
Browse latest View live


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