GseosCmd.ExecCmd
Previous  Top  Next

ExecCmd(strCmd, [bQueryForArgs=True], [bCriticalCmdDialog=True], [bSendCmdString=True])

Executes a command that has been loaded into our command dictionary. If the command is valid and all arguments are within limits the CmdString block with the command text will be generated. If the optional parameter bQueryForArgs is set a dialog will query for the missing arguments if any and complete the command as necessary.
There are several ways to specify missing arguments. If no arguments are given at all like 'CMD()' all arguments will be requested. If there are arguments supplied and others that need to be filled in place a comma for every argument that is missing: CMD(Arg1,,Arg3). The above command would query for Arg2 and any arguments higher than Arg3 if there are any.
We currently assume that there are no string arguments and therefore no special characters (especially a comma) can occur within a command argument.
Keyword arguments must follow non-keyword (positional) arguments. Keyword arguments must specify the keyword in the actual argument, e.g. Cmd1(1, 2, 3, Arg4=4, Arg5=5). An optional keyword argument, e.g. Arg4 does not need to be specified: Cmd1(1, 2, 3, Arg5=5).

You can specify prompts by inserting the escape sequence: $'MyPrompt', where MyPrompt is the text the user will see as the prompt. The entire escape sequence including the $' and terminating ' will be replaced by the user input.

If this is a critical command a dialog box will be displayed to confirm execution of the critical command. The confirmation dialog can be suppressed by either passing in False for the bCriticalCmdDialog parameter or by having notification globally disabled in gseos.ini [Command]/DisableCriticalCmdNotification=Yes.

If the command is in error a TCmdError exception will be raised.
The ExecCmd function generates the CmdString block if the command is validated successfully. The command processor will then intercept the CmdString block and convert the command string into a binary command by issuing the BinCmd system block. This block in turn will be processed by the BIOS to command your instrument as appropriate.

ParameterDescription     
strCmdThe command to execute.  
bQueryForArgs If True and not all arguments are specified a dialog will prompt for the missing arguments. If False an exception will be raised if not all required arguments are specified. The default is True.  
bCriticalCmdDialog If this is a critical command and you don't want the critical command warning pop up set this parameter to False. The default is True.  
bSendCmdStringSends the CmdString to execute the command. If False the command parameters will be validated and the command string returned without issuing the CmdString block which will effectively not issue the command. The default is True.  

Returns
strCmdThe completed command string.