No BSD License  

Highlights from
Lambda-Physik FL3002 GPIB Instrument Drivers

Lambda-Physik FL3002 GPIB Instrument Drivers

by

 

15 May 2008 (Updated )

Provides a basic command set to control the FL3001/2 dye laser over GPIB.

DyeLaserRead(BdHandle, DyeHandle, BytesToRead)
% Written by Tom Spinka on Sept. 26, 2007 for the control of read
% operations from a Lambda Physik FL3001/3002 dye laser.
function [Err, Resp] = DyeLaserRead(BdHandle, DyeHandle, BytesToRead)

[Err, BdAddr] = ibask(BdHandle, 01); % Get the GPIB Address of the Board
[Err, DyeAddr] = ibask(DyeHandle, 01); % Get the GPIB Address of the Dye Laser

Err = ibcmd(BdHandle, char(32 + BdAddr), 1); % Set the Board to be the Listener
Err = ibcmd(BdHandle, char(64 + DyeAddr), 1); % Set the Dye Laser to be the Talker

[Err, DataRead] = ibrd(DyeHandle, BytesToRead); % Do the GPIB read.

Err = ibcmd(BdHandle, char(95), 1); % Send UNT (Untalk)
Err = ibcmd(BdHandle, char(63), 1); % Send UNL (Unlisten)

Err = ibclr(DyeHandle); % Do a device clear on the dye laser

% The following code extracts the ascii characters received in the read.
% The .dll interface automatically typecasts to type double from the ascii
% input, which must be reversed correctly.
DataCut1 = DataRead(1:ceil(BytesToRead/4));
for n = 1:size(DataCut1,1)
    Intermed = sprintf('%bx',DataCut1(n));
    DataCut2(n*4 - 3) = char(hex2dec(Intermed(15:16)));
    DataCut2(n*4 - 2) = char(hex2dec(Intermed(13:14)));
    DataCut2(n*4 - 1) = char(hex2dec(Intermed(11:12)));
    DataCut2(n*4) = char(hex2dec(Intermed(9:10)));
end

Resp = DataCut2(1:BytesToRead);

Contact us