system.secsgem.sendRequest
This function is used in Python Scripting.
Description
Sends a JSON-formatted SECS message to a tool. An equipment connection must be configured for the tool in the Gateway.
Client Permission Restrictions
This scripting function has no Client Permission restrictions.
Syntax
system.secsgem.sendRequest(streamFunction, reply, body, equipment)
Parameters
Type | Parameter | Description |
---|---|---|
String | streamFunction | The stream and function of the SECS message to send. Example: "S1F13" |
Boolean | reply | Whether or not the SECS message expects a reply message. |
Object | body | This contains the body of a SECS message. The argument can be a Python Object or JSON string representing the body of a SECS message. If this argument is a string then it will be converted to a Python Object using the system.util.jsonDecode function. |
String | equipment | Name of the equipment connection to use. |
Returns
Integer - The transactionID of the SECS message response.
Scope
Gateway, Designer, Client
Code Examples
Code Snippet - Sending a S1F1 Message
# Replace the string below with the equipment name you want to send the request to.
myEquipment = "EquipmentOne"
# Define the contents of the body. We're using an empty string, since S1F1 doesn't expect a body, and we need to define something (Python's None will result in an exception).
body = ""
# Store the returned transactionID in a variable. This script could be extended by using system.secsgem.getResponse to view the response.
transactionID = system.secsgem.sendRequest("S1F1", True, body, myEquipment)
Code Snippet
[
{
"format":"U4",
"value":268959744
},
{
"format":"U4",
"value":272695296
},
{
"format":"U4",
"value":268500992
}
]