Quantcast

Documentation Center

  • Trial Software
  • Product Updates

blp

Bloomberg V3 communications server connection

Syntax

Description

example

c = blp connects to the local Bloomberg® V3 communications server. You need a Bloomberg Desktop software license for the host on which the Datafeed Toolbox™ and MATLAB® software are running.

    Caution:   Use the connection object created by calling the blp function to refer to a Bloomberg connection in other functions. Otherwise, using blp as an argument opens multiple Bloomberg connections causing unexpected behavior and exhausting memory resources.

example

c = blp(p,ip,timeout) connects to the local Bloomberg communications server.

Examples

expand all

Connect to a Bloomberg Communications Server

Establish a connection c to a Bloomberg communications server.

c = blp
c = 
  blp with properties:
      session: [1x1 com.bloomberglp.blpapi.Session]
    ipaddress: 'localhost'
         port: 8194
      timeout: 0

blp creates a Bloomberg connection object c and returns its properties.

Connect to a Bloomberg Communications Server with a Timeout

Establish a connection using the default port and 'localhost' as the IP address, with a timeout value of 10,000 milliseconds.

c = blp([],[],10000)
c = 
  blp with properties:
      session: [1x1 com.bloomberglp.blpapi.Session]
    ipaddress: 'localhost'
         port: 8194
      timeout: 10000

blp creates a Bloomberg connection object c and returns its properties.

Input Arguments

expand all

p — Port number[] (default) | scalar

Port number, specified as a scalar to identify the port number of the local machine where Bloomberg is running.

Data Types: double

ip — IP address[] (default) | string

IP address, specified as a string to identify the local machine where Bloomberg is running.

Data Types: char

timeout — Timeout valuescalar

Timeout value, specified as a scalar to denote the time in milliseconds the local machine attempts to connect before timing out if the connection cannot be established.

Data Types: double

Output Arguments

expand all

c — Bloomberg V3 connectionconnection object

Bloomberg V3 connection, returned as a connection object. The properties of this object are as follows.

PropertyDescription

session

Bloomberg V3 API COM object

ipaddress

IP address

port

Port number

timeout

Number in milliseconds specifying how long MATLAB attempts to connect to a Bloomberg V3 communications server before timing out

More About

expand all

Tips

With the Bloomberg V3 release, there is a Java® archive file from Bloomberg that you need to install for blp and other Bloomberg commands to work correctly.

If you already have blpapi3.jar downloaded from Bloomberg, you can find it in your Bloomberg folders at: ..\blp\api\APIv3\JavaAPI\lib\blpapi3.jar or ..\blp\api\APIv3\JavaAPI\v3.3.1.0\lib\blpapi3.jar. If you have blpapi3.jar, go to step 3.

If blpapi3.jar is not downloaded from Bloomberg, then download it as follows:

  1. In your Bloomberg terminal, type WAPI {GO} to open the Desktop/Server API screen.

  2. Select SDK Download Center, and then click Desktop v3.x API.

  3. Once you have blpapi3.jar on your system, add it to the MATLAB Java class path using javaaddpath.

    You need to do this for every session of MATLAB. To avoid repeating this at every session, add javaaddpath to your startup.m file or add the full path for blpapi3.jar to your javaclasspath.txt file. For details about javaclasspath.txt, see The Java Class Path. For details about editing your startup.m file, see Specifying Startup Options in MATLAB Startup File.

See Also

| | | | | | |

Was this topic helpful?