Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

blpsrv

Bloomberg Server connection V3

The blpsrv function provides the connection to the Bloomberg® Server.

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

For details about Bloomberg connection requirements, see Data Server Connection Requirements. To ensure a successful Bloomberg connection, perform the required steps before executing blpsrv. For details, see Installing Bloomberg and Configuring Connections.

Syntax

c = blpsrv(uuid,serverip)
c = blpsrv(uuid,serverip,portnumber)
c = blpsrv(uuid,serverip,portnumber,timeout)

Description

example

c = blpsrv(uuid,serverip) creates a Bloomberg Server connection c to the Bloomberg Server running on another machine. This machine is identified by IP address serverip using your Bloomberg UUID. You need a Bloomberg Server license for the machine running the Bloomberg Server.

Caution:

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

example

c = blpsrv(uuid,serverip,portnumber) connects to the Bloomberg Server using a specific port number.

example

c = blpsrv(uuid,serverip,portnumber,timeout) connects to the Bloomberg Server using a timeout value.

Examples

collapse all

Connect to the Bloomberg Server using the IP address of the machine running the Bloomberg Server. This code assumes the following:

  • The Bloomberg UUID is 12345678.

  • The IP address serverip for the machine running the Bloomberg Server is '111.11.11.111'.

uuid = 12345678;
serverip = '111.11.11.111';

c = blpsrv(uuid,serverip)
c = 

  blpsrv with properties:

         uuid: 12345678
         user: [1x1 com.bloomberglp.blpapi.impl.aT]
       userip: '111.11.11.112'
      session: [1x1 com.bloomberglp.blpapi.Session]
    ipaddress: '111.11.11.111'
         port: 8194
      timeout: 0

blpsrv connects to the machine running the Bloomberg Server using the default port number 8194. blpsrv creates the Bloomberg Server connection object c with these properties:

  • Bloomberg user identity UUID

  • Bloomberg user identity object

  • IP address of the machine running MATLAB®

  • Bloomberg API object

  • IP address of the machine running the Bloomberg Server

  • Port number of the machine running the Bloomberg Server

  • Number in milliseconds specifying how long MATLAB attempts to connect to the machine running the Bloomberg Server before timing out

Close the Bloomberg Server connection.

close(c)

Connect to the Bloomberg Server using the IP address of the machine running the Bloomberg Server. This code assumes the following:

  • The Bloomberg UUID is 12345678.

  • The IP address serverip for the machine running the Bloomberg Server is '111.11.11.111'.

  • The default port number is 8194.

uuid = 12345678;
serverip = '111.11.11.111';
portnumber = 8194;

c = blpsrv(uuid,serverip,portnumber)
c = 

  blpsrv with properties:

         uuid: 12345678
         user: [1x1 com.bloomberglp.blpapi.impl.aT]
       userip: '111.11.11.112'
      session: [1x1 com.bloomberglp.blpapi.Session]
    ipaddress: '111.11.11.111'
         port: 8194
      timeout: 0

blpsrv connects to the machine running the Bloomberg Server using the default port number 8194. blpsrv creates the Bloomberg Server connection object c with these properties:

  • Bloomberg user identity UUID

  • Bloomberg user identity object

  • IP address of the machine running MATLAB

  • Bloomberg API object

  • IP address of the machine running the Bloomberg Server

  • Port number of the machine running the Bloomberg Server

  • Number in milliseconds specifying how long MATLAB attempts to connect to the machine running the Bloomberg Server before timing out

Close the Bloomberg Server connection.

close(c)

Connect to the Bloomberg Server using the IP address of the machine running the Bloomberg Server. This code assumes the following:

  • The Bloomberg UUID is 12345678.

  • The IP address serverip for the machine running the Bloomberg Server is '111.11.11.111'.

  • The port number is your default port number.

  • The timeout value is 10 milliseconds.

uuid = 12345678;
serverip = '111.11.11.111';
portnumber = [];
timeout = 10;

c = blpsrv(uuid,serverip,portnumber,timeout)
c = 

  blpsrv with properties:

         uuid: 12345678
         user: [1x1 com.bloomberglp.blpapi.impl.aT]
       userip: '111.11.11.112'
      session: [1x1 com.bloomberglp.blpapi.Session]
    ipaddress: '111.11.11.111'
         port: 8194
      timeout: 10

blpsrv connects to the machine running the Bloomberg Server using the default port number 8194 and a timeout value of 10 milliseconds. blpsrv creates the Bloomberg Server connection object c with these properties:

  • Bloomberg user identity UUID

  • Bloomberg user identity object

  • IP address of the machine running MATLAB

  • Bloomberg API object

  • IP address of the machine running the Bloomberg Server

  • Port number of the machine running the Bloomberg Server

  • Number in milliseconds specifying how long MATLAB attempts to connect to the machine running the Bloomberg Server before timing out

Close the Bloomberg Server connection.

close(c)

Input Arguments

collapse all

Bloomberg user identity UUID, specified as a numeric scalar. To find your UUID, enter IAM in the Bloomberg terminal and press GO.

Example: 12345678

Data Types: double

Bloomberg Server IP address, specified as a character vector or string scalar to identify the machine where the Bloomberg Server is running.

Data Types: char | string

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

Data Types: double

Timeout value that denotes the time in milliseconds the local machine attempts to connect before timing out, specified as a numeric scalar.

Data Types: double

Output Arguments

collapse all

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

Property

Description

uuid

Bloomberg user identity UUID

user

Bloomberg user identity object

userip

IP address of the machine running MATLAB

session

Bloomberg API object

ipaddress

IP address of the machine running the Bloomberg Server

port

Port number of the machine running the Bloomberg Server

timeout

Number in milliseconds specifying how long MATLAB attempts to connect to the machine running the Bloomberg Server before timing out

Introduced in R2014b

Was this topic helpful?