get

Properties of Bloomberg connection V3

Syntax

Description

example

v = get(c) returns a structure where each field name is the name of a property of c and each field contains the value of that property.

example

v = get(c,properties) returns the value of the specified properties properties for the Bloomberg® V3 connection object.

Examples

expand all

Retrieve Bloomberg Connection Properties

Create the Bloomberg connection.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE® using bpipe.

Retrieve the Bloomberg connection properties.

v = get(c)
v = 

      session: [1x1 com.bloomberglp.blpapi.Session]
    ipaddress: 'localhost'
         port: 8194
      timeout: 0

v is a structure containing the Bloomberg session object, IP address, port number, and timeout value.

Close the Bloomberg connection.

close(c)

Retrieve One Bloomberg Connection Property

Create the Bloomberg connection.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE using bpipe.

Retrieve the port number from the Bloomberg connection object by specifying 'port' as a string.

property = 'port';
v = get(c,property)
v =

        8194

v is a double that contains the port number of the Bloomberg connection object.

Close the Bloomberg connection.

close(c)

Retrieve Two Bloomberg Connection Properties

Create the Bloomberg connection.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE using bpipe.

Create a cell array properties with strings 'session' and 'port'. Retrieve the Bloomberg session object and port number from the Bloomberg connection object.

properties = {'session','port'};
v = get(c,properties)
v = 

    session: [1x1 com.bloomberglp.blpapi.Session]
       port: 8194

v is a structure containing the Bloomberg session object and port number.

Close the Bloomberg connection.

close(c)

Input Arguments

expand all

c — Bloomberg connectionconnection object

Bloomberg connection, specified as a connection object created using blp.

properties — Property namesstring | cell array

Property names, specified as a string or cell array of strings containing Bloomberg connection property names. The property names are session, ipaddress, port, and timeout.

Data Types: char | cell

Output Arguments

expand all

v — Bloomberg connection propertiesscalar | string | object | structure

Bloomberg connection properties, returned as a scalar if the port number or timeout is requested, a string if the IP address is requested, an object if the Bloomberg session is requested, or a structure if all properties are requested.

Was this topic helpful?