DeltaV Live : Script query

1. I am trying to understand how scripting works in DeltaV Graphic studio. Understood that syntax part is majority TYPE SCRIPT and DeltaV itself has provided inbuilt functions.

2. In my effort to understand in deep, got stuck on following part of script 

Query : why TYPES is used in this expression 

 

I have understood following

1. The script basically deals with position of pop display opened.
2. Placement is a object and it has multiple property, values of which determine pop display position. (Pic attached from books online).
3. NEW keyword basically defines new instance of object which is Pos.
4. Let keyword is defining a variable 

I am not able to understand why TYPES is written in this expression ??

Thanks alot for any help/hint in understanding this.

  • Although I know very little about DeltaV Live I would assume that Types is simply the name of the library that contains the definition of the Placement class. Maybe others with more knowledge can confirm this.
  • Hi Cedric Dawnhawk

    Thanks for your reply. I received following reply from Emerson product engineer

    I am not a JS programmer but i am able to understand that Placement is a JS class.

    But he is saying TYPES is an object which holds DeltaV classes.

    Can a object store classes ?? I learned that object has properties their values and methods. Class is basically one of the way through which we can create objects. 

    Thanks !

  • In reply to Devpriy sahu:

    The way I see this is that Types is a container, and it could be based on a Container Class. A class instance is an object created from a Class, but is not a class itself. And the word Container is merely a description of what that Class is used for. i.e. contains other classes.

    A Class will have Properties and Methods. Those are passed on to any instance created from that class. The class and all its instances are objects in your program. Hence the term Object Oriented. The Methods control how the program can interface with the Object, protecting the data stored within by using methods that can validate any writes or condition any reads. And the biggest benefit is that you can change the underlying functions within the Class/Instances and as long as the methods and properties remain consistent, all your other code is unaffected by those changes.

    Objects are not necessarily Classes, but classes are objects. Container classes hold other classes. All are objects. With DeltaV Live, there are existing objects that give structure within the programming environment. The syntax for creating a Placement Object shows that this Placement Class is in the container Types. "Types" in my opinion is an instance of a Container Class that is part of DeltaV Live. I don't know if we can even use that class to create our own Container Class. I'm thinking user Classes and their instances are contained in the Display container you create them in. The Types classes are documented for the syntax to use them.

    Anyway, I'm not a programmer, and also on my journey with Live. But this is how I see these structures.

    Andre Dicaire

  • In reply to Andre Dicaire:

    Hi

    Thanks for your detailed answer. What you wrote make logical sense.
    i was expecting detailed answer like this from Emerson PE.