Jump to content

Thorsten Vogt

Super Seeqer
  • Posts

    171
  • Joined

  • Last visited

  • Days Won

    53

Everything posted by Thorsten Vogt

  1. Hi Margarida, you can use the following settings in the request body: { "unitOfMeasure": "string", "value": "{\"type\":\"formula\",\"advancedParametersCollapsed\":true,\"helpShown\":false}" } If you want to switch back to the UI tool you should save your previous value somewhere, so you could reuse this in the POST request. Regards, Thorsten
  2. Hello Margarida, you can access the API Reference by clicking the hamburger button at the top right corner of Seeq: In the API reference you will find an entry called "Items" which has the appropriate methods available. Regards, Thorsten
  3. Hi Margarida, as a workaround you can use the REST API to convert an element to a formula. Each item has a property called "UIConfig" that stores the information which user interface should be used when editing the element. You can use the endpoint /items/{id}/properties/{propertyName} to update (POST) or remove (DELETE) it. However you should be careful using the API, as you may break things. Both removing and updating the property had the effect that Seeq is opening the formula editor instead of the UI tool. Regards, Thorsten
  4. Hi Sophie, the function duration() can only be applied on capsules, not on conditions. You can calculate the duration for each capsule of the condition using the "Signal from Condition" tool. The resulting value can be used within a formula to multiply it by a scalar as you intended. When using the "Signal from condition" Tool you can always have a look at the formula the tool is creating in the background or duplicate it to a formula that you may use for further calculations. This is a good starting point for the more advanced use of the formula language. Regards, Thorsten
  5. Hi Margarida, removing the statistic from the Scorecard Metric will show the raw value of the signal and setting thresholds will display the bounds as a shaded area. I am not quite sure if this works in Capsule View, so you may switch back to Calendar or Chaing View for that: Regards, Thorsten
  6. Hi Margarida, you get two values because of the condition. The first value is calculated when the time signal is increasing and equals 47, the second value when the value decreases to 0 at the end, running through 47 again. The endKey() puts the value at the end of the condition you used for identification ($time == 47), which results in a single point in time. To get the value to the end of the condition you could try to use the following formula: $signal.aggregate(startValue(), ($time >= 47).removeLongerThan(1wk), endkey()) This will get a capsule starting at $time == 47 up to the end of the batch. StartValue() gets the value at the start of the capsule which is put at the end of the capsule using endKey(). Regards, Thorsten
  7. If I understood you correctly you would have one value for the blue and one value for the orange signal foreach batch, right? If you have the values available inside the batch itself you could try to bring them to the batch start. In the following example I have two values at two different phases inside a batch: You can create a new signal that gets the average value for each of the signals and puts it on the batch start: Changing to XY Plot displays a value for the batch: Extending the timeframe shows values for the other batches as well: Regards, Thorsten
  8. Hi MArgarida, the XY-Plot creates a point for every timestamp that exists on the signals. As your signals do not share the same timeframe nothing is displayed on the chart. It cannot calculate a value on the blue signal when values on the orange one exist and vice versa. Also I think it will be hard to get a correlation between one value (the blue signal) and multiple values (the orange signal). I would start by creating a calculation (e.g. average) for the orange signal and move that result and the value for the blue signal on one timestamp (e.g. the start of the batch). Regards, Thorsten
  9. I don't know your exact requirements, but I guess for quering hourly values for 30 signals once a day a for loop is a good start. You can try the Microsoft.Data.Analysis Package (https://www.nuget.org/packages/Microsoft.Data.Analysis/). It contains a DataFrame class, which is similar to a Pandas DataFrame. I modified the example from above making use of the DataFrame class and filtering on rows where the value is greater than 100: List<DateTime> keys = new List<DateTime>(); List<double> values = new List<double>(); do { samples = signalsApi.GetSamples(signalId, start, end, null, null, null, null, null, offset, numberOfItems); foreach (Seeq.Sdk.Model.SampleOutputV1 sample in samples.Samples) { keys.Add((DateTime)sample.Key); values.Add((double)sample.Value); } offset += numberOfItems; } while (!string.IsNullOrEmpty(samples.Next)); Microsoft.Data.Analysis.DataFrameColumn[] columns = { new Microsoft.Data.Analysis.PrimitiveDataFrameColumn<DateTime>("Key", keys), new Microsoft.Data.Analysis.PrimitiveDataFrameColumn<double>("Value", values) }; Microsoft.Data.Analysis.DataFrame df = new Microsoft.Data.Analysis.DataFrame(columns); df = df.Filter(df["Value"].ElementwiseGreaterThan(100)); foreach (Microsoft.Data.Analysis.DataFrameRow row in df.Rows) Console.WriteLine("{0} : {1}", row[0], row[1]);
  10. Hi Acerion12, I am not quite sure what you mean with getting a signal limited by date range. So I created a quick-and-dirty example to get a signal by its ID and also retrieve its samples over a specific date range. The query will only return 40 samples for each call. Seeq.Sdk.Client.ApiClient client = new Seeq.Sdk.Client.ApiClient("https://<YOUR SERVER>/api"); Seeq.Sdk.Api.AuthApi authApi = new Seeq.Sdk.Api.AuthApi(client); authApi.Login(new Seeq.Sdk.Model.AuthInputV1 { Username = "<YOUR ACCESSKEY>", Password = "<YOUR PASSWORD FOR THE ACCESSKEY>" }); string signalId = "14E630B3-E615-4B84-9EE3-4B685D5A3938"; Seeq.Sdk.Api.SignalsApi signalsApi = new Seeq.Sdk.Api.SignalsApi(client); Seeq.Sdk.Model.SignalOutputV1 signal = signalsApi.GetSignal(signalId); Console.WriteLine("Signal: {0}", signal.Name); string start = DateTime.Now.AddDays(-3).ToUniversalTime().ToString("o"); string end = DateTime.Now.AddDays(-2).ToUniversalTime().ToString("o"); int offset = 0; int numberOfItems = 40; Seeq.Sdk.Model.GetSamplesOutputV1 samples; do { samples = signalsApi.GetSamples(signalId, start, end, null, null, null, null, null, offset, numberOfItems); foreach (Seeq.Sdk.Model.SampleOutputV1 sample in samples.Samples) Console.WriteLine("{0} : {1}", sample.Key, sample.Value); offset += numberOfItems; } while (!string.IsNullOrEmpty(samples.Next)); client.Logout(); Does this answer your question? Regards, Thorsten
  11. Hi Martin, yes, this is possible with SDL. Here is an example: # Search for signals signals = spy.search({"Name":"cdt158*"}) Result: metadata = signals.copy() # Specify new Name by creating one based on the Original Name metadata["OriginalName"] = metadata["Name"] metadata["Name"] = "Derivative of " + metadata["Name"] # Attach column with Seeq Formula metadata["Formula"] = "$signal.derivative()" # Attach column with parameters for the Formula metadata["Formula Parameters"] = "$signal =" + metadata["ID"] # Remove ID Column, otherwise Seeq will try to update the original signal and not create a new one metadata = metadata.drop(columns=["ID", "OriginalName"]) The metadata DataFrame looks like this: # Push metadata to Seeq spy.push(metadata=metadata, worksheet="METADATA") When opening the link that spy.push generated, you can view the results within Workbench: Let me know it this works for you. Regards, Thorsten
  12. Hi Yassine, seems like you set the Max Interpolation to 5 days. The gaps in the screenshot seem to be bigger than that value. Can you check setting the value to a higher value?
  13. Can you post the formula you are using for summing the signals up?
  14. Hi Nate, that means that the values are uncertain and might be able to change (e.g. by using compression on the historian). Example: You may notice the sample at ~15:39 was removed by the historian: Now the datapoint was written to the achive. Notice the value from above (~15:46) was also removed: Hope this helps. Regards, Thorsten
  15. Hi Yassine, it would be helpful if you could provide some more details, like how the calculation is done or if there are warning or errors showing up in the Details Pane. In most cases gaps in the data appear if the maximum interpolation defined for the the signal is to small or invalid values exist in the data. So you might want to try setting the maximum interpolation to a higher value (using $signal.setMaxInterpolation()) or remove invalid values (using $signal.validValues). More information can also be found in this post: Regards, Thorsten
  16. Hi Jessica, there are some functions you can use to handle the validity of data: $signal.isNotValid() identifies periods where you have invalid data (like errorneous data from a sensor) resulting in a capsule $signal.isValid() identifies periods where you have valid data $signal.replaceNotValid(alternateValue) replaces periods with invalid data inside a signal with an alternate value Regards, Thorsten
  17. Hi Brian, you can filter Signal 2 using within() and use the resulting signal for further calculations: Regards, Thorsten
  18. Hi Micah, you can do this with a transform: $inputB.transform($capsule -> { $capsulesOfInputA = $inputA.removeLongerThan(1wk).toGroup($capsule) $start = $capsulesOfInputA.first().startKey() $end = $capsulesOfInputA.last().endKey() capsule(max($start, $capsule.startKey()), min($end, $capsule.endKey())) }) As the capsules for the output can only be as long as the capsules of Input B, I am using max() and min() to reduce the capsule length if capsules of Input A overlap with the beginning or end of a capsule of Input B (see first result). Regards, Thorsten
  19. Hi Christopher, regarding your points 2 and 3: You can specify a timezone in the hours() and days() function. As Seeq uses the timezone of the server the start of the day might differ from the timezone you selected for displaying the data. You can see the difference here: The spike at hour 23 is occuring because you created a signal that has the value of the hour at the beginning. Therefore it interpolates the values from 23 to 0 within that hour, so that the conditions you created apply and the calculated values are spliced into the original signal. A better approach would be using timesince(). This function calculates the amount of time that has passed since the beginning of the capsule: Changing your code in line 8 to $DayHours = timesince(days('<your timezone>'), 1h) should resolve the spike and the need to shift the signal by 5 hours. Regards, Thorsten
  20. One more comment on the post above: The within() function is creating additional samples at the beginning and the end of the capsule. These additional sample have an effect on the calculations performed in the histogram. To avoid this you can use the remove() and inverse() function to remove parts of the data when the condition is not met: In contrast to within() the remove() function will interpolate values if the distance between samples is less than the Maximum Interpolation setting of the signal. To avoid this when using remove you can combine the signal that the remove function creates with a signal that adds an "invalid" value at the beginning of each capsule so that the interpolation cannot be calculated: $invalidsAtCapsuleStart = $condition.removeLongerThan(1wk).tosamples($c -> sample($c.startkey(), SCALAR.INVALID), 1s) $signal.remove($condition.inverse()).combineWith($invalidsAtCapsuleStart) You can see the different behaviours of the three described methods in the screenshot:
  21. Hi SBC, applying the the within() function to your signal will result in a new signal that only keeps those parts of the signal where the condition is met. The filtered signal can then be used for the histogram. Regards, Thorsten
  22. Hello John, beginning in R57 you can adjust the number of characters to be displayed. https://seeq.atlassian.net/wiki/spaces/KB/pages/2344943627/What+s+New+in+R57#Customizable-formatting-for-string-labels-on-the-y-axis Regards, Thorsten
  23. Hi Victor, you can use within() for that: Regards, Thorsten
  24. Hi, you can use spy.login with the access_key parameter: spy.login(access_key="CagR-n4oQGqjlAb7e6fr3B", password="Ec9DaXnSXgaG969cjkv4d4iGdGiAah" ,url="https://myseeqserver") Regards, Thorsten
  25. Hello, you can change this by clicking on "Customize" in the Details pane and then switch the value of the dropdown in the "Samples" column: Regards, Thorsten
×
×
  • Create New...