Jump to content

patjdixon

Super Seeqer
  • Posts

    94
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by patjdixon

  1. I am trying to access the 'Formula Parameters' on specific signals that I created.  I notice that if I do a spy.search to return the signals I created, when I try to show 'Formula Parameters' they are not there:

    image.thumb.jpeg.428e96ddd6b638c81101aa252f40adcb.jpeg

    However, if I do a spy.search on a worksheet, I can access the 'Formula Parameters':

    image.thumb.jpeg.38d1cf4e66ba64acabfb94d267fa4efd.jpeg

    image.jpeg.ac7dc8f87fb640d1cedad6123f1e1c02.jpeg

    Notice I am access the same signal ID in both cases.

    Is there some way to do spy.search on specific signals and have that search return the  'Formula Parameters'?

     

    image.jpeg

  2. I had an archived asset tree 'PM_SIM_AssetTree' with items in it that were not archived.  This was because of a prior error on my part.  To fix it, I used an API call to delete it.  Afterwards, the script runs each time and overwrites the existing tree

  3. What I am trying to do is create a DataLab script that will create an asset tree regardless of whether it is a new tree or an existing tree in the workbook.  Ideally I would just like to overwrite whatever tree is already there so that every time I run the script I end up with the same asset tree.

    The problem I have is that apparently every time spy.assets.Tree is used, it tries to create a new tree.  This contradicts the SPy documentation for Asset Trees 1 - Introduction, which says: 

    "Say you have an existing asset tree in Seeq, perhaps from an external datasource like OSIsoft PI AF, and you wish to clean up the tree or add calculations to it for further analysis. You can define a tree in SPy using this existing tree as a starting point by referring to it by name in the spy.assets.Tree input."

    image.thumb.jpeg.c8feb8a96fe53320dc4ce86954fadecf.jpeg

    If I try to create a reference to my existing tree PM_SIM_AssetTree using PM_SIM_AssetTree = spy.assets.Tree('PM_SIM_AssetTree', workbook=scopedtoid), I get an error saying that there is an invalid item.  The path suggests that it is trying to insert a new tree instead of creating a reference to the existing tree:

    image.thumb.jpeg.bb7c031f7dcfe816b85cdf1d44116395.jpeg

     

    It doesn't matter whether I use workbook=scopedtoid or workbook=workbook_name, I get the same result.  I know that the scopeid reference to my workbook is correct.

    What is required to do either of these?

    - detect the existence of a tree and remove it so that I can create the new one

    - create the tree everytime with overwrite if it already exists

     

  4. Now I see!  I was assuming maxValue($SearchArea) was hard coding the search.  Your explanation makes sense: maxValue is returning a search result, but then $signal.within($ValidData) is only passing the capsules in the condition to it.  Therefore, as long as $SearchArea fully includes the capsules in $ValidData it will work.  I just need to hard code dates well before and well after any capsules I would use.

    Thanks!

    • Like 1
  5. There seems to be a misunderstanding.  I do not want to find the max for a moving window.  I want to find the max for "Data valid".  I want to specify the condition for "Data valid" and find the max for capsules with that condition.  In my case I have only 1 capsule for this condition. Whatever that max value is, I want the signal to apply for all time, like a constant.  We have accomplished creating the signal for all time, but the capsule("2020-01-01T00:00:00Z","2022-07-28T00:00:00Z") uses a fixed time period instead of the "Data valid" condition.  If there is a way to use "Data valid" instead of hard coded times, I will have what I want.

     

  6. Shamus, that is fantastic, we are really close!

    The missing piece is the capsule.  I do not want to hard code the dates in.  I would like to use all capsules in the "Data valid" condition.  In my case there is only one capsule for "Data valid", but regardless I would like that condition to determine when to obtain the max or min.  Is there a way to do that?

    image.thumb.jpeg.619d83afe69535d0fc7c358cf8ff3406.jpeg

    image.jpeg

  7. I am trying to create a signal that is the maximum or minimum of a signal.  If I use agggregate, I get a single value in time, not a signal that applies to all time periods:

    image.thumb.jpeg.ac2dfca7a503e45469ebf20ac2c5215a.jpeg

    What I want is the equivalent of what you get with a constant, but instead of a hard coded value I want the max or min of a signal.  As you see below, the constant signal is for all time periods

    image.thumb.jpeg.569d18272afab4fa66b8b12f61d02054.jpeg

    I thought toScalars might help, but it doesn't work:

    image.jpeg.b74954cdde1d5fbaf17f9763cf3fc54a.jpeg

    Any ideas?

    seeq_max_formula_2022-07-27 at 6.36.31 PM.jpg

×
×
  • Create New...