Jump to content

Create multi-layered asset tree from csv file.


Sanman Mehta

Recommended Posts

TLDR

Asset trees are great way to scale your analysis to N number of assets.  Currently one needs working knowledge of SPy(Seeq-python) to build multi layered asset tree.  With the attached jupyter notebook, Add-on tool can be created as shown here so that users can generate their own multi layered asset trees in their workbenches which can then be shared with colleagues.

Pre-Requisite: Seeq Data Lab (powered by SPy module)

Detail steps:

1. Get a CSV file (can be done in excel and saved as CSV format) that has hierarchy of your asset tree structure.  The columns in screenshot below represent various hierarchical levels (columns A,B,C &D). You don't need exactly 4 columns, the solution supports any number of columns/hierarchical levels.  

2. Include a column for "Process Value" (column F in screenshot below) which are your tag values and a column for "Asset Tree Name" which will appear in the tree and are the common attribute names among assets (column E in screenshot below).

image.png

3. Use the attached jupyter notebook and create Add-on tool so any user can access the tool from Tools pane in workbench. This is one time step and should be done by someone who has experience with Seeq Data Lab.  The Tool name can be "Create Asset Tree from CSV File". Here is KB article on setting up new Add-on tool. https://support.seeq.com/space/KB/961675391/Add-on%20Tool%20Administration%20and%20Development

4. Use attached csv file and have your colleague who knows nothing about python, run the tool.  UI is self explanatory as seen below.

image.png

5. Refresh the workbench from which user created the Asset Tree and watch the results appear like so: 

image.png

Optional step 6: If there is no Add-on tool available, or you would like to build it step by step then add calculations, roll ups etc., check out the jupyter notebook named step_by_step_asset_tree attached below.

Example_SDL_Asset Tree (1).csv

 

 

Step_by_step_asset_tree.ipynb

Create_asset_tree_with_dynamic_class_R58_or_later.ipynb

Edited by Sanman Mehta
Added new notebook compatible with R58 onwards
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...

Hi,

I'm trying to build out an asset tree using your Step_by_step_asset_tree.ipynb script; however, I am getting a syntax error when I run:

%run dynamic_class.py

image.thumb.png.ba7f74cb3e1631fd419dffb99ec9b6ff.png

... which I assume has to do with my signal format as when I run the example it works as intended. Is anyone able to provide any insight into this?

Much appreciated.

Link to comment
Share on other sites

  • 3 months later...
1 minute ago, Sanman Mehta said:

Process value is your unique pi tag.

Just wanted to clarify if the unique Pi Tag should include the server also :

For example: \\<PI SERVER>\<PI Tag name>

Thank you very much for your prompt support.

 

Link to comment
Share on other sites

When I import a new Asset Tree using csv (after opening a Workbwench), the Asset Name/Tree is visible only from the parent workbench I started with.

Is this by design of SeeQ or just an artifact of how asset trees visibility is managed in my org's SeeQ platform ?

Link to comment
Share on other sites

Can a SeeQ condition be added as an "attribute" (Process Value) to each asset by some method (either while creating the asset tree via csv import or after the asset tree is create) ?

Context:

I am looking to have the same condition formula applied to different assets but keeping certain parameters flexible. For example, I am checking is $signal > 7 for Pump A vs $signal > 10 for pump B, where $signal is the same calc across all pumps.

Link to comment
Share on other sites

  • 1 month later...

Can these asset groups be accessed by different work-benches?

I spent quite a bit of time creating asset groups manually in a workbench only to later realize it wasn't accessible from other work-benches. Is it possible to make that available globally? 

Thank you!

Link to comment
Share on other sites

  • 2 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...