Jump to content

Thorsten Vogt

Super Seeqer
  • Posts

    113
  • Joined

  • Last visited

  • Days Won

    39

Thorsten Vogt last won the day on November 26

Thorsten Vogt had the most liked content!

3 Followers

Personal Information

  • Company
    Werusys GmbH & Co. KG
  • Level of Seeq User
    Seeq Advanced

Recent Profile Visitors

1,876 profile views

Thorsten Vogt's Achievements

Rookie

Rookie (2/14)

  • Dedicated Rare
  • Reacting Well Rare
  • First Post
  • Collaborator Rare
  • Week One Done

Recent Badges

83

Reputation

  1. Hi Javad, I got a solution based on this starting point: The following formula compares the durations of the first capsules for conditions B,C and D bounded by each capsule of condition A and sets a property on capsules of condition A indicating if these should be shown. The keep function on the end only displays capsules where the property is set to true $a.transform($a_capsule -> { $b_capsule = $b.toGroup($a_capsule).first() $c_capsule = $c.toGroup($a_capsule).first() $d_capsule = $d.toGroup($a_capsule).first() $show_a = ($b_capsule.duration() > $d_capsule.duration() and $d_capsule.duration() > $c_capsule.duration()) $a_capsule.setProperty('show', $show_a) }, 40h).keep('show', isequalTo(true) ) Changing capsule duration of B gets no capsule for result, which is expected: If you want to show another capsule for the last case, you can adjust the formula to generate another condition with the property show set to the inverse and select one of the conditions based on that value. Therefore you have to do the transform twice: $tempCondition1 = $a.transform($a_capsule -> { $b_capsule = $b.toGroup($a_capsule).first() $c_capsule = $c.toGroup($a_capsule).first() $d_capsule = $d.toGroup($a_capsule).first() $show_a = ($b_capsule.duration() > $d_capsule.duration() and $d_capsule.duration() > $c_capsule.duration()) $a_capsule.setProperty('show', $show_a) }, 40h) $tempCondition2 = $tempCondition1.transform($a_capsule -> { $d_capsule = $d.toGroup($a_capsule).first() $d_capsule.setProperty('show', not $a_capsule.property('show')) }, 40h) $tempCondition1.keep('show', isequalTo(true)) or $tempCondition2.keep('show', isequalTo(true)) As a result capsules for condition D are shown: Changing duration of capsule B to its original value show capsules of A as the result: Hope this helps. Regards, Thorsten
  2. Hi Matthias, you can try this: First, calculate the duration of each capsule using "Signal from Condition" tool: Then you can use timesince() to calculate the percentage value over the duration and also splice() to insert it into the base signal of 0% everytime the condition is met: 0%.splice(timesince($condition.removeLongerThan(40h), 1min)/$duration, $condition) Did I understand your question correctly? Regards, Thorsten
  3. Hi Yassine, maybe this post is helpful: Regards, Thorsten
  4. Hi Rohan, you can use the replace() function for this: $signal.replace('/(.{22}).*/', '$1') The snippet takes the first 22 characters and replaces the original value of the signal with the characters captured. Regards, Thorsten
  5. Hi Sivaji, actually you can search by ID using either the API/SDK or writing some code in Data Lab. In terms of API/SDK you should try the /items/{id} endpoint: In case an item exists you will get HTTP 200 as status code and details about the item in the response body. If the item does not exist you receive an HTTP 404 status code. In Data Lab you can use spy.search for this. In case of non-existing item spy.search throws an error, therefore I am iterating over the IDs: item_ids = ["FCC9F932-B328-4A7E-9300-A17331519C93", "BF769E50-B93A-4C1A-81FD-326F488CD1E1", "64832183-D97F-4E5C-81A1-C466C494DC3A", "64832183-D97F-4E5C-81A1-C466C494DC6A", "FCC9F932-B328-4A7E-9300-A17331519C91"] item_infos = [] for item_id in item_ids: try: data = spy.search({"ID": item_id}) item_infos.append("Item with ID " + item_id + " exists") except: item_infos.append("Item with ID " + item_id + " does not exist") print (item_infos) Output looks like this: ['Item with ID FCC9F932-B328-4A7E-9300-A17331519C93 exists', 'Item with ID BF769E50-B93A-4C1A-81FD-326F488CD1E1 exists', 'Item with ID 64832183-D97F-4E5C-81A1-C466C494DC3A does not exist', 'Item with ID 64832183-D97F-4E5C-81A1-C466C494DC6A exists', 'Item with ID FCC9F932-B328-4A7E-9300-A17331519C91 does not exist'] Be aware that both methods return all types of items. In case you want to search only for signals or conditions you have to make some adjustments like evaluating the returned data. Hope this helps. Regards, Thorsten
  6. Hi Kenny, you can do this by first calculating the total duration of each capsule using Signal from Condition Tool: Here "Discrete" is used as the interpolation method as interpolated values of the calculated duration between the capsules for further calculations are not needed. Next you can calculate the average duration again using Signal from Condtion: Depending on where you put the value in step 1 the calculated average can change. In the foregoing example I put the value to the start of the capsule therefore only capsules starting in the bounding condition are used for calculation. If necessary, further adjustments must be made with regard to your usecase. Regards, Thorsten
  7. Hi Dylan, you can use the aggregate function for this: $signal.aggregate(average(), ($signal > 90).removeLongerThan(1wk), durationKey()) In this example the average of the signal is calculated whenever its value is above 90 and the result is drawn as a line over the duration of each capsule. You can find more information on the function and its parameters inside formula documentation. Hope this helps. Regards, Thorsten
  8. Hi Yassine, it might be that there are invalid values in this timeframe. You can try to change your formula to $as32.validValues(). This will remove invalid values from the signal and interpolation should work again. If the gap is greater than the max interpolation setting you can use $as32.validValues().setMaxInterpolation(4weeks) which first removes invalid values and then changes the max interpolation of the signal. Regards, Thorsten
  9. Hello Bayu, you may try it this way. I set up a sample in which my forecasted value will exceed the threshold two times in the next 3 days: First step is identifying these periods by using the following formula: ($forecast > $limit).afterStart(0ns) This will create capsules with zero duration as I just need the timestamps for the points in time when the value will be exceed the limit. Next step is creating a new signal with the timestamp as the value: //Iterate over all capsules to create a signal //with the value of the timestamp at start of the capsule $limitExceeded.toSamples($c -> { //Get date of capsule start $date = $c.startKey() //Create sample for signal sample($c.startKey(), $date) }, 1s) Last step is creating the scorecard: In case you may want to display the timestamp in another format you may read this post and adjust the formula in step 2. Hope this helps. Regards, Thorsten
  10. Hi Ben, another option is using the function highpassfilter() as in the following example: $signal.highPassFilter(20min, 2min, 60).abs().agileFilter(2min) The resulting signal can then be used in Value Search to determine the deviations. Regards, Thorsten
  11. Hi Rosa, have you tried keeping just the calculated signal in the list of signals used for the export? Using the OData Feed URL for Excel (I do not have Power BI) just exports 30 values. Regards, Thorsten
  12. Hi Pat, you may use within() fo this. The following example keeps only the portions of the signal where the value of the signal is above 65: Regards, Thorsten
  13. Hi Ingrid, you try to use splice on a scalar, which is available since R51. In lesser versions you can apply splice only on signals, so changing $h to a signal first should resolve the issue: $h.tosignal().splice($l, $lfc) Regards, Thorsten
  14. Hi Aaron, you can use a formula for this. The following example calculates the total duration of all capsules of the operation condition since 06 Mar 2021 up to now. The result is a scalar. $operation.aggregate(totalDuration('h'), capsule('2021-03-06T00:00:00Z', now())) Another option would be creating a condition that can be used in the "Signal from Condition" tool. You have to select an appropriate maximum capsule duration for the condition: condition(30d, capsule('2021-03-06T00:00:00Z', now())) A more dynamic way would be calculating the duration based on the last maintenance. The following formula creates a condition for the times your equipment is running, in case you only have the maintenance capsules. growEnd(30d) extends the capsules to 30 days so you can use it for the current time. As growEnd() extends the capsules to the beginning of the next capsule I use subtract() to remove the maintenance periods from it. $maintenance.inverse().growend(30d).subtract($maintenance) The resulting condition is used inside Signal from Condition Tool: Will this work for you? Regards, Thorsten
  15. In this case you may change the aggregation function from totalized() to delta().
×
×
  • Create New...