Skip to main content
Version: 8.1

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

TypeParameterDescription
StringstreamFunctionThe stream and function of the SECS message to send. Example: "S1F13"
BooleanreplyWhether or not the SECS message expects a reply message.
ObjectbodyThis 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.
StringequipmentName of the equipment connection to use.

Returns

Integer - The transactionID of the SECS message response.

Scope

Gateway, Vision Client, Perspective Session

Code Example

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)

Keywords

system secsgem sendRequest, secsgem.sendRequest