07-17-2009 09:35 AM
I have a script that usually takes 1-2 minutes to run on my PC. I tried running it on a co-worker's PC, and the same script (with the same data) took MUCH longer. I noticed that on this new PC, the Data Portal is updating while the script is running. For example, I can see new channels being created, and in the channel-properties list, I can see them updating too. So, as each row is being filled with data, I see the channel's length, mininmum, maximum, etc. constantly updating. I have a feeling this is why it's so much slower.
On my PC, the screen doesn't update until the script is done. I know that in VBA (Excel), there is a ScreenUpdating command that can be set to False to freeze the screen until the macro is done. Is there a similar feature in DIAdem?
Also, the help has suggested that I uncheck "Refresh Data portal while a script is running" in Settings>>Options>>SCRIPT. But when I go to this menu, the box is already unchecked.
Lastly, I don't know if this is relevant, my PC has the basic version of 11.0 (I write my scirpts in Notepad), whereas my coworker has Professional (so I can view my code in SCRIPT, and debug it).
How can I get rid of this data portal updating?
07-17-2009 09:55 AM
I'm starting to think that this is one of those weird problems that only I have. :mansad:
Sometimes, if I check the "Refresh Data Portal while a script is running" box in Settings»Options»SCRIPT, click OK, then go back and uncheck it, the script will execute without updating the data portal.
Sometimes... Other time, no matter how much I check and uncheck that box, it will refresh the data portal.
07-17-2009 02:23 PM
Hello Gianni!
You can try to set the variable UIAutoRefresh to 0 at the beginning of the script. That is the variable behind the options checkbox. The help recommend to use the command UIAutoRefreshSet. I don't know if there is a difference (IMHO: should not). See the help to get an example.
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
04-12-2012 09:56 AM
Thank you for the tip. I was looking for this kind of solution.
For information UIAutoRefreshSet() is the best function (I did not see any difference using UIAutoRefresh)
Call UIAutoRefreshSet(False) 'Deactivate UI refreshing Call UIAutoRefreshSet(True) 'Activate UI refreshing