Home Image-Pro Plus Automation with Macros

Automation using Stage Pro

We are using an ASI stage that is properly interfaced with IPP. We are aware of Stage Pro, and my graduate students can successfully use it to define a path with multiple image acquisition points. We can acquire images along this path. We have two problems:
1) we want to automatically cycle through the path many times.
2) we want to pause between each cycle.

Is there a simple way to accomplish this without macros? If no, we need advice how to achieve this another way.
Thank you,
Jesse Greener
Professor, U. Laval
Dept. Chemistry


  • Options
    Jesse, this is actually a question about Image-Pro Plus so I move it into the appropriate forum.

  • Options
    Thanks, looking forward to help from the community.
  • Options
    Stage-Pro doesn't have built-in functionality for pauses or multiple iterations. The extended AFA module supports this if you have it. If not, a macro is really the best way to get the functionality. 

    Record moving from one point to another. Set up a "For" loop that iterates from 0 to (count-1), move to that location, use IpMacroWait( n ) to pause in 10ths of a second, and an outer Do or For loop to repeat the pass many times. 

    Something like:

    numListPts = IpStageGetListLength(0)

    for i = 1 to numLoops

        for j = 0 to numListPts-1
            ret = IpStageGotoListPos(0, j)
            ret = IpMacroWait(100)    ' Pause for 10 seconds
        next j

    next i
  • Options
    I've attached a (relatively) simple macro UserDialog that does this. Upon pressing the "Go" button it reads the iterations and the delay time, resets counters, and sets a flag to act during Windows Idle events.

    In the Idle event if the action flag is 'True' it moves to various stage positions, waits, increments counters and returns. If the action flag is 'False' nothing is done; the dialog is idling. 

    This is a good illustration of how to have a dialog run an operation continuously and in the background, with feedback and and interruptible controls - or even the option to modify parameters while the operation is proceeding. 
  • Options
    Thanks very nice we'll try to use this. Is there a link to documentation on macros? From the 30 mins we spent on it today we found that we could invoke a macro during the Stage pro operation, but the behaviour was very strange.

Sign In or Register to comment.