© 2011 Thorlabs
128 Thorlabs Beam 4.0
GetConnectedDeviceCount();
A device is initialized with a device identifier. The ID is “0”, if only one device is
connected, and 0 or 1, if two devices are present:
InitDevice(unsigned long deviceID);
Prior to terminate the application. the library instance must be released:
ReleaseThorlabsBeamInstance();
Retrieve measurement results:
GetMeasurement()
Measurement results are created in the library, user access only by reference.
GetMeasurementCopy()
First, a result variable must be created; then the function copies the results from
library to the result variable. This function is required when a programming language
handels the memory managemenent independently and cannot access results by
refererence (e.g. LabVIEW
®
).
3. LabVIEW
®
application
For LabVIEW
®
programming VIs (converted from Thorlabs Beam Library functions)
are supplied. These VIs allow to use all Thorlabs Beam Library functions.
4.2
Sample Programs
C++ program sample with MFC
Sample program „ThorlabsBeamSamplec++MFC“ is a standard MFC application
with inserted Thorlabs Beam library functions. Modifications are bordered as below:
//*************** Thorlabs Beam ****************
[…]
//**********************************************
First, the Thorabs Beam library is included and an instance created:
#include "ThorlabsBeamLibrary.h"
CreateThorlabsBeamInstance();
If at least one device is connected, it is being initialized with standard settings.
int deviceCount = GetConnectedDeviceCount();
if (deviceCount > 0)
{
InitDevice(0);
}