DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

"User Commands" - registration!

I tried to register two files through user commands (Settings->Desktop parameter->user commands..)but on start of diadem the file which is first in the list gets excecuted and the other is not being executed, if I reverse the order of the files the same occurs. I am unable to find the problem, If it requires any return value to terminate the control from one file to come to the other? These files contain scriptstart commands, is there any chance for this command to possibly raise this issue. How can I solve it?
Waiting for your early response.

Thanks!
0 Kudos
Message 1 of 5
(3,489 Views)
Mv rajk,

What version of DIAdem are you using? Also, in the User Commands dialog box, what is the status of each of these files?

We'll try to resolve this quickly.

Regards,
Shannon R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,489 Views)
Hi Shannon,

I am using DIADem 9.00.1764 TDM(Evaluating & documenting Data). Each file holds the status "Loaded" in user commands. PLease give me a solution for this at the earliest.

Thanks,
Priya
0 Kudos
Message 3 of 5
(3,489 Views)
The code used in the file registered in User command is something like given below...

if hicuser <> 3.14159 then
if filex(file path) then
Call scriptstart(file path)
end if
hicuser = 3.14159
end if

if hicuser <> 3.14159 then
if filex(file path) then
Call scriptstart(file path)
end if
hicuser = 3.14159
end if

Waiting for a response at the earliest.
thanks!
0 Kudos
Message 4 of 5
(3,489 Views)
Priya,

I think you are seeing this behavior because your code needs to be encapsulated in a function. Then later on, when you want to use the User Command, you can simply type the name of the function to invoke that script. For example, if I was to make your example code into a correctly formed user command, I would have the following:

Function MyUserCommand
if hicuser <> 3.14159 then
if filex(file path) then
Call scriptstart(file path)
end if
hicuser = 3.14159
end if
End Function


Then later in another script or view of DIAdem, I would type "MyUserCommand" (without the quotes) to invoke that function.

The reason that the code executes is because when DIAdem opens, it registers that user command with the system by loo
king for the function names that need to be recognized as user commands. When DIAdem opens, it starts to register the script that you have specified, but instead of finding a function to register, it finds code to execute. Then it executes the code and gets confused why it was executing code from a place that isn't intended to do that.

If you are intending to run code as DIAdem starts, there is an explanation of how to do this in the DIAdem help under the following topics:
  1. Starting DIAdem with Parameters
  2. Program Start with Parameters


I hope that helps you. Let us know if you have further questions.

Regards,
Shannon R.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 5
(3,489 Views)