I. COM port errors from scanimage – AKH, August 2022
Problem description: scanimage throws an error at start-up that one of the COM ports for the mirrors is not available, despite the fact that the COM port in question shows up in the windows device manager.
Troubleshooting notes: SH and I first changed the COM port numbers in the machine data file from 5–>81 and 5–>80. That didn’t hold upon restarting, but we then set them to 020 (Port_#0006.Hub_#0001) and 021 (Port_#0014.Hub_#0001) and that ultimately worked. We made this change in both the windows device manager and the machine data file (see the code snippet below). We also had to reverse the direction of one of the mirrors (MAIN CONTROLS > File > Machine Configuration > ThorLabs BScope1 Set up). After making this change, we restarted the computer several times and it eventually “stuck.”
galvoGalvoMirrorComPort = 21; % Numeric: Serial COM port for controlling Galvo-Galvo mirror. Leave empty is mirrors are connected to stage controller (MCM5000)galvoResonantMirrorComPort = 20; % Numeric: Serial COM port for controlling Galvo-Resonant mirror. Leave empty if mirrors are connected to stage controller (MCM5000)flipperMirrorComPort = []; % Numeric: Serial COM port for controlling Flipper mirror. Leave empty is mirrors are connected to stage controller (MCM5000)Potential source of the problem: MM thinks that we may have been working against a combination of two separate COM port related issues this morning, which have come up separately in his experience with Berg 2. The first is that plugging in new USB devices can sometimes result in a reassignment of COM port numbers. If this happens, it should be evident in Device Manager. MM’s solution to this problem was to just reassign the port numbers in the windows device manager and then to change the hardcoded values in the machine data file to match it – just SH and I ended up doing today. The second potential problem is that the flipper mirrors can sometimes get assigned the same port number if the computer powers off unexpectedly. This doesn’t always cause a problem in scanimage as long as the numbers in the machine data file match what it says in the device manager. Indeed, before Stephen and I started debugging today, both flipper mirrors were assigned to COM5 in the machine data file and scanimage had been working just fine for many months. If this happens again and it does cause scanimage to throw COM port related error messages, MM suggests just restarting the computer first. If that doesn’t work, then:
Unplug both devices
Restart the computer
Plug in one device and give it a new number in device manager
Plug in the second device and give it a different number in device manager
Update the machine data file with these new numbers
Restart the computer and try running scanimage again, and if this doesn’t work, repeat these steps and try again