Jump to content
  • To Search the Seeq Knowledgebase:

    button_seeq-knowledgebase.png.ec0acc75c6f5b14c9e2e09a6e4fc8d12.png.4643472239090d47c54cbcd358bd485f.png

Search the Community

Showing results for tags 'capsules'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community Technical Forums
    • General Seeq Discussions
    • Seeq Admin Forum
    • Training Resources
    • Product Suggestions
    • Seeq Data Lab
  • Community News
    • Seeq Blog Posts
    • News Articles
    • Press Releases
    • Upcoming Events
    • Resources

Categories

  • Seeq FAQs
  • Online Manual
    • General Information

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Company


Title


Level of Seeq User

Found 11 results

  1. Background: A property can be added to capsules for further filtering and aggregation through Seeq tools, including Histogram. All properties on a condition are stored as string values. This post examines how to add a property to a condition and then how those properties may be used. Adding Properties to a Condition Capsule properties may be used to store important information such as, Product Codes, Batch IDs, and Recipes. There are three functions in Seeq Formula which can add properties to the capsules in a condition: toCondition() - Dedicated function to transform a signal into a condition which contains a capsule for each value change in the input signal. The value of the signal is stored as a property of the capsule toCapsules() - Dedicated function to transform a signal into a condition which contains a capsule for each valid sample in the input signal. The value of the signal is stored as a property of the capsule. setProperty() - Flexible function which is used to assign properties to each capsule in a condition. It is most commonly used in SQL queries to attach transactional information from a data source to a capsule in a condition. toCondition() This function creates a capsule for every value change in a signal. This may be useful on a Batch ID signal or operating mode signal. The toCondition() function creates a new capsule for each value change and automatically assigns the signal value to a capsule property called 'Value'. Using the toCondition() operator on the Compressor Stage example data creates a capsule for each distinct value in the signal. The following image shows the condition created from performing toCondition() on the Compressor Stage Example Data. A capsule is created for each distinct value in the signal. This property may be viewed by adding the Value property to the Capsules Pane. The .toCapsules() operator works similiarly, but instead creates a new condition with a capsule for each sample point (regardless of whether the value has changed). setProperties() This flexible function is used to assign properties to a condition. Users must assign both a property name and value. The following syntax is an example of how the .setProperties() operator can be used in Formula to assign properties to the capsules in a condition. This example assigns a property of "Batch" with a value of '23' to each capsule in a condition. $condition.transform($capsule-> $capsule.setProperty('Batch',23)) In the next example, a High Power condition was created using Value Search tool (power >25). The following syntax can be used to assign a property called "averagePower" to each capsule in the High Power condition. The value of this property is calculated as the average Compressor Power during each High Power condition. Executing this Formula results in a new condition that contains the averagePower property for each capsule. Using Condition Properties Condition properties can be used in different ways, such as to filter the capsules in a Condition or to aggregate the data in Histogram Condition Filtering Capsule properties can be displayed in the Capsule Pane by adding a column to the table. These property columns may also be sorted in ascending or descending order. Once capsules within a condition have properties assigned, the filter() operator may be used in Formula to create new conditions containing only a subset of the original capsules. For example, the following syntax generates a new condition that only has the capsules where the Value property is equal to OFF. $condition.filter($capsule-> $capsule.getProperty('Value').isEqualTo('OFF')) Histogram Within the Histogram tool, users can select Condition as the aggregation type to create bins using capsule properties. The following example creates a Histogram based upon the Value property in the toCondition() condition. The output is a Histogram with a count of the number of capsules with a Value equal to each of the four stages of operation:
  2. Capsules can have properties or information attached to the event. By default, all capsules contain information on time context such as the capsule’s start time, end time, and duration. However, one can assign additional capsule properties based on other signals’ values during the capsules. This guide will walk through some common formulas that can be used to assign capsule properties and work with those properties. Note: The formula syntax used in the following examples will all be based on the formula language for Seeq version 49. If you have questions about errors you may be receiving in the formulas on different versions, please check out the What’s New in Seeq Knowledge Base pages for formula changes or drop a comment below with the error message. How can I visualize capsule properties? Capsule Properties can be added to the Capsules Pane in the bottom right hand corner of Seeq Workbench with the black grid icon. Any capsule properties beyond start, end, duration, and similarity that are created with the formulas that follow or come in automatically through the datasource connection can be found by clicking the “Add Column” option and selecting the desired property in the modal to get a tabular view of the properties for each capsule as shown below. In Trend View, you can Capsule Property labels inside the capsules by selecting the property from the labels modal. Note that only Capsule Properties added to the Capsule Pane in the bottom right corner will be available in the labels modal. In Capsule Time, the signals can be colored by Capsule Properties by turning on the coloring to rainbow or gradient. The selection for which property is performing the coloring is done by sorting by the capsule property in the Capsule Pane in the bottom right corner. Therefore, if Batch ID is sorted by as selected below, the legend shown on the chart will show the Batch ID values. When working with Scorecard Metrics, you can use a Capsule Property as the header of a condition based scorecard by typing in the property name into the header modal: How do I create a capsule for every (unique) value of a signal? Let’s say you have a signal that you want to turn into individual capsules for each value or unique value of the signal. This is often used for string signals (e.g. batch IDs, operations, or phases) that may look like the signal below. There’s two main operators that can be used for this: $signal.toCapsules() The toCapsules operator will create a capsule for each data point of the signal. Therefore, if there was only 1 data point per value in the string signal below, it would create one capsule per value, but if the string value was recorded every minute regardless of whether it change values, it would create 1 minute capsules. In addition, the toCapsules operator also automatically records a Capsule Property called ‘Value’ that contains the value of the signal data point. $signal.toCondition('Property Name') The toCondition operator will create a capsule for each change in value of the signal. Therefore, in the case above where the value was recorded every minute regardless of value changes, it would only create one capsule for the entire time the value was equivalent. Similarly to the toCapsules operator, the toCondition operator also automatically records a Capsule Property called ‘Value’ that contains the value of the signal data point. However, with the toCondition operator, there’s an optional entry to store the property under a different name instead by specifying a property name in the parentheses in single quotes as shown in the example above. Note: Sometimes when working with string signals of phases or steps that are just numbered (e.g. Phase 1), if there is only one phase in the operation, you may end up wanting two Phase 1 capsules in a row (e.g. Operation 1 Phase 1 and Operation 2 Phase 1) whereas the toCondition method above will only create a single capsule. In this instance, it can be useful to concatenate the operation and phase signals together to find the unique combination of Operations and Phases. This can be done by using the following formula: ($operationsignal + ': ' + $phasesignal).toCondition('Property Name') How do I assign a capsule property? Option 1: Assigning a constant value to all capsules within a condition $condition.setProperty('Property Name', 'Property Value') Note that it is important to know whether you would like the property stored as a string or numeric value. If the desired property value is a string, make sure that the ‘Property Value’ is in single quotes to represent a string like the above formula. If the desired value is numeric, you should not use the single quotes. Option 2: Assigning a property based on another signal value during the capsule For these operations, you will have to use a transform operator to perform a particular set of operations per capsule to retrieve the desired property. For example, you may want the first value of a signal within a capsule or the average value of a signal during the capsule. Below are some examples of options you have and how you would set these values to capsule properties. The general format for this operation is listed below where we will define some different options to input for Property Scalar Value. $condition.transform($capsule -> $capsule.setProperty('Property Name', Property Scalar Value)) The following are options for what to input into Property Scalar Value in the formula above to obtain the desired property values: First value of signal within a capsule: $signal.toScalars($capsule).first() Last value of signal within a capsule: $signal.toScalars($capsule).last() Average value of signal within a capsule: $signal.average($capsule) Maximum value of signal within a capsule: $signal.maxValue($capsule) Minimum value of signal within a capsule: $signal.minValue($capsule) Standard deviation of signal within a capsule: $signal.stdDev($capsule) Totalization of a signal within a capsule: $signal.totalized($capsule) Count the capsules of a separate condition within a capsule: $DifferentCondition.count($capsule) Duration of capsules in seconds of a separate condition within a capsule: $DifferentCondition.totalduration($capsule) There are more statistical operations that can be done if desired, but hopefully this gives you an idea of the syntax. Please leave a comment if you struggle with a particular operator that you are trying to perform. Finally, there are often times when you want to perform one of the above operations, but only within a subset of each capsule. For example, maybe for each batch, you want to store the max temperature during just a particular phase of the batch. In order to do this, first make sure you have created a condition for that phase of the batch and then you can use the following to input into Property Scalar Value in the formula above: $signal.within($PhaseCondition).maxValue($capsule) In this case, the within function is cutting the signal to only be present during the $PhaseCondition so that only that section of the signal is present when finding the maximum value. Option 3: Assign a property based on a parent or child condition In batch processing, there is often a parent/child relationship of conditions in an S88 (or ISA-88) tree hierarchy where the batch is made up of smaller operations, which is then made up of smaller phases. Some events databases may only set properties on particular capsules within that hierarchy, but you may want to move the properties to higher or lower levels of that hierarchy. This formula will allow you to assign the desired property to the condition without the property: $ConditionWithoutProperty.transform($capsule -> $capsule.setProperty('Current Property Name', $ConditionWithProperty.toGroup($capsule).first().property('Desired Property Name'))) Note that this same formula works whether the condition with the property is the parent or child in this relationship. I also want to point out that if there are multiple capsules of the $ConditionWithProperty within any capsule of the $ConditionWithoutProperty, that this formula is set up to take the property from the first capsule within that time span. If you would like a different capsule to be taken, you can switch the first() operator in the formula above to last() or pick(Number) where last will take the property from the last capsule in the time span and pick is used to specify a particular capsule to take the property from (e.g. 2nd capsule or 2nd to last capsule). There’s another write-up about this use case here for more details and some visuals: How do I filter a condition by capsule properties? Conditions are filtered by capsule properties using the keep operator. Some examples of this are listed below: Option 1: Keep exact match to property $condition.keep('Property Name', isEqualTo('Property Value')) Note that it is important to know whether the property is stored as a string or numeric value. If the property value is a string, make sure that the ‘Property Value’ is in single quotes to represent a string like the above formula. If the value is numeric, you should not use the single quotes. Option 2: Keep regular expression string match $condition.keep('Property Name', isMatch('B*')) $condition.keep('Property Name', isNotMatch('B*')) You can specify to keep either matches or not matches to partial string signals. In the above formulas, I’m specifying to either keep all capsules where the capsule property starts with a B or in the second equation, the ones that do not start with a B. If you need additional information on regular expressions, please see our Knowledge Base article here: https://seeq.atlassian.net/wiki/spaces/KB/pages/146637020/Regex+Searches Option 3: Other keep operators for numeric properties Using the same format of Option 1 above, you can replace the isEqualTo operator with any of the following operators for comparison functions on numeric properties: isGreaterThan isGreaterThanOrEqualTo isLessThan isLessThanOrEqualTo isBetween isNotBetween isNotEqualTo Option 4: Keep capsules where capsule property exists $condition.keep('Property Name', isValid()) In this case, any capsules that have a value for the property specified will be retained, but all capsules without a value for the specified property will be removed from the condition. How do I turn a capsule property into a signal? A capsule property can be turned into a signal by using the toSignal operator. The properties can be placed at either the start timestamp of the capsule (startKey) or the end timestamp of the capsule (endKey): $condition.toSignal('Property Name', startKey()) $condition.toSignal('Property Name', endKey()) This will create a discrete signal where the value is at the selected timestamp for each capsule in the condition. If you would like to turn the discrete signal into a continuous signal connecting the data points, you can do so by adding a toStep or toLinear operator at the end to either add step or linear interpolation to the signal. Inside the parentheses for the interpolation operators, you will need to add a maximum interpolation time that represent the maximum time distance between points that you would want to interpolate. For example, a desired linear interpolation of capsules may look like the following equation: $condition.toSignal('Property Name', startKey()).toLinear(40h) It should be noted that some properties that are numeric may be stored as string properties instead of numeric, particularly if the capsules are a direct connection to a datasource. In this case, a .toNumber() operator may need to be added after the toSignal, but before the interpolation operator. Finally, it is often useful to have the property across the entire duration of the capsule if there are no overlapping capsules (e.g. when looking at batches on a particular unit). This is done by turning the signal into a step signal and then filtering the data to only when it is within a capsule: $condition.toSignal('Property Name', startKey()).toStep(40h).within($condition) What capsule adjustment/combination formulas retain capsule properties? When adjusting or combining conditions, the rule of thumb is that operators that have a 1 to 1 relationship between input capsule and output capsule will retain capsule properties, but when there are multiple capsules that are required as the input to the formula operator, the capsule properties are not retained. For example, moving a capsule by 1 hour has knowledge of the input properties whereas merging 2 capsules together results in not knowing which capsule to keep the properties from. A full list of these operators and their stance on whether they retain or lose capsule properties during usage is below. Operators that retain properties Operators that lose properties afterEnd inverse afterStart merge beforeEnd fragment beforeStart intersect ends join starts union (if more than one capsule overlap) middles grow growEnd shrink move combineWith encloses inside subtract matchesWith touches union (when no capsules overlap) It is important to note that capsule properties are attached to the individual capsule. Therefore, using a combination formula like combinewith where multiple conditions are combined may result in empty values in your Capsule Pane table if each of the conditions being combined has different capsule properties. How do I rename capsule properties? Properties can be swapped to new names by using the renameProperty operator: $condition.renameProperty('Current Property Name', 'New Property Name') A complex example of using capsule properties: What if you had upstream and downstream processes where the Batch ID (or other property) could link the data between an upstream and downstream capsule that do not touch and are not in a specific order? In this case, you would want to be able to search a particular range of time for a matching property value and to transfer another property between the capsules. This can be explained with the following equation: $UpstreamCondition.move(0,7d) .transform($capsule ->{ $matchingDownstreamProperty = ($DownstreamCondition.toSignal('Downstream Property to Match Name') == $capsule.property('Upstream Property to Match Name')) $firstMatchKey = $matchingDownstreamProperty.togroup($capsule,CAPSULEBOUNDARY.INTERSECT).first().startkey() $capsule.setProperty('Desired Property Name',$DownstreamCondition.toSignal('Desired Downstream Property Name').tostep(40h).valueAt($firstMatchKey)) }) .move(0,-7d) Let's walk through what this is doing step by step. First, it's important to start with the condition that you want to add the property to, in this case the upstream condition. Then we move the condition by a certain amount to be able to find the matching capsule value. In this case, we are moving just the end of each capsule 7 days into the future to search for a matching property value and then at the end of the formula, we move the end of the capsule back 7 days to return the capsule to its original state. After moving the capsules, we start the transform. Inside the transform, we find the matching downstream property by turning the capsule property to match from the downstream condition into a signal and match it to the capsule property from the upstream capsule. We then find the key (timestamp) of the first match of the property. Again, similar to some other things, the first option could be swapped out with last or pick to grab a different matching capsule property. Finally, we set the property on the upstream condition to 'Desired Property Name' by turning the downstream capsule property that we want into a step signal and take the value where the first match was found.
  3. In some cases you may want to do a calculation (such as an average) for a specific capsule within a condition. In Seeq Formula, the toGroup() function can be used to get a group of capsules from a condition (over a user-specified time period). The pick() function can then be used to select a specific capsule from the group. The Formula example below illustrates calculating an average temperature for a specific capsule in a high temperature condition. // Calculate the average temperature during a user selected capsule of a high temperature // condition. (The high temperature condition ($HighT) was created using the Value Search tool.) // // To prevent an unbounded search for the capsules, must define the search start/end to use in toGroup(). // Here, $capsule simply defines a search time period and does not refer to any specific capsules in the $HighT condition. $capsule = capsule('2019-06-19T09:00Z','2019-07-07T12:00Z') // Pick the 3rd capsule of the $HighT condition during the $capsule time period. // We must specify capsule boundary behavior (Intersect, EnclosedBy, etc.) to // define which $HighTcapsules are used and what their boundaries are (see // CapsuleBoundary documentation within the Formula tool for more information). $SelectedCapsule = $HighT.toGroup($capsule,CapsuleBoundary.EnclosedBy).pick(3) // Calculate the temperature average during the selected capsule. $Temperature.average($SelectedCapsule)
  4. FAQ: How do I identify time periods where I have overlapping capsules within the same condition? I may want to keep only the capsules (time periods) where capsules overlap. I may also want to keep the times where a certain number (2, 3, or more) of capsules overlap. In this example, we will find time periods where there are at least 2 overlapping capsules which make up the Event Condition. In the screenshot below, you can see there are 3 separate time periods where the Event condition capsules overlap: Step 1: Merge any overlapping capsules together using the merge() function in Formula: Now, we have a time period basis (Event Condition (merged)) over which we can count the total number of overlapping capsules. Step 2: Count the number of overlapping capsules using the count of the original Event Condition capsules over each Event Condition (merged) capsule: This creates a new signal as shown in the trend below. We can see that the new signal values (where > 1) correctly identify the 3 time periods where there are overlapping capsules in the original Event Condition. Step 3: We use Formula to find where the Event Condition (merged) capsules touch a time period where the Number of Overlapping Events signal (created in Step 2) is > 1. Note that we could test for varying number of overlapping capsules (> 2, > 3, etc.) depending on the goals of our analysis. We could also break Step 3 into 2 steps (a Value Search to find where the Number of Overlapping Events is > 1, followed by a Composite Condition to do the touches logic). This generates the final results where the Overlapping Events condition correctly identifies our time periods of interest:
  5. FAQ: I have a condition for events of variable duration. I would like to create a new condition that comprises the first third of the time (or 4th, or 10th) of the original condition. Solution: A stepwise approach can be taken to achieve this functionality. 1. Begin with your condition loaded in the display pane. 2. Create a new Signal using Signal from Condition that calculates the total duration of each of your event capsules, interpolated as a step signal. 3. Create a new signal that is your total event duration multiplied by the proportion of the event that you would like to capture. e.g. for the first 1/3 of the event, divide your total duration signal by 3, as shown below. 4. Create an arbitrary discrete signal with a sample at the start of each of your event capsules. 5. Shift the arbitrary discrete signal in time by the value of your signal calculated in step 3. In this example, the 1/3 duration signal. Note, depending on your version of Seeq, the function to do this may be called move() or delay(). 6. Use the toCapsules() function in Formula to create a tiny (zero duration) capsule at each of your shifted, discrete samples. 7. Join the start of your original condition with the capsules created in step 6 using the composite condition tool.
  6. FAQ: I've created a condition for a particular event of interest and now I would like to create a signal that is the running count of these events in a given time period. This analysis is common in equipment fatigue use cases when equipment degrades slowly based on a number of cycles (thermal, pressure, tension, etc) that it has undergone during it's life or since a last component replacement. Solution: We can convert each of these capsules into a signal comprised of a single sample (with value of 1) per capsule, then take a running sum of this new signal over the current equipment life condition. 1) Use Formula to create a signal with a constant value of 1 and a sample every 1 second. (1).toSignal(1sec) 2) Use Signal from Condition to create a new signal with a single sample of value 1 per capsule. Take the average of the "1 signal" during each of the event capsules. 3) Use Formula to calculate the running sum of the 1 sample per capsule signal during the Current Equipment Life capsule. $OneSamplePerCapsule.runningSum($CurrentLife).toLinear(7d)
  7. Hello everyone, I want to get the first value of signal within capsule. When I use getStart it returns No variant of function 'toscalars' consumes the parameters (Signal, Condition) at 'toscalars' Same with following function: $signal.toscalars($capsule).first() When I created capsule inside formula everything works fine: $signal.toscalars(capsule(now() - 6y, now())).first() Thanks
  8. Is there a way to count capsules? For example, I have created a value search in my data to show me all values above 70%. This forms capsules at the top of my timeframe. However I would like to now count how many capsules are in the selected timeframe (ie from November to January). I have tried using the "count" formula however it is showing a trend with a value every time the value search shows above 70%. I am looking for something that will tell me there were 87 capsules in the timeframe. And if I change the timeframe, then this value would change. I hope this makes sense. Thank you!
  9. I have created a daily condition in Seeq using the Periodic Condition tool. Why don't the capsules start at midnight? For example, in the screenshot below the "Daily" capsules start at 11:00PM (see the Capsules pane) instead of midnight (12:00AM). This results when the user interface (UI) time zone does not match that of the Seeq Server. In this example the Seeq Server time zone is US/Eastern but the UI time zone is US/Central. To make the UI time zone match, the user can click on the UI time zone link (noted by the red box in the screenshot: trend display, x-axis, right of timestamp): The user can then set the "Always use:" option to US/Eastern (in this example the Seeq Server is on US/Eastern) as shown here: The daily capsules now start at midnight:
  10. I have a Boolean signal and would like to count the number of events over a specified time period. How can this be accomplished in Seeq? Thanks, Sam
  11. Hi- I have a process that goes through several different stages during its operation, e.g. 'Stage 1', 'Stage 2', 'Off' etc. I'd like to determine a count or frequency that my process is in each of these stages. What is the best way to do this?
×
×
  • Create New...