Using Libraries in Elipse E3: Lesson 3.

XObject

XObjects are data libraries which allow configuring a data structure to execute on the server. This structure can perform calculations, links, communication, alarm acknowledgement, historic recording, and much more.

To insert a new XObject in a Library, follow these steps:

  1. Right-click the XObjects, select the option Insert XObject in and then click the library file.

Figure 1

  1. Change the name XObject1 to any other suitable name.

When installing an XObject, there are two tabs on the lower side of the screen, Properties and Scripts. Because an XObject is a data structure, not a visual object, there is no Design tab.

In an XObject, it is possible to insert XProperties and any E3 module running on the server:

Figure 2

Developing XObjects

As you already have a Library file, you can create XObjects.

EngineTag

As an example, let’s develop an application which monitors the maintenance state, failure, and speed of each engine. Besides, in case the engine is on failure, an alarm must be triggered.

  1. Insert a new XObject named EngineTag.
  2. In the Properties tab, create three properties:

Figure 3

  1. Insert an Alarm Configuration object in the XObject.

Figure 4

  1. In the Alarm Configuration object, create an Area named Engine.
  2. In the Engine area, insert a Digital Alarm named FailAlarm to monitor the Fail property of the XObject.

Figure 5

  1. Right-click the FailAlarm object to access its properties, and choose a message for this alarm.

Figure 6

  1. Save and register the Library.

Using an XObject

Follow the next procedures to use the XObject:

  1. In the Data Server, insert three objects of type EngineTag, Engine1, Engine2, and Engine3.

Figure 7

  1. In the InitialScreen, create three buttons of type ToggleButton, Engine1, Engine2, and Engine3.
  2. Create a Bidirectional Link between the Value property of each button and the Fail property of its respective engine.

Figure 8

  1. Near each engine button, insert a Display to view the RPM. Make a link with the RPM property of the respective EngineTag.
  2. To view the alarms, insert an E3Alarm object on the Screen.
  3. In the E3Alarm, configure the Alarm Server Name property. In case there is no server available, insert an Alarm Server in the Domain.

Figure 9

  1. Execute the application.

Getting values

The XObject is a data structure with several properties. These properties can get values from other objects using links or scripts.

  1. In the Data object of the Data Server, create three Demo Tags named RPM1, RPM2, and RPM3 of type Random.

Figure 10

  1. Create a Simple Link between the RPM property of each TagEngine (Engine1, Engine2, and Engine3) with the respective Demo Tag.

Figure 11

  1. Execute the application.

Exercises

Maintenance Time

Now, let’s create an object which triggers an alarm if the device is turned on for more time than the recommended.

  1. Create an XObject named MaintenanceTime.
  2. In the Properties tab, create the following properties:

Figure 12

  1. In the XObject MaintenanceTime, insert a Data Server named Data.

Figure 13

  1. In the Data folder, insert a Counter Tag named Counter.

Figure 14

  1. Change the CounterType property of the Counter to 1 – Infinite.
  2. Create a link in the Counter Tag so that its value can be sent to the OnTime property.
  3. The property to enable or disable (Enabled) the Counter Tag must be linked to the OnOff property of the XObject.
  4. Insert an Alarm Configuration in the XObject.
  5. Create an Area with a Digital Alarm for OnTimeMaximumTime.
  6. Save and register the Library.
  7. Insert three MaintenanceTime objects in the Data folder, Time1, Time2, and Time3.
  8. Insert on the Screen a button of type ToggleButton, a Display, and a SetPoint. The button must be linked to the OnOff property, the Display to the OnTime property, and the SetPoint to the MaximumTime property of a MaintenanceTime object.

Figure 15

  1. To view the alarms, insert on the screen an E3Alarm object and check if there is an Alarm Server object on the Domain (create one if not).
  2. Execute the application and test its functionalities.

ValveTag

Let’s create an object which saves a historic of failure, open, or closed statuses of all valves in the database.

  1. Create an XObject named ValveTag.
  2. In the Properties tab, create the following properties:

Figure 16

  1. Perform the following configuration:
  • When the Open property is true, the Text property must be “ValveName open”, and when the property is false, the Text property must be “ValveName closed”.
  • When the Fail property is true, the Text property must be “ValveName on failure”, and when the property is false the Text property must be “ValveName working normally”.
  1. To save the text in the database, insert a Historic object in the XObject ValveTag.
  2. In the Historic, insert a field named Message to store the Text property of the ValveTag.
  3. O Histórico deve gerar a tabela Valvula e gravar um novo registro sempre que o texto for alterado.
  4. Save and register the Library.
  5. Insert two ValveTag objects in the Data folder, Valve1 and Valve2.
  6. On the Screen, insert two buttons of type ToggleButton and one Display. One button must be linked to the Open property, the other one to the Fail property, and the Display to the Text property of the ValveTag object. Do this for the other two objects inserted.
  7. Execute the application and test its functionalities.

Attachments:

LibrariesCap3.zip

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *