Unit OP831MDLL

Uses
Classes, Interfaces, Objects and Records
Constants
Variables

Description

OP815/OP831/OP925 DLL Functions

Overview

Functions and Procedures

function OP815_Backlight(state: integer): integer stdcall;
function OP815_GetActiveChannel(var channel: integer): integer stdcall;
function OP815_GetBidirectionalReference(): integer; stdcall;
function OP815_GetChannelBuffer(): integer stdcall;
function OP815_GetDLLRev: integer stdcall;
function OP815_GetDLLStatus: integer stdcall;
function OP815_GetFWRevision: integer stdcall;
function OP815_GetModuleID(var id: integer): integer stdcall;
function OP815_GetModuleNumber(var num: integer): integer; stdcall;
function OP815_GetNumSources(): integer; stdcall;
function OP815_GetSourceTable(srcNum : byte; var waveIndex: byte; var power: byte; var maxPower: byte): integer; stdcall;
function OP815_GetTemperature(var tempC: double; units: integer): integer stdcall;
function OP815_GetUSBDeviceCount(var deviceCount: integer): integer stdcall;
function OP815_GetUSBDeviceDescription(deviceNumber: integer; var deviceDescription: pansichar): integer stdcall;
function OP815_GetUSBSerialNumber(deviceNumber: integer; var serialNumber: pansichar): integer stdcall;
function OP815_GetUSBStatus(var haveError: boolean):integer stdcall;
function OP815_GetWavelength(var wavelength: integer; var wIndex: integer; var count: integer): integer stdcall;
function OP815_NextWavelength(var wavelength: integer; var wIndex: integer; var count: integer): integer stdcall;
function OP815_OpenDriver(USBhandle: TFT_HANDLE): integer stdcall;
function OP815_OpenUSBDevice(deviceNumber: integer; var handle: TFT_HANDLE):integer stdcall;
function OP815_OperationMode(mode: integer): integer; stdcall;
function OP815_ReadABPower(var power: double): integer stdcall;
function OP815_ReadAnalog(var analog:integer; var gain: integer; var mode: integer): integer stdcall;
function OP815_ReadBAPower(var power: double): integer stdcall;
function OP815_ReadChannelBuffer(channel: integer; var power: double): integer stdcall;
function OP815_ReadLoss(var loss: double): integer stdcall;
function OP815_ReadPower(var power: double): integer stdcall;
function OP815_ReferencePower(var refPower: double): integer stdcall;
function OP815_RemoteMode(mode: integer): integer; stdcall;
function OP815_SelectModule(module: integer): integer stdcall;
function OP815_SetAbsolute(): integer stdcall;
function OP815_SetActiveChannel(channel: integer): integer stdcall;
function OP815_SetAutoRange(state: integer): integer stdcall;
function OP815_SetGain(gain: integer): integer stdcall;
function OP815_SetReference(): integer stdcall;
function OP815_SetSourcePower(source: integer; level: byte): integer; stdcall;
function OP815_SetWavelength(wavelength: integer): integer stdcall;
function OP815_SourceON(source: integer; state: byte): integer; stdcall;
function OP925_CalculateCWRL(power: double; ref: double; dark: double; var cwrl: double): integer; stdcall;
function OP925_GetDarkValue(source: byte; var dark: double; mode: byte):integer; stdcall;
function OP925_MeasureCWRL(source: byte; var cwrl: double): integer; stdcall;
function OP925_ReferenceCWRL(source: byte; var ref: double): integer; stdcall;
function OP925_ReferenceDarkCWRL(source: byte; var dark: double): integer; stdcall;

Types

TFT_HANDLE = Uint32;
TFT_HANDLE_PTR = PUint32;

Description

Functions and Procedures

function OP815_Backlight(state: integer): integer stdcall;

Turn the front panel display backlight on or off.

This requires driver initialization with OP815_OpenDriver.

Parameters
state:
0: OFF, 1: ON
Returns

1: OK, -1: fail

function OP815_GetActiveChannel(var channel: integer): integer stdcall;

Get the current active channel.

This requires driver initialization with OP815_OpenDriver.

Parameters
channel:
active channel (by ref)
Returns

1: OK, -1: fail

function OP815_GetBidirectionalReference(): integer; stdcall;

Perform bidirectional reference (internal OPM) for OP831.

This requires driver initialization with OP815_OpenDriver.

Returns

1: OK, -1: fail

function OP815_GetChannelBuffer(): integer stdcall;

Measure power from all channels simultaneously.

This requires driver initialization with OP815_OpenDriver.

Returns

1: OK, -1: fail

function OP815_GetDLLRev: integer stdcall;

Get the revision number of DLL

Returns

revision number

function OP815_GetDLLStatus: integer stdcall;

Get the initialization status of the DLL and USB device

Returns

1: OK, -5: no USB device found, -4: communication error, -3: USB Read Error, -2: USB Write Error

function OP815_GetFWRevision: integer stdcall;

Get the device's firmware revision

Returns

firmware revision number

function OP815_GetModuleID(var id: integer): integer stdcall;

Get the Module ID (internal product code) of the device.

This requires driver initialization with OP815_OpenDriver.

Module IDs

  • 10 – OP250

  • 11 – OP510

  • 12 – OP710

  • 13 – OP831

  • 14 – OP930

  • 15 – OP750

  • 16 – OP815

  • 17 – OP1100

  • 18 – OP1021

  • 19 – OP1302

  • 20 – OP815D

  • 21 – OP720

  • 22 – OP850

  • 23 – OP280

  • 24 – OP715

  • 25 – OP712

  • 26 – OP931

  • 27 – OP931-FTTX

  • 28 – OP480

Parameters
id:
Module ID (by ref)
function OP815_GetModuleNumber(var num: integer): integer; stdcall;

Get the module number of currently selected module.

Parameters
num:
module number (by ref)
Returns

1: module has been initialized, -1: module has not been initialized

function OP815_GetNumSources(): integer; stdcall;

Get the number of sources available in the unit.

This requires driver initialization with OP815_OpenDriver.

Returns

number of sources

function OP815_GetSourceTable(srcNum : byte; var waveIndex: byte; var power: byte; var maxPower: byte): integer; stdcall;

Get the details of the source number indicated.

This requires driver initialization with OP815_OpenDriver.

Parameters
srcNum:
source number
waveIndex:
wavelength index (by ref), use OP815_GetWavelength to get the corresponding wavelength value in nm
power:
current power level (by ref), 0-255
maxPower:
max power level (by ref), 0-255
Returns

1: OK, -1: fail

function OP815_GetTemperature(var tempC: double; units: integer): integer stdcall;

Get the temperature in the specified units.

This requires driver initialization with OP815_OpenDriver.

Parameters
tempC:
temperature value (by ref)
units:

  • 0 – raw digital value

  • 1 – Celsius

  • 2 – Fahrenheit

Returns

1: OK, -1: fail

function OP815_GetUSBDeviceCount(var deviceCount: integer): integer stdcall;

Get the number of connected compatible USB devices.

Parameters
devCount:
USB device count (by ref)
Returns

1: OK, -1: fail

function OP815_GetUSBDeviceDescription(deviceNumber: integer; var deviceDescription: pansichar): integer stdcall;

Get the USB Device Description (up to 16 characters) of the specified device. Caller must allocate memory for deviceDescription buffer (16 characters + 1 null-terminator)

Parameters
deviceNumber:
the USB device number
deviceDescription:
a pointer to a null-terminated character array (by ref)
Returns

1: OK, -1: fail

function OP815_GetUSBSerialNumber(deviceNumber: integer; var serialNumber: pansichar): integer stdcall;

Get the USB Device Serial Number (8 characters) of the specified device. Caller must allocate memory for serialNumber buffer (8 characters + 1 null-terminator)

Parameters
deviceNumber:
the USB device number
serialNumber:
a pointer to a null-terminated character array (by ref)
Returns

1: OK, -1: fail

function OP815_GetUSBStatus(var haveError: boolean):integer stdcall;

Get the USB error flag of last operation as well as the error code.

Parameters
haveError:
error flag (by ref)
Returns

0: OK, 1: invalid handle, 2: device not found, 3: device not opened, 4: IO error

function OP815_GetWavelength(var wavelength: integer; var wIndex: integer; var count: integer): integer stdcall;

Get the active channel's current wavelength information.

This requires driver initialization with OP815_OpenDriver.

Parameters
wavelength:
wavelength value in nanometers (by ref)
wIndex:
the index in the list of wavelengths (by ref)
count:
the number of available wavelengths (by ref)
Returns

1: OK, -1: fail

function OP815_NextWavelength(var wavelength: integer; var wIndex: integer; var count: integer): integer stdcall;

Set wavelenght to the next one the active channel's list of available measurement wavelength.

This requires driver initialization with OP815_OpenDriver.

Parameters
wavelength:
wavelength value in nanometers (by ref)
wIndex:
the index in the list of wavelengths (by ref)
count:
the number of available wavelengths (by ref)
Returns

1: OK, -1: fail

function OP815_OpenDriver(USBhandle: TFT_HANDLE): integer stdcall;

Initialize the device with the given USB Handle.

Parameters
USBHandle:
USB Handle for the device. Optionally, 0 can be used as a shortcut to open the first USB device detected.
Returns

1: OK, -5: no USB device found, -4: communication error, -3: USB Read Error, -2: USB Write Error

function OP815_OpenUSBDevice(deviceNumber: integer; var handle: TFT_HANDLE):integer stdcall;

Open the specified USB device and get a USB Handle. The device is specified by USB Device Number. The USB Handle is used with OP815_OpenDriver.

Parameters
deviceNumber:
USB device number
handle:
USB Handle (by ref)
Returns

1: OK, -1: open device failed

function OP815_OperationMode(mode: integer): integer; stdcall;

Set bidirectional operation mode for OP831.

This requires driver initialization with OP815_OpenDriver.

Parameters
mode:
0: OPM 1: A-B Direction, 2: B-A Direction
Returns

1: OK, -1: fail

function OP815_ReadABPower(var power: double): integer stdcall;

Read A-B Direction Power (internal OPM) for OP831.

This requires driver initialization with OP815_OpenDriver.

Parameters
power:
power measurement (by ref)
Returns

1: OK, -1: fail

function OP815_ReadAnalog(var analog:integer; var gain: integer; var mode: integer): integer stdcall;

Read raw ADC values for current active OPM channel.

This requires driver initialization with OP815_OpenDriver.

Parameters
analog:
raw analog-to-digital converter value (by ref)
gain:
raw gain value (by ref)
mode:
power measurement mode (by ref)
Returns

1: OK, -1: fail

function OP815_ReadBAPower(var power: double): integer stdcall;

Read B-A Direction Power (internal OPM) for OP831.

This requires driver initialization with OP815_OpenDriver.

Parameters
power:
power measurement (by ref)
Returns

1: OK, -1: fail

function OP815_ReadChannelBuffer(channel: integer; var power: double): integer stdcall;

Read the power measured by OP930_GetChannelBuffer for the specified channel. Must call OP930_GetChannelBuffer first.

This requires driver initialization with OP815_OpenDriver.

Parameters
channel:
channel to read
power:
power measurement (by ref)
Returns

1: OK, -1: fail

function OP815_ReadLoss(var loss: double): integer stdcall;

Read power loss from active channel. Must use OP930_SetReference or OP930_ReferencePower to perform a reference beforehand.

This requires driver initialization with OP815_OpenDriver.

Parameters
loss:
power loss measurement (by ref)
Returns

1: OK, -1: fail

function OP815_ReadPower(var power: double): integer stdcall;

Read power from active channel.

This requires driver initialization with OP815_OpenDriver.

Parameters
power:
power measurement (by ref)
Returns

1: OK, -1: fail

function OP815_ReferencePower(var refPower: double): integer stdcall;

Perform internal power reference for active OPM channel.

This requires driver initialization with OP815_OpenDriver.

Parameters
refPower:
reference power in dBm (by ref)
Returns

1: OK, -1: fail

function OP815_RemoteMode(mode: integer): integer; stdcall;

Set Remote Mode. This will display a static logo and locks out user interaction from the front-panel.

This requires driver initialization with OP815_OpenDriver.

Parameters
mode:
0: Remote Mode OFF, 1: Remote Mode ON
Returns

1: OK, -1: fail

function OP815_SelectModule(module: integer): integer stdcall;

Select the specified module. All subsequent USB commands will be directed to the seleted module. The module number corresponds to the device number.

Parameters
module:
module number
Returns

1: module has been initialized, 0: module has not been initialized

function OP815_SetAbsolute(): integer stdcall;

Set active channel to absolute (dBm) measurement mode.

This requires driver initialization with OP815_OpenDriver.

Returns

1: OK, -1: fail

function OP815_SetActiveChannel(channel: integer): integer stdcall;

Set the current active channel.

This requires driver initialization with OP815_OpenDriver.

Parameters
channel:
active channel
Returns

1: OK, -1: fail

function OP815_SetAutoRange(state: integer): integer stdcall;

Set the Auto-Range on or off (Range-Hold).

This requires driver initialization with OP815_OpenDriver.

Parameters
state:
0: Auto-Range OFF (Range-Hold), 1: Auto-Range ON
Returns

1: OK, -1: fail

function OP815_SetGain(gain: integer): integer stdcall;

Set the current gain (must have Auto-Range set to off).

This requires driver initialization with OP815_OpenDriver.

Parameters
gain:
gain value from 0 to 7
Returns

1: OK, -1: fail

function OP815_SetReference(): integer stdcall;

Perform internal power reference then set active channel to relative (dB) measurement mode.

This requires driver initialization with OP815_OpenDriver.

Returns

1: OK, -1: fail

function OP815_SetSourcePower(source: integer; level: byte): integer; stdcall;

Set the source power of the specified source.

This requires driver initialization with OP815_OpenDriver.

Parameters
source:
source number
level:
power level 0 = 0%, 255 = 100%
Returns

1: OK, -1: fail

function OP815_SetWavelength(wavelength: integer): integer stdcall;

Set the active channel's measurement wavelength. This will attempt to find the closest match from the internally defined list of discrete wavelengths.

This requires driver initialization with OP815_OpenDriver.

Parameters
wavelength:
wavelength value in nanometers
Returns

1: OK, -1: fail

function OP815_SourceON(source: integer; state: byte): integer; stdcall;

Directly toggle a source ON or OFF.

This requires driver initialization with OP815_OpenDriver.

Parameters
source:
source number
state:
0: OFF, 1: ON
Returns

1: OK, -1: fail

function OP925_CalculateCWRL(power: double; ref: double; dark: double; var cwrl: double): integer; stdcall;

This is a utility function to calculate CWRL using caller-provided reference value, dark value, and raw power measurement.

This requires driver initialization with OP815_OpenDriver.

Parameters
power:
raw power measurement in dB
ref:
CWRL reference value in dB
dark:
dark reflection value in dB
cwrl:
calculated CWRL value in dB
Returns

1: OK, <0: fail

function OP925_GetDarkValue(source: byte; var dark: double; mode: byte):integer; stdcall;

Get the stored dark value from the device.

This requires driver initialization with OP815_OpenDriver.

Parameters
source:
0: Wave A, 1: Wave B
dark:
dark reflection value in dB (by ref)
Returns

1: OK, <0: fail

function OP925_MeasureCWRL(source: byte; var cwrl: double): integer; stdcall;

Measure CWRL for the specified source wavelength.

This requires driver initialization with OP815_OpenDriver.

Parameters
source:
0: Wave A, 1: Wave B
cwrl:
CWRL measurement value in dB (by ref)
Returns

1: OK, -1: fail, -1

function OP925_ReferenceCWRL(source: byte; var ref: double): integer; stdcall;

Reference the specified CWRL source wavelength. This sets the current measured reflection to be the -14.7 dB reference. Note that unlike the OP930/OP940 RL Reference for pulsed RL measurement, CWRL does not require a reference measurement position.

This requires driver initialization with OP815_OpenDriver.

Parameters
source:
0: Wave A, 1: Wave B
ref:
reference reflection value in dB (by ref)
Returns

1: OK, -1: fail, -2: reference power is below -25 dB

function OP925_ReferenceDarkCWRL(source: byte; var dark: double): integer; stdcall;

Reference dark value of the specified CWRL source wavelength. This sets the current measured reflection to be the lowest expected CWRL value.

This requires driver initialization with OP815_OpenDriver.

Parameters
source:
0: Wave A, 1: Wave B
dark:
dark reflection value in dB (by ref)
Returns

1: OK, <0: fail

Types

TFT_HANDLE = Uint32;

USB Handle Type. (Use Uint64 (64-bit unsigned int) for 64-bit version)

TFT_HANDLE_PTR = PUint32;

USB Handle Pointer Type. (Use PUint64 (64-bit unsigned integer pointer) for 64-bit version)


Generated by PasDoc 0.15.0.