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: 

DIAdem script not finished due to an error but no error message displayed

Solved!
Go to solution

Hello everyone,

 

I've recently noticed that even though my script doesn't run all the way to the end due to an error, I can see the "The script is finished." message in the lower left corner but no error message. It is very difficult to debug my script and to find what is wrong this way.

First picture (Correct_run.png) shows the screenshot of Logfile with the correct script run. Even though we can see some errors, the script was run correctly and it produced a report.

The second picture (Run_w_error.png) shows the screenshot of Logfile, when I introduced an error into the script. There wasn't any pop-up window with an error message either.

 

Can anybody please help me with this issue?

 

Correct_run.pngRun_w_error.png

 

My DIAdem and system info:

 

-------------------------------------------------
DIAdem - Version Information:
-------------------------------------------------
DIAdem 2020
Version: 20.0.0f7762
USI: 20.0.0f7736
DataFinder: 20.0.0f7748

 

-------------------------------------------------
Visual Basic Script - Information:
-------------------------------------------------
Script Engine Version: 5.8.7601.16982
Script Engine DLL: c:\program files\national instruments\diadem 2020\vbscript.dll
Debugger Version: 16.0.81.0
Debugger DLL: c:\windows\system32\f12\pdm.dll

 

-------------------------------------------------
System - Information:
-------------------------------------------------
Windows caption: Microsoft Windows 10 Enterprise
Windows: Windows (NT) 10.0.19042 (64 bit)
No. of CPUs: 12 x 2592.0 MHz (TSC)
Memory: 32092 MB (virtual 64 kB -> 131072 GB)
DIAdem: 20.0.0.7762 20060928 20060928
Language: English
Edition: Professional Edition + DAC + Crash Analysis Toolkit  

Download All
0 Kudos
Message 1 of 3
(1,114 Views)
Solution
Accepted by topic author MarekNebyla

Put these statements in the beginning of your code (or prior to where the problem exists):

 

CmdNoInfoDisp = False 'TRUE supresses the display of information messages. Affects ANALYSIS workspace.
CmdNoWarningDisp = False 'TRUE will allow DataFileSave() command to overwrite a file without prompting the user to verify. Also DataFileDelete()
CmdNoMsgDisp = False 'TRUE will supress the display of dialog with DataFileSave(). Also supresses MsgBoxDisp()
CmdNoDialogDisp = False
CmdNoErrorDisp = False
Call MsgBoxStateResetAll()

 

Search your code and any ScriptInclude() code for a "On Error Resume Next" if found, make sure a matching "On Error Goto 0" exists.  Also try putting a "On Error Got 0" right before were you think the error is supposed to occur. 

 

The script below will allow you to experiment with error supression.

 

Spoiler
Call LogFileDel()
Dim i
'Do something..
For i = 1 To Navigator.Settings.RegisteredDataPlugins.Count
Call MsgLineDisp("DataPlugin '" & Navigator.Settings.RegisteredDataPlugins.Item(i).Name & "'")
Next
Call MsgLineDisp(vbTab)
On Error Resume Next
'Throw an error
Call Err.Raise(65535,,"ERROR")
'On Error Goto 0
For i = 1 to 1E6: Next
'Do something..
For i = 1 To Navigator.Settings.RegisteredDataPlugins.Count
Call MsgLineDisp("DataPlugin '" & Navigator.Settings.RegisteredDataPlugins.Item(i).Name & "'")
Next
Call MsgLineDisp(vbTab)
If Not Err.number = 0 Then Call LogFileWrite("ERROR occurred earlier")
'Throw an error
Call Err.Raise(65535,,"ERROR")
If Not Err.number = 0 Then Call LogFileWrite("ERROR occurred")
Message 2 of 3
(1,019 Views)

Hello markwkiehl,

 

thank you for your help.

 

Marek 

 

0 Kudos
Message 3 of 3
(696 Views)