MATLAB Answers

Connecting to ThorLabs PAX1000 Polarimeter using Test & Measurement Tool

17 views (last 30 days)
Ryan on 20 Jun 2018
Commented: Ryan on 20 Nov 2020
I have a ThorLabs PAX1000 polarimeter connected via USB to a 64 bit Windows 7 machine running Matlab R2015a 64bit. I am attempting to use Matlab to automate some measurements. The vendor software is working fine which implies that the drivers are installed correctly. However, I don't see any drivers for the device listed in the Test & Measurement Tool.
I have attached the section of the device manual which discusses the driver files, and a screen shot from the Test & Measurement Tool where you can see that the device is detected under USB, but no PAX drivers are listed.
Is it possible to use the VXI drivers with Matlab for this device, if so, how do I proceed?
Thanks, Ryan
Ryan on 21 Jun 2018
This is what I see using instrhwinfo:
HardwareInfo with properties:
InstalledAdaptors: {'ni'}
JarFileVersion: 'Version 3.7'
HardwareInfo with properties:
InstalledDrivers: {'niFgen' 'niRFSA' 'niScope'}
VXIPnPRootPath: 'C:\Program Files\IVI Foundation\VISA\Win64'

Sign in to comment.

Answers (1)

Kien Phan Huy Kien Phan Huy
Here is my code
clear all
close all
% Check VISA object (Uncomment and run the first time to get your device ID)
%out4 = instrhwinfo('visa','agilent')
% Create VISA Object given the device ID
tlpax=visa('agilent', 'USB0::0x1313::0x8031::M00547469::0::INSTR');
% Connect PAX 1000
% Identify Thorlabs PAX 1000
fprintf(tlpax, '*IDN?');
data = fscanf(tlpax) % Expected return is 'THORLABS,PAX1000IR2/M,M00547469,1.0.3'
% Measurement in mode 9
fprintf(tlpax,'SENS:CALC 9;:INP:ROT:STAT 1');
% get measurement
messagetxt = fscanf(tlpax);
% Convert data to conventional units
az=message(10)*180/pi % in °
ellip=message(11)*180/pi % in °
DOP=message(12)*100 % in %
P=message(13)*1e3 % in mW
% Compute normalized Stokes parameters
S1=cos(2*Psi)*cos(2*Chi) % normalized S1
S2=sin(2*Psi)*cos(2*Chi) % normalized S2
S3=sin(2*Chi) % normalized S3
% Disconnect PAX 1000
clear tlpax
Ryan on 20 Nov 2020
I had a similar issue with the data not updating. I found that it was an intermittent problem and potentially hardware / driver related. Sometimes the data would read fine and then it would suddenly stop updating. The solution was usually some combination of unplugging and replugging the polarimeter, and adjusting the polarimeter settings using the ThorLabs provided software gui. Disabling and enabling the auto power ranging feature also sometimes fixed the problem. Using the pause() function defintely improved reliability.
Unfortunately my best solution was to write a script that would repeatedly connect/disconnect and attempt to read data until it started working.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!