Use 64-bit Python 3.7 to control the WaveShaper through the USB port

64-bit Python 3.7 can be used to control the WaveShaper family.

The WaveShaper A-series units offer an Ethernet and a USB port for controlling the instrument through the Application Programming Interface (API). Recommendation is to use the Ethernet port in combination with the RESTful http based interface.

The WaveShaper S-series – our legacy products – only offer a USB port (Ethernet not available) for remote control. In this case the API uses a DLL to control the instrument via USB. The WaveShaper A-series is fully backward compatible, therefore – if required – it also can be controlled using the DLL via USB.

In order to control the WaveShaper through USB using 64-bit Python 3.7 please follow these instructions:

  • Load up the Command Prompt as administrator and change to the Python directory using the following command:

cd C:\Program Files (x86)\Finisar\WaveManager\waveshaper\api\python3

  • Run the setup.py script via this command:

python setup.py install

  • You must copy over the correct DLL files into the appropriate Windows folder. 64-bit Python requires the 64 bit DLLs to be copied into the System32
    1. Copy this file: C:\Program Files (x86)\Finisar\WaveManager\waveshaper\bin\amd64\wsapi.dll into this folder C:\Windows\System32
    2. Copy this file: C:\Program Files (x86)\Finisar\WaveManager\waveshaper\bin\amd64\ftd2xx64.dll into this folder C:\Windows\System32
    3. Rename the copied file above from ftd2xx64.dll to ftd2xx.dll.
    4. Copy this file: C:\Program Files (x86)\Finisar\WaveManager\waveshaper\bin\amd64\ws_cheetah64.dll into this folder C:\Windows\System32
    5. Rename the copied file above from ws_cheetah64.dll to ws_cheetah.dll.
  • We can now test to see if the installation was successful. Load up Python 3.7. Import the wsapi library using the following command:

from wsapi import *

  • Return the API version number

ws_get_version()

  • This command should return a version number e.g. ‘2.7.3’. If it returns -1, then the DLL was not loaded correctly. You may wish to double-check step 3, restart Python and try again. If you still have trouble, please contact waveshaper@finisar.com.