DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Trap Error in DIAdem through ToCommand

Can you let me know if there is any means to trap errors that would occur in DIAdem Interface when it’s called through ToCommand and NoErrorDisplay is set to true (1)?
 
We try to invoke DIAdem through ToCommand in a COM, since we need DIAdem to work as a server bNoErrorDisplay is set to true. Could you please let us know the possible means to trap an DIAdem error in COM.
 
Waiting for your earliest response.
Thanks,Priya
0 Kudos
Message 1 of 2
(2,895 Views)

Hi Priya,

Try this code, and see if you get the functionality you're looking for:


Set ToCommand = CreateObject("DIAdem.ToCommand")
Call ToCommand.CmdExecuteSync("LastErrorReset")
Call ToCommand.CmdExecuteSync("AutoIgnoreError:= 1")
Call ToCommand.CmdExecuteSync("L1:= 0")
Call ToCommand.CmdExecuteSync("L1:= ProgramRevision(1,3,4)")
'Call ToCommand.CmdExecuteSync("L1:= ProgramRevision")
'Call ToCommand.CmdExecuteSync("LastErrorReset")
Call ToCommand.CmdExecuteSync("LastErrorGet")
Call ToCommand.IntegerVarGet("L1", Version)
Call ToCommand.IntegerVarGet("LastErrorNo", ErrNum)
Call ToCommand.TextVarGet("LastErrorFile", ErrText)
Call ToCommand.IntegerVarGet("LastErrorPart", ErrPart)
Call ToCommand.CmdExecuteSync("AutoIgnoreError:= 0")
Set ToCommand = Nothing
MsgBox "DIAdem Revision = " & Version & vbCRLF & "ErrNo = " & ErrNum & vbCRLF & "ErrMsg = " & ErrText & vbCRLF & "ErrPar = " & ErrPart


Regards,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

 

0 Kudos
Message 2 of 2
(2,882 Views)