From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

high cpu usage in DIAdem after completing a script

I have a script that I know isn't very efficient but it works.  The problem I have is that once it finishes, DIAdem jumps up 100% CPU utilization and remains there until I close it.  I'm using 9.1.  I can work with the problem, but it's annoying that in order to test my code, I have to close and then reopen DIAdem each time to make DIAdem feel responsive again.
 
I'm using a Pentium M 1.5 Ghz with 256MB of ram if that helps.
0 Kudos
Message 1 of 5
(3,221 Views)
Well before I get questions on what kind of script, it's a modified version of NI's ASCII importer, I just have it parsing the data I need into chunks.  There are many loops and conditions to find certain points I need but it finishes.  The other thing is, it doesn't happen every time.  Only on certain runs does it stay at 100% afterwards (even with the same code).  Other times the script will finish and CPU usage would drop down to nothing and without touching DIAdem at all, minutes later CPU usage would be back at 100%.  It may be my code, but I highly doubt it.  A script can't run again after it's "finished" can it?
0 Kudos
Message 2 of 5
(3,214 Views)
Hi slashdotc...
 
To my knowledge once the green "script running" icon in the lower right hand corner of DIAdem goes away, that VBScript has stopped executing and will not secretly start up again.  What immediately comes to mind is memory deallocation, which happens automatically after the VBScript ends.  The fact that you only have 256 MB of RAM encourages this suspicion.
 
The ideal approach for loading a data file with a VBScript would be to create a VBScript DataPlugin, which is an option in DIAdem 9.1 and later versions.  When you say that you are doing something similar to the ASCII Import Wizard, do you mean that you are simply importing an ASCII file with no user interaction, or do you mean that you are popping up a SUDialog to allow the user to make a bunch of parameter choices, then importing the ASCII file using those parameters?
 
Would you please send me an example of this ASCII file, or a set of files which show the full spectrum of file format deviations?  I can quickly tell you whether it makes sense to shift over to a DataPlugin, and how much improvement you can expect, based on the file type.
 
Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 3 of 5
(3,195 Views)
The VBScript was made from an example VBScript file that I was given.  The only user interaction is for the user to select the file or files for import.  Everything else I tried to automate.  May I assume to send the files to: Brad.Turpin@ni.com?
 
0 Kudos
Message 4 of 5
(3,192 Views)

Yup,

That'll work fine.

Brad

0 Kudos
Message 5 of 5
(3,171 Views)