Jump to content

Create a Scalar on an Asset Tree Upload


Recommended Posts

Hello Guys,

Is there any way to create a scalar during an upload of Asset Tree. Looking at Tanks Levels and would like to Create PvHi and PvLo at the same time

Level 6 Name Friendly Name Datasource Name ID Type
A EXP.LI42CPW.P Process Variable     Stored Signal
  Scalar here PVHIHI     LiteralScalar
B EXP.LI44SUMP.P Process Variable     Stored Signal
  Scalar here PVHIHI     LiteralScalar
C DGP.LI30BNK1.P Process Variable     Stored Signal
  Scalar here PVHIHI     LiteralScalar

 

Link to comment
Share on other sites

  • Seeq Team

Hi David, 

You can use the iterrows() function to loop over your DataFrame and add the scalars. 

Let's say I have a DataFrame with all PVHI and PVLO limits: 

image.png

I can apply iterrows() function to add these limits to my asset:

for index, row in csv.iterrows():
    #add Hi/HiHi Limits
    my_csv_tree.insert(name = row['Limits 1 Name'], 
                       formula = str(row['Limits 1']), 
                       parent = row['Level 3'])
    
    #add Lo/LoLo Limits
    my_csv_tree.insert(name = row['Limits 2 Name'], 
                       formula = str(row['Limits 2']), 
                       parent = row['Level 3'])
    
my_csv_tree.visualize()

The asset tree will look like this:

My CSV Tree
|-- Cooling Tower 1
|   |-- Area A
|   |   |-- PVHIHI
|   |   |-- PVLO
|   |   |-- Temperature
|   |-- Area B
|       |-- PVHIHI
|       |-- PVLO
|       |-- Temperature
|-- Cooling Tower 2
    |-- Area D
    |   |-- PVHI
    |   |-- PVLO
    |   |-- Temperature
    |-- Area E
        |-- PVHI
        |-- PVLO
        |-- Temperature

 

Link to comment
Share on other sites

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...