DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Can we suppress message displays (errors) in DIAdem via .VBS / .TDR?

I've tried several varibles in my implementation but have had no luck with suppressing the errors that my code generates via .VBS but actually occurs during execution in the "2DTable".   I'm trying to use one table fits all because all tests have certain values (description, mval, upper limit, pass/fail), however a few have no lower limit or lover measured value.... See insert:

 

  "CmdNoMsgDisp = TRUE
  D2TabVariable(1) ="@@Left(ChnPropValGet((""[""+str(L10+D2TabRow)+""]/TestItemData_1""), ""registertxt1""),Len(ChnPropValGet((""[""+str(L10+D2TabRow)+""]/TestItemData_1""), ""registertxt1""))-24)@@ "
  D2TabVariable(2) ="@@Str(ChnPropValGet((""[""+str(L10+D2TabRow)+""]/TestItemData_2""), ""LimitMinDevDown""),""dd.dd"")@@ "
  D2TabVariable(3) ="@@Str(ChnPropValGet((""[""+str(L10+D2TabRow)+""]/TestItemData_2""), ""Maximum""),""dd.dd"")@@ "
  D2TabVariable(4) ="@@Str(ChnPropValGet((""[""+str(L10+D2TabRow)+""]/TestItemData_1""), ""Maximum""),""dd.dd"")@@ "
  D2TabVariable(5) ="@@Str(ChnPropValGet((""[""+str(L10+D2TabRow)+""]/TestItemData_1""), ""LimitMaxDevUp""),""dd.dd"")@@ "
  D2TabVariable(6) ="@@TV(GroupPropValGet((L10+D2TabRow), ""Status_Binary"") + 1)@@ "
  Call LogfileDel
  LogfileExtent(1) = 1
  LogfileExtent(2) = 0
  CmdNoMsgDisp = FALSE"

 

Any help would be greatly appreciated. 

 

Thanks - Jeff

0 Kudos
Message 1 of 14
(5,483 Views)

Hi Jeff,

 

Do you have DIAdem 11.0 or later?  If so, you an use the IIF() function to introduce conditional branching in your @@DIAdem expression@@.  Here's an example:

 

StepID: @@IIF(GroupPropExist(4, "StepID"), GroupPropValGet(4, "StepID"), "")@@

 

If you don't have DIAdem 11.0 or later, let me know and I'll see if I can think of something else.

 

Brad Turpin

DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 2 of 14
(5,463 Views)
Unfortunately not - our version is 10.2.
0 Kudos
Message 3 of 14
(5,460 Views)

Hi Jeff,

 

have you already tried to write and add a custom "User-Command"?

 

regards

romi_wo

0 Kudos
Message 4 of 14
(5,449 Views)
What are custom User Commands? Are you referring to the logic that imbeds into the .TDR (2DTable) at runtime?
0 Kudos
Message 5 of 14
(5,441 Views)

Alright Jeff,

 

In that case, try the following calls instead of a simple "PicUpdate" every time that occurs in your code-- the "CmdNoDialogDisp" setting suppresses/allows error dialogs:

 

 

CmdNoDialogDisp = TRUE

Call PicUpdate

CmdNoDialogDisp = FALSE

 

Brad Turpin
DIAdem Product Support Engineer
National Instruments 

0 Kudos
Message 6 of 14
(5,432 Views)

Still no luck suppressing the dialog for the errors.  I have tried several variations to no luck.   I'm not sure I can even stop my own message popup with these commands. However, even though the error log indicates the error occurs during code execution (attached the other day),  I've proven that the error does not occurr  until after the PDF Export command ( see code below):

 

    'MsgBox MyFolders(2) ' This is sometimes easier that setting a watch variable
    IF Not(FilEx(MyFolders(2))) THEN ' Check to see if the file exists already
        CmdNoDialogDisp = TRUE
        CmdNoErrorDisp = TRUE
        CmdNoInfoDisp = TRUE
        CmdNoMsgDisp = TRUE
        CmdNoWarningDisp = TRUE
        Call PicUpdate
        Call PicPDFExport(MyFolders(2)) 'The PDF function doesn't allow overwriting
        'MsgBox "After Suppress#1" ' This is sometimes easier that setting a watch variable
        CmdNoDialogDisp = FALSE
        CmdNoErrorDisp = FALSE
        CmdNoInfoDisp = FALSE
        CmdNoMsgDisp = FALSE
        CmdNoWarningDisp = FALSE
        'MsgBox "After Suppress#2" ' This is sometimes easier that setting a watch variable
    END IF
'MsgBox "After Suppress#3" ' This is sometimes easier that setting a watch variable

NOTE: I've added logic to test how to suppress????

0 Kudos
Message 7 of 14
(5,422 Views)

 Hi Jeff,

 

I've attached a script which you can use as usercommand.

The following code-snippet shows how to use it.

 

call ScriptCmdAdd(AutoActPath & "assignChnValue.vbs" )
assignValue("[1]/Channel1","name","" )


D2TabVariable(1) ="@@Left(assignValue((""[""&(L10+D2TabRow)&""]/TestItemData_1"", ""registertxt1"","""" ),Len(assignValue((""[""+str(L10+D2TabRow)+""]/TestItemData_1"", ""registertxt1"","""" )-24)@@"
D2TabVariable(2) ="@@assignValue((""[""&(L10+D2TabRow)&""]/TestItemData_2"", ""LimitMinDevDown"",""dd.dd"" )@@ "
 

May that is what you expected?

 

Kind Regards

romi_wo

 

0 Kudos
Message 8 of 14
(5,399 Views)

Hi Jeff,

 

I constructed a TDR with a reference to a property that does not exist.  Whenever I refresh the REPORT panel I get the corresponding error/warning dialog.  But when I execute the one line of code to export this REPORT sheet to a PDF file, it works without any errors.  Are you passing a full and valid PDF file path in the PicPDFExport command?

 

Call PicPDFExport("C:\NoName.PDF")

 

What is the error message you're getting?

Brad Turpin
DIAdem Product Support Engineer
National Instruments

 

 

0 Kudos
Message 9 of 14
(5,383 Views)

I've attached the error in a bitmap. The script file is executed via a LabVIEW .vi which is called from TestStand.   The .pdf file does generate successfully its just that I get the error message popup (attached file).

 

My other question is that I looked at the prior response from "romi_" with the attached snippet of .vbs code.   Since I have DIAdem ver 10.2,  can I call a function within the 2DTable or do I need to upgrade to version 11?

 

 

0 Kudos
Message 10 of 14
(5,381 Views)