Connecting to ThorLabs PAX1000 Polarimeter using Test & Measurement Tool

57 views (last 30 days)
Greetings,
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
  2 Comments
Ryan
Ryan on 21 Jun 2018
This is what I see using instrhwinfo:
instrhwinfo('visa')
HardwareInfo with properties:
InstalledAdaptors: {'ni'}
JarFileVersion: 'Version 3.7'
instrhwinfo('vxipnp')
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
clc
% Check VISA object (Uncomment and run the first time to get your device ID)
%out4 = instrhwinfo('visa','agilent')
%out4.ObjectConstructorName
% Create VISA Object given the device ID
tlpax=visa('agilent', 'USB0::0x1313::0x8031::M00547469::0::INSTR');
% Connect PAX 1000
fopen(tlpax)
% 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
fprintf(tlpax,'SENS:DATA:LAT?');
messagetxt = fscanf(tlpax);
message=str2num(messagetxt);
% Convert data to conventional units
mode=message(3)
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
Psi=message(10);
Chi=message(11);
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
fclose(tlpax);
delete(tlpax);
clear tlpax
  8 Comments
Sam
Sam on 19 Nov 2020
Edited: Sam on 19 Nov 2020
Just to give a potential solution:
I remvoved this line :fprintf(tlpax,'SENS:CALC 9;:INP:ROT:STAT 1');
from the loop and that seemd to solve the problem I was having. Although, I have to add in pause(.04) between fprintf(tlpax,'SENS:DATA:LAT?'); and storing it in a matrix, which leads to my secondary problem occasionaly.
Ryan
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.

Categories

Find more on Instrument Control Toolbox Supported Hardware in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!