--- title: "system.secsgem.sendRequest" description: "Sends a JSON-formatted SECS message to a tool." --- # system.secsgem.sendRequest > Sends a JSON-formatted SECS message to a tool. 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](../../../ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) 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](../system-util/system-util-jsonDecode.md) function. String| `equipment` | Name of the equipment connection to use. ### Returns **Integer** - The transactionID of the SECS message response. ### Scope Gateway, Vision Client, Perspective Session ## Code Example ```python title="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) ```