# Communication with a TCP Device

**URL:** <https://forum.inductiveautomation.com/t/communication-with-a-tcp-device/95190>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [August 27, 2024, 7:30am UTC](https://forum.inductiveautomation.com/t/communication-with-a-tcp-device/95190 "2024-08-27T07:30:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel\_Sueur](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Samuel\_Sueur](https://forum.inductiveautomation.com/u/Samuel_Sueur)\
**Post date:** [August 27, 2024, 7:30am UTC](https://forum.inductiveautomation.com/t/communication-with-a-tcp-device/95190/1 "2024-08-27T07:30:36Z")

</div>

Hi folks,

We are trying to communicate with an intrusion detection system.

This device uses the TCP SIA protocol.  
I can connect to this device using the TCP Driver natively included in Ignition, but I have to send an access code to this device at a specific index in order to not be rejected by the device.

Any ideas on how I could do this ?  
I think what would be ideal would be to send a frame as soon as the device is connected but based on the knowledge I have, I don't think I can declare this in the "Device connections" section.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![pascal](https://avatars.discourse-cdn.com/v4/letter/p/e9a140/32.png) [@pascal](https://forum.inductiveautomation.com/u/pascal)\
**Post date:** [August 27, 2024, 7:58am UTC](https://forum.inductiveautomation.com/t/communication-with-a-tcp-device/95190/2 "2024-08-27T07:58:59Z")

</div>

Hi,

This might help.  
You can get the device connection status in the designer's Tag Browser in the "System" tag provider. Under Gateway/Devices you will find your devices and for each device you have a Status Tag.

---

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [August 27, 2024, 9:23am UTC](https://forum.inductiveautomation.com/t/communication-with-a-tcp-device/95190/3 "2024-08-27T09:23:21Z")

</div>

Unfortunately, the TCP Device Driver is extremely basic, and only good for sending strings back and forth.  
If you want more complex communication you may need to do this via scripting, or if there are other 3rd part modules that can be used on the exchange.

I found this out on a thread from a while back here:

> [@Opening Sockets to TCP devices using scripting](https://forum.inductiveautomation.com/t/opening-sockets-to-tcp-devices-using-scripting/76860):
>
> Hey all, We've got some machines that will be sending and receiving data to our Ignition using python TCP APIs, and then ideally writing these to tags. In a testing python prgram that was developed, a socket to the relevant port is opened and made as an object in the code. This socket is then used in an endless while loop to pull the data out in a continuous stream. Is there a best practice to stream data over a socket like this in Ignition. We have two options in my mind: Using Gateway Ti…

Worth noting if you do go down the scripting route, make sure you use the Jython Java TCP socket module and not the built-in python socket, as it is filled with memory leaks.
