09-07-2020 01:42 PM
Hello,
I'd like to include several scripts for automated evaluation as user commands.
We are using Diadem 2017.
My problem is, when an error occurs inside user commands, all scripts are aborted immediately without an error message, only a silent message is added to the logfile. This is confusing as the message line reads something like "script has finished" and other users would't suspect there was an error.
Is there a way to display clear error messages for user commands (as for normal scripts)? I have not found such an option.
Steve
09-12-2020 05:46 AM
Just for comparison: If I include the same scipt (with an intentional error) under the same namespace (ScriptScope) via ScriptInclude in the older version Diadem 2012 as a user command, then I get the usual error MessageBox with a warning sound and a logfile entry.
In Diadem 2017 (version 17.0.0f6657 (32 Bit)) there is only an entry added to the logfile.
I compared both desktop files (.ddd) and found no hint for a parameter controlling that error behaviour there.
Has anyone experienced the same, or is this different in later versions of Diadem?
Steve
09-23-2020 08:15 AM
Hi Steve,
I asked R&D about the suppressed/logged-only error messages in current DIAdem versions, and they replied that this is by design. UserCommands are best used only in DIAdem event scenarios, like responding to VIEW cursor events or REPORT drag&drop events or NAVIGATOR load events or custom context menu selection. For any non-event situation where a script is calling a function library, R&D recommends ScriptInclude(). Especially for cases where the event triggers frequently, such as the VIEW cursor movement, popping up error messages each time would be more frustrating than helpful. It is likely that this error message suppression was inserted when events were added to DIAdem many many versions back, but I did not specifically ask R&D that question.
I'm afraid I don't have any clever suggestions for how to let your user know the UserCommand threw an error. Is it an option for you to use ScriptInclude() instead of UserCommands, not in addition?
Brad Turpin
Principal Technical Support Engineer
National Instruments
09-23-2020 02:50 PM
Hi Brad,
thanks for your detailed answer.
I understand that frequent error messages from event triggers would be annoying, but especially such event routines should be thoroughly tested so that this doesn't happen.
For me I found a compromise having user commands for basic routines and ScriptInclude (from each script using that functions, as you suggested) for test analysis that is modified more often and more critical to involving errors.
It is quite useful to have user commands in the background all the time, even more if you add AutoComplete to your own objects by ScriptCMDRegister / odl-file (although that's a laborious thing to do). So I think it's a pity that R&D cuts down the usage of user commands to event scenarios. Why haven't they turned that error behaviour into an option?
Steve
12-03-2020 05:15 PM
Hey Steve,
Please do post a feature request for this expanded UserCommand ability at the DIAdemIdeas page:
https://forums.ni.com/t5/DIAdem-Idea-Exchange/idb-p/diademideas
Brad Turpin
Principal Technical Support Engineer
National Instruments