So you want to compile and/or modify ScanImage code for your lab? The following step-by-step directions will allow you to accomplish this.
Setting Up Your Development Environment
The following steps will allow you to recreate a standalone Development environment for ScanImage 5.0.
- Download and Install Microsoft Visual Studio 2008
- Download and Install MATLAB (64-bit ScanImage 5.0 only runs on 64-bit MATLAB). Tested versions of MATLAB are 2013b-2014a.
- Download and Install the latest version of National Instruments NI-DAQmx. Use the express install option and install the default components. (http://www.ni.com/download/ni-daqmx-9.8/4297/en/). DAQmx handles all digital I/O and analog I/O for driving the resonant scanner, galvo(s), and other components such as the Piezo, Motion Stages, and Pockels Cells.
- Download and Install the latest version of National Instruments NI FlexRIO software. (http://www.ni.com/download/ni-flexrio-13.1/4485/en/). The FlexRIO is used for the FPGA and A/D converter used for the frame grabber portion of ScanImage.
- Optional - Download and Install Atlassian Sourcetree (or other Git client) to access the Vidrio Technologies ScanImage repository located at https://bitbucket.org/vidriotech/scanimage-5
- Create the following directory: C:\PROGRAM FILES\SCANIMAGE\DEVTOOLS\
- Connect to the Vidrio Technologies Dropbox (http://www.dropbox.com/) and download the contents of \SHARED\DEVTOOLS into the C:\PROGRAM FILES\SCANIMAGE\DEVTOOLS directory.
In Windows Explorer, right click on the 'Libraries' folder (usually located on the left side of the Explorer Window) and select New >> Library
- Right click on "New Library" and under the "Library" tab, click the "Add..." button.
- Select the C:\PROGRAM FILES\SCANIMAGE\DEVTOOLS directory.
- Download the latest version of ScanImage 5.0 and install into C:\SCANIMAGE-5\
- Open Microsoft Visual Studio 2008.
- Go to File >> Open >> Project/Solution
- Select C:\SCANIMAGE-5\+scanimage\+adapters\@ResonantAcq\ResonantAcq MEX Build\ResonantAcqMex.sln
Make sure the current Configuration is set to Release and x64.
- Select Build >> Rebuild Solution. This will compile and install both NiFPGAWrapper.dll and NiFPGAMex.dll.
If you do not yet have a FlexRIO Chassis, then you must create a simulated FlexRIO Chassis device. Start up NI MAX. Under "My System", right click on "Devices and Interfaces", then select "Create New...".
- In the "Create New..." dialog window, select "Simulated NI-DAQmx Device or Modular Instrument", then flick the "Finish" button.
- In the "Create Simulated NI-DAQmx Device" dialog window, type "6356" and select PXIe-6356.
- Set "PXI Slot" to 3
- Click the "OK" button.
You should now be able to start MATLAB and run Scanimage 5.0 without issues. You should also be able to modify C++ code in Visual Studio, recompile it, and run the updated dll's in MATLAB without issues.
Using Sourcetree with Windows 7 Library directories or Dropbox is not recommended. The Windows 7 Library directories will give you permission errors, and using Dropbox will prevent switching between local branches from executing properly.