Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Engineering

Using My Data from PML

  • Last UpdatedJun 02, 2022
  • 1 minute read

From PML, elements and collections can be added, removed and edited. For example:

Add an Element

!!mydata.addElement('/VESS1')

!!mydata.addElement('/VESS2')

!!mydata.addElement('/PUMP1')

!!mydata.addElement('/PUMP2')

Add an Array of Elements

!a=object array()

!a[1]='/VESS1'

!a[2]='/VESS2'

!b=object array()

!b[1]='/PUMP1'

!b[2]='/PUMP2'

!!mydata.addElements(!a)

!!mydata.addElements(!b)

Remove an Element

!!mydata.removeElement('/VESS1')

Remove Everything (Elements and Collections)

!!mydata.removeAll()

Remove an Array of Elements

!!mydata.addElement('/VESS1')

!!mydata.addElement('/VESS2')

!!mydata.addElement('/PUMP1')

!!mydata.addElement('/PUMP2')

!!mydata.removeElements(!a)

Add a Collection

!!mydata.addCollection('My collection1')

!!mydata.addCollection('My collection2')

Add an Array of Collections

!collections = object array()

!collections[1] = 'My collection3'

!collections[2] = 'My collection4'

!!mydata.addCollections(!collections)

Remove a Collection

!!mydata.removeCollection('My collection1')

!!mydata.removeCollection('My collection2')

Remove an Array of Collections

!collections = object array()

!collections[1] = 'My collection3'

!collections[2] = 'My collection4'

!!mydata.removeCollections(!collections)

Add an Element to a Collection

!!mydata.addCollection('My collection1')

!!mydata.addCollection('My collection2')

!!mydata.addElementToCollection('/VESS1', 'My collection1')

!!mydata.addElementToCollection('/VESS2', 'My collection2')

Add an Array of Elements to a Collection

!!mydata.addCollection('My collection1')

!!mydata.addCollection('My collection2')

!a=object array()

!a[1]='/VESS1'

!a[2]='/VESS2'

!b=object array()

!b[3]='/PUMP1'

!b[4]='/PUMP2'

!!mydata.addElementsToCollection(!a, 'My collection1')

!!mydata.addElementsToCollection(!b, 'My collection2')

Remove an Element from a Collection

!!mydata.removeElementFromCollection('/VESS1', 'My collection1')

!!mydata.removeElementFromCollection('/VESS2', 'My collection1')

Remove all Elements

!!mydata.removeAllElements()

Remove all Elements from Collection

!!mydata.removeAllElementsFromCollection('My collection1')

Remove all Collections

!!mydata.removeAllCollections()

Remove an Array of Elements from a Collection

!!mydata.removeElementsFromCollection(!b, 'My collection2')

Rename a Collection

!!mydata.renameCollection('collectionA', 'collectionX')

!!mydata.renameCollection('collectionB', 'collectionY')

Query Elements and Collections

q var !!mydata.elements()

q var !!mydata.collections()

Query Elements in a given Collection

q var !!mydata.elementsInCollection('My collection1')

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in