# Sending out command from ignition to a device via TCP/IP

**URL:** <https://forum.inductiveautomation.com/t/sending-out-command-from-ignition-to-a-device-via-tcp-ip/65179>\
**Category:** Ignition\
**Created:** [October 13, 2022, 3:19pm UTC](https://forum.inductiveautomation.com/t/sending-out-command-from-ignition-to-a-device-via-tcp-ip/65179 "2022-10-13T15:19:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thiamweekhoo](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@thiamweekhoo](https://forum.inductiveautomation.com/u/thiamweekhoo)\
**Post date:** [October 13, 2022, 3:19pm UTC](https://forum.inductiveautomation.com/t/sending-out-command-from-ignition-to-a-device-via-tcp-ip/65179/1 "2022-10-13T15:19:51Z")

</div>

I need help sending command (hex) to a device via TCP/IP for remote control application.  
We are connected to a Smith Meter AccuLoad III. Using another software, I can send command to the device, but I am confused by how to send commands through Ignition. Here is the [Accuload III Modbus Communication Manual](http://info.smithmeter.com/literature/docs/mn06130l.pdf) pg 13 -15

I use a third party software called **hercules** to send command (pg.269 of that manual) to that device by sending the hex highlighted in yellow and it's successful.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/3/93842e3a25080081acd02290bb11db810fa8c8fc.png)

My objective is when I click a button, it will send the command (in hex) out to that device via TCP/IP.  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![thiamweekhoo](https://avatars.discourse-cdn.com/v4/letter/t/e47c2d/32.png) [@thiamweekhoo](https://forum.inductiveautomation.com/u/thiamweekhoo)\
**Post date:** [October 13, 2022, 4:26pm UTC](https://forum.inductiveautomation.com/t/sending-out-command-from-ignition-to-a-device-via-tcp-ip/65179/2 "2022-10-13T16:26:30Z")

</div>

I create TCP driver as below. I key in the hex and write to my device but seems like it's not working. No response on my other device after sending the command

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/0/70dd0cbe65f63735dd48bf03c72839738e810546.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 13, 2022, 4:49pm UTC](https://forum.inductiveautomation.com/t/sending-out-command-from-ignition-to-a-device-via-tcp-ip/65179/3 "2022-10-13T16:49:22Z")

</div>

The TCP driver is geared much more toward ASCII text.

You will probably have to open raw sockets yourself. You can do this with the Python standard library, but Jython's implementation has some potential resource leaks. You're probably going to have a better time using Java's standard library.

There's some valuable discussion (and some example scripts) in this thread, as a starting point:

> [@Communicating with external applications over TCP/IP socket /websockets using gateway scripts](https://forum.inductiveautomation.com/t/communicating-with-external-applications-over-tcp-ip-socket-websockets-using-gateway-scripts/20455):
>
> How can we communicate Ignition with external applications over TCP/IP sockets or websockets using gateway Jython scripts,? Does the gateway scripts have libraries for TCP sockets or websockets communication? I don't see it in python gateway script library documentation. Has anyone developed a module for it (either commercial or free module). The existing TCP/IP module in Ignition is specifically designed for bar code reader which is not generic in nature. Can JAVA/Jython combination be used so…
