# John Cox

Seeq Team

39

21

1. ## Create an event counter

Hi Marcelo, I'll add a few suggestions below, but I would most recommend you sign up for an upcoming Seeq Office Hours where you can work through the calculations with a Seeq Analytics Engineer: https://info.seeq.com/office-hours If you simply want to count regenerations, you could do a running sum of your regeneration signal over a specified time period or a Periodic Condition. If you want to break the sum into groups of 3, you could divide the running sum by 3 and look for time periods where the result is an integer. If you already have a cleanup condition, it would be easy to identify all the cleanup events (capsules) when a cleanup is performed and the number of regenerations just before the cleanup is not equal to 3. You could do this by doing a running sum of regenerations based on a condition that is the time between cleanups (which would be \$Cleanups.inverse()). It is also possible that the Formula functions below may be useful to you, as they allow you to focus on a specific number of recent sample values or capsules.
2. ## Create an event counter

Hi Marcelo, I am not certain I understand but I think you want to count the number of regenerations in between each "cleanup". If this is the case then you likely need to define a condition for when "cleanups" actually occur, and then you can create a condition for "time in between cleanups" using the .inverse() Formula function (there are several relatively easy you might find the "time in between cleanups"). Once you have the condition for "time in between cleanups", then a runningSum() Formula function would be one way to count the current number of regenerations. I'm happy to try to help iterate with your solution here on the forum, but because I'm not certain about the calculations you want to do, the most efficient way to get a solution for your questions would be to sign up for an upcoming Seeq Office Hours where you can share your screen and get help: https://info.seeq.com/office-hours John
3. ## Replace missing data with zero

Hi Ross, The same approach should work when dealing with string signals. This sounds like a potential bug that I would suggest you create a support ticket for by going to https://support.seeq.com/, then clicking on Support Portal in the lower right, then creating an "Analytics Help" support ticket. When investigating the support ticket, Seeq support will also try to determine if there is an alternate approach that will eliminate the Treemap error.
4. ## Basic Formatting Tips for Workbench Formulas Pushed from Data Lab

As a much easier alternative to having to manage string delimiters, apostrophe escape characters, line continuation characters, etc. with the approach above, Python offers a multiline string literal feature (3 double or single quotes). We use this approach below (note the 3 double quotes on code lines 6 and 14). We also use the textwrap.dedent() function (link) to nicely indent our code without indenting the final result in Workbench. This alternate approach is much easier to code as well as being more readable on the Data Lab side.
5. ## Basic Formatting Tips for Workbench Formulas Pushed from Data Lab

When pushing Formulas to Workbench from Data Lab, you can use "\" and "\n" in a few different ways in the Data Lab code, to create a nicely formatted, multi-line Formula in Workbench: For the Formula pushed to Workbench, a \n can be used for a line return. This is valuable for creating multi-line Formulas with intermediate variable assignments, or for making lengthy, single lines of code more readable. For the Formula pushed to Workbench, a \ can be used just before a single quote, when you need to include a single quote in the Formula. This helps for example when working with string signals. On the Data Lab side, using a \ at the end of the line continues the code to the next line, helping with readability in Data Lab. These are illustrated in the Data Lab code below which pushes a condition Formula to Workbench: Editing the Formula in Workbench, the Formula appears as we desired:

7. ## Data Cleansing Tips: Using the .remove() and .within() Formula Functions

A typical data cleansing workflow is to exclude equipment downtime data from calculations. This is easily done using the .remove() and .within() functions in Seeq formula. These functions remove or retain data when capsules are present in the condition that the user supplies as a parameter to the function. There is a distinct difference in the behavior of the .remove() and .within() functions that users should know about, so that they can use the best approach for their use case. .remove() removes the data during the capsules in the input parameter condition. For step or linearly interpolated signals, interpolation will occur across those data gaps that are of shorter duration than the signal's maximum interpolation. (See Interpolation for more details concerning maximum interpolation.) .within() produces data gaps between the input parameter capsules. No interpolation will occur across data gaps (no matter what the maximum interpolation value is). Let's show this behavior with an example (see the first screenshot below, Data Cleansed Signal Trends), where an Equipment Down condition is identified with a simple Value Search for when Equipment Feedrate is < 500 lb/min. We then generate cleansed Feedrate signals which will only have data when the equipment is running. We do this 2 ways to show the different behaviors of the .remove() and .within() functions. \$Feedrate.remove(\$EquipmentDown) interpolates across the downtime gaps because the gap durations are all less than the 40 hour max interpolation setting. \$Feedrate.within(\$EquipmentDown.inverse()) does NOT interpolate across the downtime gaps. In the majority of cases, this result is more in line with what the user expects. As shown below, there is a noticeable visual difference in the trend results. Gaps are present in the green signal produced using the .within() function, wherever there is an Equipment Down capsule. A more significant difference is that depending on the nature of the data, the statistical calculation results for time weighted values like averages and standard deviations, can be very different. This is shown in the simple table (Signal Averages over the 4 Hour Time Period, second screenshot below). The effect of time weighting the very low, interpolated values across the Equipment Down capsules when averaging the Feedrate.remove(\$EquipmentDown) signal, gives a much lower average value compared to that for \$Feedrate.within(\$EquipmentDown.inverse()) (1445 versus 1907). Data Cleansed Signal Trends Signal Averages over the 4 Hour Time Period
8. ## Technique for Scaling Data Exports across Assets

Asset groups and asset trees (link) are used frequently in Seeq for asset swapping calculations, building treemap visualizations, and scaling tabular results across assets. In some cases, users want to export calculated results for assets from Seeq Workbench to Excel or perhaps to Power BI. The following example illustrates a technique for doing this efficiently with a single export. 1. Asset group for 8 furnaces contains an "Outlet Temperature" signal that we want to calculate and export daily statistics (avg, std deviation, min, max) for: 2. Note that the "Daily Statistics" condition is created with a Formula that is part of the asset group. This is key to enabling the data export across all assets. See the formula for the "Daily Statistics" condition below for Furnace 1. Note that we create a daily condition and then add the temperature statistics as capsule properties, and assign an asset name property. These details are also essential in setting up an efficient export. As a reminder, we need to edit the "Daily Statistics" formula for each furnace to assign the correct furnace number to the Asset Name capsule property. For this example (only 8 assets), this is easy to do manually. For a large asset group (50, 100 or more), a better approach would be to create an asset tree using Data Lab, and programmatically create the individualized "Daily Statistics" conditions. 3. Next, we navigate the asset group and add the Daily Statistics condition for each furnace to the trend display in Workbench, which makes it easy to set up the "Daily Furnace Statistics for Export" in step 4. 4. Create the "Daily Furnace Statistics for Export" condition which will have overlapping daily capsules for the 8 furnaces. Here, we combine the separate Daily Statistics conditions (for all 8 furnaces) into a single condition. For the export to work as expected in a later step, we need to slightly offset the capsules using the move() function, so that they do not have identical start times. 5. Next, we visually check the capsules and their properties on the trend (Asset Name and Daily Avg) and in the capsules pane on the lower right. Everything looks as expected, we have a capsule for each furnace for the day of May 24. 6. The export to Excel or to other applications via OData can now be set up. The key is to export only the "Daily Furnace Statistics for Export" condition, and to set the time range appropriately based on your objectives. Here, we only want the results for 1 day: 7. Checking the export on the Excel side, all looks good. We have the daily statistics, scaled across all furnace assets, with one row for each furnace: To summarize, the following are keys to this technique for exporting calculation results across all assets, from Seeq Workbench: Store the calculation results as capsule properties in a condition that is an item in the asset group, and also assign an asset name property (see Step 2 above). In this example we used a daily time basis for calculations, but the techniques can be applied and extended for many scenarios. To store the results across all assets, create a single condition for export, which is a combination of all the individual asset "calculation results" conditions, and offset capsules slightly as needed to avoid capsules having identical start times (see Steps 3 and 4 above). In this example, we only had 8 assets so all formulas could be created interactively by the user. For large asset structures, the asset tree and formulas, including the final condition for export, can be created programmatically using Data Lab (link).
9. ## Heat Exchanger Maintenance Prediction - Informations

Hello, I'm going to attach an example Seeq Journal for this use case, which includes a few of the actual formulas used. Why don't you take a look at this and then let me know if there are specific steps that you need more information on? There are additional formulas that I can provide if needed.
10. ## Can I create an alarm history table within SeeQ?

Hello Nicolas, This is a great application for Seeq. The details of what you will actually need to do will depend on how the alarm data comes into Seeq (as signals or as capsules) and how you want to arrange/display it. To get you started, here are 2 resources that may help specifically with your dashboard of alarms use case. I encourage you to review these resources and then reach out to a Seeq Analytics Engineer in Office Hours (https://info.seeq.com/office-hours) for further help as needed. 1. A Seeq University video on creating tables for event based data (similar to alarms). 2. A Seeq.org post on turning a signal's values into table rows.
11. ## Selecting Capsules within a Condition

Depending on the details of the use case, adding properties from one condition to another (during a join or some type of combination of the 2 conditions) can be achieved with at least 2 approaches: The mergeProperties() Formula function, introduced in Seeq R56 can be used. You can look up example uses of mergeProperties() in Seeq Formula's documentation. Also note that mergeProperties() has functionality for quantitatively merging numerical property values (max, average, etc.) if the 2 conditions have conflicting values for the same property. The setProperty() Formula function can be used to add property values from one condition to another. It may be necessary to use getProperty() in conjunction with setProperty(): please see the highlighted sections in the screenshot below, which is included here only to show an example of using setProperty() inside of a transform(). Another alternative with setProperty(): you may also consider converting a property value (to be retained from the second condition) to a signal with \$condition.toSignal(propertyName), and then use the signal result with setProperty(). You can see examples of adding a signal aggregation as a capsule property in Seeq's Formula documentation for setProperty(). I think one of these approaches should help with your use case.
12. ## Avoiding Unintended Changes When Editing Calculation Items: Duplicating Items, Worksheets, & Analyses

Summary/TLDR Users commonly want to duplicate Seeq created items (Value Search, Formula, etc.) for different purposes, such as testing the effect of different calculation parameters, expanding calculations to similar areas/equipment, collaboration, etc. Guidance is summarized below to prevent unintended changes. Duplicating Seeq created items on a worksheet Creates new/independent items that can be modified without affecting the original. Duplicating worksheets within a Workbench Analysis Duplicating a worksheet simply copies the worksheet but doesn't create new/independent items. A change to a Seeq created item on one sheet modifies the same item everywhere it appears, on all other worksheets. Duplicating entire Workbench Analysis Creates new/independent items in the duplicated Workbench Analysis. You can modify them without affecting the corresponding items in the original Workbench Analysis. Details Each worksheet in an analysis can be used to help tell the story of how you got to your conclusions or give a different view into a related part of your process. Worksheets can be added/renamed/duplicated, and entire analyses can also be duplicated: Worksheet and Document Organization Confusion sometimes arises for Seeq users related to editing existing calculation items (Value Searches, Formulas, etc.) that appear on multiple worksheets, within the same analysis. Often a user will duplicate a worksheet within an analysis and not realize that editing existing items on the new worksheet also changes the same items everywhere else they are used within the analysis. They assume that each individual worksheet is independent of the others, but this is not the case. The intent of this post is to eliminate this confusion and to prevent users making unintended changes to calculations. Working with the same item on a Duplicated Worksheet When duplicating worksheets, remember that everything within a single Workbench Analysis, no matter what worksheet it is on, is "scoped" to the entire analysis. Duplicating a worksheet simply copies the worksheet but doesn't create new/independent items. A change to an item on one sheet modifies it everywhere it appears (on all other worksheets). For some use cases, duplicating a worksheet is a quick way to expand the calculations further or to create alternate visualizations, and the user wants to continues working with the original items. In other situations, worksheet duplication may be a first step in creating new versions of existing items. To avoid modifying an original item on a duplicated worksheet, from the Item Properties (Detail Pane "i" symbol) for the calculated signal/condition of interest, click to DUPLICATE the item. You can edit the duplicated version without affecting the original. Duplicating worksheets is often useful when you are doing multiple calculation steps on different worksheets, when you want trends on one worksheet and tables or other visualizations on another, when doing asset swapping and creating a worksheet for each unique asset, etc. Working with Items in a Duplicated Workbench Analysis If you duplicate the entire Workbench Analysis (for example, from the Seeq start page, see screenshot below), new/independent items are created in the duplicated Workbench Analysis. You can modify the items in the duplicated Workbench Analysis, without affecting the original (corresponding) items in the original Workbench Analysis. This is often a good approach when you have created a lengthy set of calculations and you would like to modify them or apply them in a similar way for another piece of equipment, processing line, etc., and an asset group approach isn’t applicable. There is one exception to this: Seeq created items that have been made global. Global items can be searched for and accessed outside of an individual Workbench Analysis. Editing a global item in a duplicated analysis will change it everywhere else it appears. There are many considerations for best practices when testing new parameter values and modifications for existing calculations. Keep in mind the differences between duplicating worksheets and duplicating entire analyses, and of course consider the potential use of asset groups when needing to scale similar calculations across many assets, pieces of equipment, process phases, etc. There are in-depth posts here with further information on asset groups: Asset Groups 101 - Part 1 Asset Groups 101 - Part 2

14. ## Selecting 2nd or 3rd Highest/Lowest Signal

A common industrial use case is to select the highest or lowest signal value among several similar measurements. One example is identifying the highest temperature in a reactor or distillation column containing many temperature signals. One of many situations where this is useful is in identifying the current "hot spot" location to analyze catalyst deactivation/performance degradation. When selecting the highest value over time among many signals, Seeq's max() Formula function makes this easy. Likewise, if selecting the lowest value, the min() Formula function can be used. A more challenging use case is to select the 2nd highest, 3rd highest, etc., among a set of signals. There are several approaches to do this using Seeq Formula and there may be caveats with each one. I will demonstrate one approach below. For our example, we will use a set of 4 temperature signals (T100, T200, T300, T400). Viewing the raw temperature data: 1. We first convert each of the raw temperature signals to step interpolated signals, and then resample the signals based on the sample values of a chosen reference signal that has representative, regular data samples (in this case, T100). This makes the later formulas a little simpler overall and provides slightly cleaner results when signal values cross each other. For the T100 step signal Formula: Note that the T200 step signal Formula includes a resample based on using 'T100 Step' as a reference signal: The 'T300 Step' and 'T400 Step' formulas are identical to that for T200 Step, with the raw T signals substituted. 2. We now create the "Highest T Value" signal using the max() function and the step version T signals: 3. To create the '2nd Highest T Value' signal, we use the splice() function to insert 0 values where a given T signal is equal to the 'Highest T Value'. Following this, the max() function can again be used but this time will select the 2nd highest value: 4. The process is repeated to find the '3rd Highest T Value', with a very similar formula, but substituting in values of 0 where a given T signal is >= the '2nd Highest Value': The result is now checked for a time period where there are several transitions of the T signal ordering: 5. The user may also want to create a signal which identifies the highest value temperature signal NAME at any given point in time, for trending, display in tables, etc. We again make use of the splice() function, to insert the corresponding signal name when that signal is equal to the 'Highest T Value': Similarly, the '2nd Highest T Sensor' is created, but using the '2nd Highest T Value': (The '3rd Highest T Sensor' is created similarly.) We now have correctly identified values and sensor names... highest, 2nd highest, 3rd highest: This approach (again, one possible approach of several) can be extended to as many signals as needed, can be adapted for finding low values instead of high values, can be used for additional calculations, etc.

16. ## Create score card metric for capsule property directly in Table View

Hi, Currently you can add a capsule property to a condition type table without using the New Metric, by using the Row or Column buttons. But, while you do have filtering and sorting capabilities on these capsule properties in the table, this doesn't give you the ability to color code the table cells for that property (New Metric with thresholds is needed for that). So yes, currently you would need to convert the capsule property to a signal first. There is a new feature request in our development system to do exactly what you want, so this may be added in the future. John
17. ## How to display active capsules in a table?

The details and approach will vary depending on exactly where you are starting from, but here is one approach that will show some of the key things you may need. When you say you have 3 capsules active at any given time, I assume you mean 3 separate conditions. Assuming that is the case, you can create a "combined condition" out of all 9 conditions using Seeq Formula: // Assign meaningful text to a new capsule property // named TableDesription \$c1 = \$condition1.setProperty('TableDescription','High Temperature') \$c2 = \$condition2.setProperty('TableDescription','Low Pressure') and so forth... \$c9 = \$condition9.setProperty('TableDescription','Low Flow') // Create a capsule that starts 5 minutes from the current time \$NowCapsule = past().inverse().move(-5min) // Combine and keep only the currently active capsules (touching "now") combineWith(\$c1,\$c2,...,\$c9).touches(\$NowCapsule) You can then go to Table View, and click the Condition table type. Select your "combined condition" in the Details Pane and add a capsule property (TableDescription) using the Column or Row button at the top of the display. You can then set your display time range to include the current time, and you should see the currently active capsules with the TableDescription text that you assigned in the Formula. You of course will want to vary the "-5min" value and the 'TableDescription' values per what is best for you. Your approach may be a little different depending on where you are starting from, but I think that creating capsule properties (text you want to see in your final table), combining into one condition, and using .touches(\$NowCapsule), may all be things you will need in your approach. Here are some screenshots from an example I put together, where I used "Stage" for the capsule property name:
18. ## How to get a capsule that spans the display range?

Hello Siang, Currently, simple type scorecard metrics can't be used in Seeq Formula. We have recently added some functionality for using condition type scorecard metrics in Formula, but that will not help you in this use case. Your request to get a display range capsule is a good one and is already on our feature request list for our development team. For now, your best method is to create a Manual Condition, and add a capsule to the Manual Condition that is your current display range, to create a Display Range Condition. You can then use the Display Range Condition with Signal from Condition to calculate a signal representing the average (or other desired statistics) over the display range. That signal can be used in additional Formulas and calculations. When you want to change your analysis to a new display range, you will of course need to take one extra step to edit the Manual Condition and update it to match the current display range. John
19. ## Unable to see signal that changes infrequently

Hi Bayden, I would try something like this in Seeq Formula, on the signals that change infrequently: \$signal.validValues().toStep(30d) In place of the "30d" you would enter the maximum time that you want to connect data points and to see the lines drawn. Given you are working with setpoints, I would recommend converting them to step interpolation using .toStep(). If that doesn't get you to the final result that you want, you can add one further function: \$signal.validValues().toStep(30d).resample(1d) The resample will add more frequent data values at the period you specify (change the "1d" to whatever works best for you). You do need to be careful that you aren't adding any incorrect or misleading values with this approach, based on your knowledge of the signals. Let us know if this helps. I believe you can get a solution you are happy with. John
20. ## Difficulty adding data to previously imported signal via csv import

Hello Filip, When you want to add data to an already existing signal, you will want to find your original imported file in the Seeq Data tab, and click the edit button (circled in red below): You will then be able to drag a new file for import, and you will notice that you now have Replace and Append options (see an example I did below): You can choose to replace or append. I think this will solve your problem. If it does not, please let me know. Some additional information on adding new data to an existing imported signal can be found here in our Knowledge Base: Knowledge Base: CSV Import Replace and Append John
21. ## Create a Signal which Is Max or Min of Multiple Signals

Hi Brian, In more recent versions of Seeq, the max function used in that way (that specific syntax or form) only works with scalars. For your case, try \$p53h2.max(\$p53h3).max(\$p53h4) That is the form needed with signals. Hope this helps! John
22. ## standard deviation Event weighted Standard Deviation per 10 minutes

Hi Robin, 1) To answer your earlier question, to avoid the time weighted standard deviation, all you need to do is change the signal to a discrete signal and then apply the same formula: \$CanWeightSignal.toDiscrete() .aggregate(stdDev(), // std deviation statistic periods(10min,1min).inside(\$CanProductionCapsules), // do the calc over 10 min rolling window every minute // but only for 10 minute capsules fully inside CanProduction capsules endKey() // place the calculation result at the end of the 10 minute window , 0s) // max interpolation between data points, use 0s if you want discrete result 2) To answer your most recent question, to convert your current result to a stepped signal rather than the discrete results you now have on the trend, you can use a Formula function named .toStep(). Inside the parentheses, you enter the maximum amount of interpolation, the maximum amount of time you want to draw a line connecting your calculated results. For example, the function below sets a maximum interpolation between data points of 8 hours. .toStep(8hr) Hope this helps! John
23. ## Hi, i wonder about how i could remove peaks form signal and create a new signal?

Hello Mohammed, The answer depends on exactly what you want to remove from the signal. In some cases, you may want to do a Value Search to find the peaks you want to remove, then use the .remove() function in Seeq Formula to create the new signal with the peaks removed. In some cases, all you may need is to apply a smoothing filter (for example, agileFilter() in Seeq Formula or one of the Signal Smoothing options under the Cleanse Tools), or perhaps use removeOutliers() in Seeq Formula. The documentation below provides a great summary of the many data cleansing tools in Seeq. I hope this information is what you are looking for!
24. ## Count Steps in a capsule

I do not have access to your original signal for testing, so my solution not handle all the unusual characteristics that may occur. But I believe the approach below will help you get going on this calculation. 1. I would first recommend you create a clean weight signal that uses the remove() function to eliminate small decreases in the weight signal due to measurement noise and equipment variation. (This first step makes step 2 work accurately, because in step 2 we will be looking for the weight to go above 2000, 3000, 4000, etc., and we don't want noise variation from say 3002 lb to 2999 lb at the next sample, to appear to be a step decrease.) Create a clean weight signal using the formula below. This should result in a weight signal that only increases during the normal rampups, but still resets to 0 when the next rampup processing begins. Note that the 1hr inside of toStep() is the maximum interpolation between data values; set this based on your preferences. 2. Create the Step Counting Signal by dividing the clean weight (step 1 result) by 1000 and using the floor function to generate an integer result. 3. For an example signal that I tested with, you can see the Step Counting Signal incrementing as each 1000 lb increment is exceeded. Depending on your final analysis goals, further calculations could of course be done to calculate/report the number of steps completed for each of your original purple capsules or to do other types of statistics.
25. ## standard deviation Event weighted Standard Deviation per 10 minutes

Hi Robin, I would use a Seeq formula similar to the one below, with the Can Weight signal and your existing Can Production capsules as inputs. The key functions used are aggregate(), periods(), and inside(). Note that you could also do the std deviation calculation using Signal from Condition, using a condition created in Formula with: periods(10min,1min).inside(\$CanProductionCapsules). \$CanWeightSignal .aggregate(stdDev(), // std deviation statistic periods(10min,1min).inside(\$CanProductionCapsules), // do the calc over 10 min rolling window every minute // but only for 10 minute capsules fully inside CanProduction capsules endKey() // place the calculation result at the end of the 10 minute window , 0s) // max interpolation between data points, use 0s if you want discrete result Hope this helps! John
×
×
• Create New...