Jump to content
Sign in to follow this  
Appie78

Function slow with COM activity in it?

Recommended Posts

Appie78

Hi all,

My script gets quite slow when I do it like below:

For $i = 1 To 25
        $Mag = $MPSMag.GetMag()
        If $Mag <> 1000 Then
            $MPSMag.SetMag(0, 1000)
        EndIf
        $Tilt = $MPSStage.GetStagePos(2)
        If $Tilt > 20 Then
            $HighTilt = InputBox("Tilt angle to high", "Set tilt angle", "0", " M2")
            If IsNumber($HighTilt) Then
                $MPSStage.SetStagePosT(0, $HighTilt, 0)
            EndIf
        EndIf
        $HT = $MPSGun.GetAccv()
        If $HT < 20000 Then
            $LowHT = InputBox("ACCV to low", "Current Accelerating Voltage is " & $HT & @CRLF & "Set Accelerating Voltage", "20000", " M5")
            If $LowHT > 19999 Then
                $MPSGun.SetAccv($LowHT)
            EndIf
        EndIf
        Opt("mouseclickdowndelay", 1200)
        MouseClick("left", 325, 611, 1, 1)
        $Time = GUICtrlRead($Time1) * 1000
        $Timer = TimerInit()
        While TimerDiff($Timer) < $Time
            Sleep(20)
        WEnd
        $StepCount += 1
        GUICtrlSetData($lblData, $StepCount)
    Next

When I take the COM part out of the For...Next loop the speed is normal. :)

Is there any way to make it quicker with the COM part in?

Thanks,

Appie


Electron microscopes rule!!!

Share this post


Link to post
Share on other sites
Lars

Hi I noticed the problem too,

And after some research I found out that when using COM objects in VBS or other scripting/programming languages

also slowes down. Not on all of the COM stuff, but the stuff that slowes down autoIt also slowes down other languages.

So I guess its just Windows on it's best

Share this post


Link to post
Share on other sites
Appie78

Hi I noticed the problem too,

And after some research I found out that when using COM objects in VBS or other scripting/programming languages

also slowes down. Not on all of the COM stuff, but the stuff that slowes down autoIt also slowes down other languages.

So I guess its just Windows on it's best

Thanks Lars,

But this was not the answer I was hoping for :)

I will test it in VBS aswell just to be sure.

If anyone got some more info please let me know.

Greetz,

Appie


Electron microscopes rule!!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×