Seeq Team Emily Johnston Posted October 2, 2020 Seeq Team Share Posted October 2, 2020 Often times, limits are added manually in Seeq as a simple scalar value using formula: However, it is sometimes useful to be able to add limits manually, where the limit value may change over time. This can also be done using Seeq formula. The approach is to use the sample() function to specify the timestamp and value of the limit, and then to add new samples with a timestamp of when the limit changed and the new value. These samples will be inputs to a signal that can be displayed in Seeq. Keep in mind that the maximum interpolation will need to be set to an interval large enough to interpolate between limit value changes. In the below example, this is set for 10 days: signal(InterpolationMethod.Step, 10d, sample('2020-09-23T00:00:00Z', 80), sample('2020-09-24T00:00:00Z', 90), sample('2020-09-30T00:00:00Z', 95)) In order to adjust this signal to extend the last limit value (or last sample) to the current time, we will add another sample with a timestamp at now and a value holding the previous sample value: signal(InterpolationMethod.Step, 10d, sample('2020-09-23T00:00:00Z', 80), sample('2020-09-24T00:00:00Z', 90), sample('2020-09-30T00:00:00Z', 95), sample(now(), SCALAR.INVALID)) Finally, we will resample the signal in order to reduce the maximum interpolation of the result. This step can help improve the performance of this signal if it is used in further calculations, particularly if it will be spliced with another signal. signal(InterpolationMethod.Step, 10d, sample('2020-09-23T00:00:00Z', 80), sample('2020-09-24T00:00:00Z', 90), sample('2020-09-30T00:00:00Z', 95), sample(now(), SCALAR.INVALID)) .resample(1d) Now this code can be commented to ensure ease of future manual updates. These are done by simply adding a new sample with the timestamp and value of the limit change. signal(InterpolationMethod.Step, 10d, sample('2020-09-23T00:00:00Z', 80), sample('2020-09-24T00:00:00Z', 90), sample('2020-09-30T00:00:00Z', 95), //Insert next limit value as a new sample above this line //Code below extends last limit value to current time and resamples result to improve performance sample(now(), SCALAR.INVALID)) .resample(1d) The result is a limit signal created and updated manually in Seeq! Link to comment Share on other sites More sharing options...
Seeq Team Emily Johnston Posted October 2, 2020 Author Seeq Team Share Posted October 2, 2020 Another option for manual limits, is to use the csv 2.0 functionality to import the limits into Seeq as a signal. This may be useful if you're limit values are already in a spreadsheet format. More information on csv import 2.0 can be found in this Seeq Knowledge Base Article. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now