MATLAB: Issues connecting to VISA device

Instrument Control ToolboxMATLABtmtoolvisa

Hello,
I'm having issues connecting to an instrument (a Thor Labs PM100A optical power meter) over a VISA connection via USB. The confusing thing is that I have some basic code that works perfectly happily on a couple of machines, but not on other machines. The simple code to open the connection to the instrument is:
PM100A = visa('ni','USB0::0x1313::0x8079::P1002477::INSTR');
fopen(PM100A);
As I said, on a couple of machines it works perfectly. On the other machines I get the error:
"Error using icinterface/fopen (line 83)
Unsuccessful open: Could not open VISA object. Use INSTRHWINFO for a list of available configurations."
All machines are running Matlab 2019a or 2019b, and all have the Instrument Control Toolbox, all run on Windows 10. In all cases Windows seems to have installed the power meter drivers successfully, and on all machines I can communicate to the instrument using the separate software supplied by Thor Labs.
One thing I have noticed is that in the Test & Measurement Tool (tmtool), on the machines that do work the instrument is recognised in the Instrument Control Toolboox/Hardware/VISA/USB tree. On the machines that don't work, the instrument is not recognised even if I manually scan for USB devices. I assume this means that although the instrument seems set up in Windows, some instances of Matlab can't "see" the instrument is there.
Also, on the machines where I can't communicate to the Thor Labs meter, I am able to establish a VISA connection with a totally different instrument (a power supply from a totally different manufacturer).
I have no idea where to go from here, so if anyone has any suggestions that would be very much appreciated. Thanks in advance!

Best Answer

Well, eventually I managed to fix the issue.
I noticed that other software like Python and NI-MAX didn't recognise the instrument either, indicating an underlying problem that wasn't only affecting Matlab.
The issue seems to have been that Windows had assigned the "wrong" driver to the instrument. For whatever reason, this meant that the Thor Labs software could communicate with the instrument, but nothing else. I found some instructions on how to fix this issue from the National Instruments website...following the "try reassociating the USB device" section, steps 1-3 & 5, fixed my specific problem.
I hope that helps someone in future!