DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to block dialog box or acknowledge.

We have an LabVIEW application that runs scripts in DIAdem.  From time to time, an unexpected error occurs that results in DIAdem (10.2) popping up a dialog box.  This wouldn't normally be a problem if a human was running DIAdem but we have an automated solution; there is no one there to notice and click the OK button.
 
In the past, some of these popups can be handled by the "AutoIgnoreError = 1" flag but not all.  Notably this item is no longer availble.
For example, a recent error occurred when loading a TDMS file.  DIAdem advised me that there was some kind of error loading the file.  This hung up processing for a while.
 
I would like to have a way to detect whether there is a popup; then programmatically click 'OK'
 
Any ideas?
 
Maybe there is another way to block the popups no matter what.
 
Do I have to wrap every line of code with "On Error Resume Next"?
 
Jim West
Summitek Instruments
0 Kudos
Message 1 of 4
(3,238 Views)
Hi Jim,
On Error Resume Next is the correct expression to use. Its a VBS flag that turns off the automatic error handling. The title is somewhat misunderstanding, because it does not affect only the next line of the code. In fact, the error handling will continue to be turned off until the expression On error goto 0. To manually (programatically) check for errors, you can use the VBS err-object.

Here is a quick example:
on error resume next
  err.clear
  datafileload "doesnotexist"
  if err.number > 0 then msgbox err.number &":"& err.description &" in "& err.source
on error goto 0

Ingo Schumacher
Systems Engineering Manager CEERNational Instruments Germany
0 Kudos
Message 2 of 4
(3,229 Views)

Ingo,

Thank you for the explanation.  I understand how it works now.

Jim

0 Kudos
Message 3 of 4
(3,217 Views)

Hi Jim,

Since you're calling those VBScripts through ActiveX from LabVIEW, I would recommend that you continue to use the "AutoIgnoreError = 1" command in combination with the VBS commands Ingo suggested.  It is safer to use AutoIgnoreError as well as the On Error VBS commands when you are running DIAdem through its OLE Automation server.

The AutoIgnoreError command disappeared from the DIAdem Help system, but it is still available and still works.  Most people don't automate DIAdem from an external program, so we've been nudging users towards the VBS error checking commands.

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 4 of 4
(3,200 Views)