Documentation

blp

Bloomberg Desktop connection V3

The blp function provides the connection to the Bloomberg® Desktop.

There are other functions that connect to different Bloomberg services: Bloomberg Server (blpsrv), Bloomberg B-PIPE® (bpipe), and Bloomberg Data License (bdl). For details about these Bloomberg services, see Comparing Bloomberg Connections.

For the functions to run correctly, each function requires specific installation files. For details, see Data Server Connection Requirements.

Syntax

Description

example

c = blp connects to the Bloomberg Desktop. 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(portnumber,ip,timeout) connects to Bloomberg Desktop using the IP address of the local machine where Bloomberg is running and a timeout value.

Examples

collapse all

Connect to a Bloomberg Desktop

Establish a connection c to a Bloomberg Desktop.

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 Desktop with a Timeout

Establish a connection c 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.

Related Examples

Input Arguments

collapse all

portnumber — 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

collapse all

c — Bloomberg Desktop connection V3connection object

Bloomberg Desktop connection V3, returned as a connection object with these properties.

PropertyDescription

session

Bloomberg V3 API COM object

ipaddress

IP address of the local machine

port

Port number of the local machine

timeout

Number in milliseconds specifying how long MATLAB attempts to connect to Bloomberg Desktop before timing out

Was this topic helpful?