Execute method
The
Execute
method sends an execute command to the FactoryTalk Batch
Server and retrieves a response string. The Execute
method applies to the BatchServer
and BatchRemote
objects.Syntax | strReturn = object.Execute strExecute | |
---|---|---|
The Execute method syntax has these parts: | ||
Part | Description | |
object | Object expression that evaluates to a BatchServer or BatchRemote object. | |
strExecute | (required) String representing an execute supported by the FactoryTalk Batch Server application. | |
strReturn | Data associated with the specified item. (For the format of this data, refer to the appropriate execute.) | |
Remarks | The data for the item returns synchronously with this method. The FactoryTalk Batch Server waits, at most, a time period equal to the TimeoutPeriod property. If the server does not recognize an item string, then strReturn contains FAILED. If the timeout period expires before the data is collected internally to the FactoryTalk Batch Server, then strReturn contains TIMEOUT. |
This code example is
Visual Basic
6 syntax.Example: | Dimension a FactoryTalk Batch Server object and two strings:Dim svr As New BatchControl.BatchServer
Dim strExecute As String
Dim strReturn As String
svr.TimeoutPeriod = 10000 Format an execute string. This example asks the FactoryTalk Batch Server to acquire resource ID number 1:strExecute = "ACQUIRE(response,user,0,1)" Send the execute and print the response: strReturn = svr.Execute(strExecute)
MsgBox strReturn Message Box should display "SUCCESS:" |
Provide Feedback