1

I'm currently working with some semi automated scripts in VBA.

I need to wait 1 second before going into the next loop. the method 'Application.wait' is not accessible due to these macros is for the AP2700 series.

the loop goes like this:

For i = 0 To 20
    AP.S2CDsp.Analyzer.FuncFilter = 0
    noiseListNone(i) = AP.S2CDsp.Analyzer.FuncChARdg("V")
    AP.S2CDsp.Analyzer.FuncFilter = 1
    noiseListA(i) = AP.S2CDsp.Analyzer.FuncChARdg("V")
    AP.S2CDsp.Analyzer.FuncFilter = 2
    noiseListCCIR(i) = AP.S2CDsp.Analyzer.FuncChARdg("V")
    Wait 1

Next

I want to save the readings into a array to handle later on.

I'm kind a new to VBA / VB. therefore I'm wondering.. the 'Wait 1' will it wait one second or are there other alternatives?

Best regards.

Luuklag
  • 3,897
  • 11
  • 38
  • 57
Morten
  • 51
  • 8
  • So the "AP2700" has its own VBA macro environment? If not where/how do you run the VBA? – Alex K. Feb 05 '15 at 14:16
  • Why yes indeed it does, just like exel, word etc. to give an example http://i.imgur.com/rGk8kpP.png – Morten Feb 05 '15 at 14:33
  • 1
    Out of curiosity why can't you just try it and see if it works? As far as I know `Application.Wait` is indeed specific to Excel and there's no native `Wait` function in VBA. If this AP2700 you refer to has its own VBA environment with a `Wait` method then you're in luck, otherwise you'll have to write one yourself. – Aiken Feb 05 '15 at 14:53
  • Allready tried the application.wait, with no luck at all... And the 'wait 1' is tried as well, even with wait 5, and i cant seem to find any difference in time at all... just though vba had a delay/wait/sleep function (: – Morten Feb 05 '15 at 14:57

1 Answers1

2

After some various testing with system load and idle while running the macro. I've come to this.

Thw 'Wait' function waits the entered time, even if windows was under full / close to full load (95% CPU usage, 3.4 RAM used out of 4 GB)

and the entered time is seconds of course.

Sorry for asking before testing was just thinking one of you guys had a good and qualified answer.

Best regards.

Morten
  • 51
  • 8