Tuesday, June 23, 2009

Pulse Control within NIS Elements 6-D Acquision

These directions will allow user control over an optical configuration to be specified at a given time-loop inside of the define/run experiment. So for instance if one wanted to trigger a shutter or light source to flash un-cage at the beginning of a high-speed acquisition, this would meet the need. These are a bit lengthy but remember the setup is only needed once!

  1. Create an optical configuration that activates your pulse. You only need the configuration to be active, but note the shutter should be set to “active shutter” and CLOSED when the optical config is selected. The shutter should be set to open only when the user presses the shutter button or when the camera is acquiring.
  2. Download my macro file that contains the control code needed for this to work. (If you have Quicktime installed windows will think this is a movie - make sure to Right-Click on the link and select "Save Target As". )
  3. Save the above macro into something like c:\Macros\ or wherever you can easily access it.
  4. In Elements select the Macro Menu, then "Open Macro" and open the macro file.
  5. Note in the macro file the lines that read "Stg_SetShutterState(3,1); this means "set the state of a selected shutter type(shutter type,Open)" . So set the first number to the shutter you want to control. (0=EPI, 1=DIA, 2=Aux1, 3=Aux2). The second number is easier - 1=open and 0=closed. ALL YOU NEED TO DO is make sure you are controlling the correct shutter, by changing the first number in the 2 lines of code in the macro to drive the correct shutter!
  6. Note in the macro the "Wait(1.00); command. Where the 1.00 sits is the amount of time the shutter should remain open. For a pulse time of 500 milliseconds the code should read "Wait(0.500);
  7. Test the macro at this point by running it. The desired shutter should open, wait and close. if modifications need to be made to the optical config or the code now is the time to do it!
  8. Next set up a text experiment that has 2 different time phases at minimum. Click the "Advanced" button to show the advanced time controls.
  9. Set the "Advanced for" box to read "Time Phase 2"
  10. Select the check box that reads "Execute Command at the Beginning..."
  11. Click the Arrow on the right side of the entry box and select "run macro"
  12. Go find the macro file you downloaded and modified earlier and select that macro.
  13. Your configuration should now look something like this one:
  14. Set the acquisition rate you want in time phase 2.
  15. Back up the experiment using the Save button.
  16. When you run the macro, and you reach time phase 2 the pulse will occur at the same time as the second time phase, without interuppting the experiment flow.

- Austin

No comments: