02-12-2014 10:20 AM
Hello, I was hoping if I could get help on the user commands functionality.
I have a report and a coordinate on the report with the following as the text:
@@GetYPos(CurrXValue)@@ Elapsed Time= @@str(CurrXValue,"AutoAdj")@@
I created a user command "GetYPos" and I used the ScriptCmdAdd to add it to DIADEM. The function extracts the y values from the current x position and it works, however when I try to change anything on the report by accesing the Display menu the result I get on the comment is " CurrXValue Elapsed Time CurrXValue" as if the GetYPos is not getting called anymore
I changed the return value of GetYPos to just a constant and it still the same result.
The only way to make it work again is to re-save GetYPos file .
Is there a way to get arround this? I'll appreciate the help
02-13-2014 08:36 PM
Hi Bertha,
What version of DIAdem are you using? Have you tried adding the user command through the Settings menu instead of with ScriptCmdAdd?
Go to Settings»Options»Extensions»User Commands»Add.
http://zone.ni.com/reference/en-XX/help/370858K-01/procauto/procauto/procauto_usercommand/
K Johnson
Applications Engineering
National Instruments
02-17-2014 01:23 PM
I tried it today same result I have 2012 version. It doesn't start working again until I click refresh in Settings»Options»Extensions»User Commands
Is there a way to refresh the user commands by script?
02-18-2014 08:35 PM
Hmmm, unfortunately I can't find any way to do that. Here's a forum post with a similar question that confirms that there's no direct way to refresh user commands in the script:
http://forums.ni.com/t5/DIAdem/Programmatically-refreshing-a-user-command/td-p/2512452
Kelsey Johnson
Applications Engineer
National Instruments
02-19-2014 04:47 PM
Hi Bertha,
If you use "ScriptCmdAdd()" like you started with, it will always update the UserCommand memory with the latest funtion versions in that VBScript file. I recommend using ScriptCmdAdd() in almost all cases.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
03-24-2015 06:41 AM
Hi Brad,
I have similar issue.
I need to update my user command here named "toto" and so manually.
Even using the Call ScriptCmdAdd(CurrentScriptPath & "toto.vbs") in my scripts it does not solve it.
For my automatic analysis it is a problem to interact like that...
Louval
04-21-2015 11:30 AM
Hi Louval,
Please elaborate what happens or fails to happen after running the ScriptCmdAdd() call. This absolutely redeclares all the User Commands in the VBScript file path you pass into that command.
Brad Turpin
DIAdem Product Support Engineer
National Instruments