DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

user command

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

0 Kudos
Message 1 of 7
(6,022 Views)

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

0 Kudos
Message 2 of 7
(5,994 Views)

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?

 

0 Kudos
Message 3 of 7
(5,961 Views)

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 

0 Kudos
Message 4 of 7
(5,936 Views)

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

0 Kudos
Message 5 of 7
(5,920 Views)

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

0 Kudos
Message 6 of 7
(4,848 Views)

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

0 Kudos
Message 7 of 7
(4,682 Views)