Seeq Team Sean T Posted June 30, 2023 Seeq Team Share Posted June 30, 2023 This post is run on spy version 189.1 and should be accurate for any spy module versions prior to 189.1 This question came up recently: "I am building asset trees using Seeq Data Lab (using the Spy.trees functionality or spy.assets functionality). When i create my tree i realize that i want to update some of the metadata- maybe the Unit of Measure is wrong for signals in my tree, maybe i need to change the interpolation method or duration. Usually, when we want to mass update metadata using Data Lab, i search for my signals to update, update the cells in the dataframe that need to be updated, then push that information back using Spy.Push(). In this case the push executes without error but my metadata never updates, why? What am i doing wrong?" When a formula is created in Seeq, the only way to change certain metadata fields is through use of formulas. This specifically applies to Units of Measure (using .setUnits(), .reduceUnits(), or .convertUnits() ) Interpolation Method (.toLinear(), .toStep(), .toDiscrete(), .toPiLinear() ) Max Interpolation Period (using .setMaxInterpolation() ) for conditions, the max condition duration (using .removeLongerThan() ) Lets take a look at an example. Here i have an asset tree built based on the example data tree: Here is my Tree in Workbench: Lets say that i need to update all of the "Compressor Power" signals in my tree because the following are incorrect: Unit of Measure: the current UoM is kW, i need W Interp Method: Currently Linear, i need Step Description: i want to add a description, "test" in this case Name: i dont like the name and want to change it to Comp Power Here you can see my search to find these signals i want to update, i have underlined some of the values i want to change: Here i update my metadata in the dataframe and push: Things seem to be updated as i would like and the push worked fine. If i find one of these signals in workbench though, i see the following: Only some of my Metadata actually updated as i would like. Because Data Lab built trees use a formula to reference the original signal when building trees, we need to use the formula operators to change any metadata that can be adjusted by a formula operator. Here, in order to make my desired changes, i should update my "Formula" column instead of the "interpolation Method" and "Value Unit Of Measure" columns as follows: Change Formula from '$signal' (or whatever it was) to '$signal.toStep().setUnits("W")' or whatever the original formula was, with my metadata changing operators appended on the end. Here you can see it in Data Lab: Now when i check my signal in workbench i see that my metadata was updated as expected: In Summary: when updating Metadata for items that are calculated in Seeq (Items in from a tree made using Seeq Data Lab, for example), if the parameter can be updated by a formula operator (from the list: Value Unit Of Measure, Interpolation Method, Maximum Interpolation, Maximum Duration) then that parameter MUST be updated by using the formula operator. The easiest way to do this is to just append the formula changes to the existing formula in the "Formula" column. Updates for other Metadata parameters can be made directly in the dataframe and pushed back. 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