libraries_demo project setup in ''eclipse''

Please, follow these steps to setup an eclipse Java project for the libraries_demo project.

The demo project provides demo classes for confirmed associations using AssociationRequest/Response services.

Unzip in a new directory

The demo project is in the libraries_demo sub directory.

The libraries_demo directory structure looks like this:


Start Eclipse.

Select a new suitable workspace.


Import the libraries_demo project

Notice that you cannot import libraries_demo if you already have a project with the same name in the workspace.

Select File/Import/General/Existing Projects into Workspace


Check the Java build path:

Click on libraries_demo Properties/Java Build Path/Libraries and check the following:


Confirmed associations using AssociationRequest

Select de demo example and set the parameters

In the Package explorer, go to 'src/icube.demo', there are 2 demos. HdlcDemo uses the HDLC communication profile and WrapperDemo uses the TCP communication profile with the 'Wrapper''. Select one of the demo and go to the initializeParameters() method.

For the HDLC demo, define the HDLC parameters, for example:

  • ClientMacAddress = 16 or (0x10) is means ''public client''
  • ServerAddressSize = 1 (for one byte addressing, can also be 2 or 4)
  • ServerUpperMacAddress = 1 (is the address of the ''management logical device'').
  • ServerLowerMacAddress = x (is the physical address of the meter, not needed when ServerAddressSize = 1)

For a WRAPPER demo, define the WRAPPER parameters:

  • ClientAddress = 16 (public client),
  • ServerAddress = 1 (management logical device)
  • Host = "" (IP address of the server)
  • Port = 2078 (port that the server listens to)

Create a new "Run configuration" :

Select Run/Run Configurations.../Java Application


Then, run it without arguments; the output should be as follows, which is just a connection and a disconnection of the HDLC layer:


Define the arguments

In the run configuration, select 'Argument' and add either the  AssociationRequest_SN_NoPW.xml file if your meter supports short names referencing or Associationrequest_LN_NoPW.xml file if your meter supports long names referencing. These files contain XML presentations of AssociationRequest services The demo send the encoded content of this file after having connected the HDLC layer, which then establish an application association.


Run it and you should have something like this:


You can list several xml files in the Run Configuration/Arguments/Program arguments, the demo will process all the files in order. You may add (when using logical names referencing)  GetRequestNormal(Clock).xml which sends a GetRequest to read the ''time'' attribute of the clock; or ReadRequest(ObjectsList).xml (when using short names) which sends a ReadRequest to read the objec-list of the device.