Using the Process Analyst > Process Analyst for Developers > Automation Model > ICommandSystem.Create [Method]

ICommandSystem.Create [Method]

Creates a new Command object that is added to the CommandSystem.

Defined As

Parameters

commandID

[in] A unique identifier for this command (1-64 characters).

buttonType

[in] A value representing a button type.

tooltip

[in] The text to be displayed as a tooltip for this command (1-64 characters).

iconPath

[in] The path to an icon file that will be used as this command's picture.

privilege

[in] A privilege value necessary by the CitectSCADA user to gain access to this command (0-8).

Execution Result

If the method succeeds, the return value is Success. If an argument is invalid or out of range, the return value is InvalidArgument. If the command was not created, the return value is GeneralFailure.

Remarks

The commandID cannot begin with the prefix "Citect_".

Calling Syntax

This example assumes there is a valid CommandSystem object as retrieved from a Process Analyst. (for example, VBA: ProcessAnalyst.CommandSystem).

[VBA]

Sub Example(CommandSystem As Object)
Dim command As Object
Set command = CommandSystem.Create(CommandIO, "Some tooltip text", "c:\someicon.ico", 5)
End Sub

[Cicode]

FUNCTION Example(OBJECT hCommandSystem)
OBJECT hCommand = _ObjectCallMethod(hCommandSystem, "Create", CommandIO, "Some tooltip text", "c:\someicon.ico", 5);
END