# Return OPC server IP address

**URL:** <https://forum.inductiveautomation.com/t/return-opc-server-ip-address/59276>\
**Category:** Ignition\
**Created:** [May 6, 2022, 3:56am UTC](https://forum.inductiveautomation.com/t/return-opc-server-ip-address/59276 "2022-05-06T03:56:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![john.eichler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/john.eichler/32/24632_2.png) [@john.eichler](https://forum.inductiveautomation.com/u/john.eichler)\
**Post date:** [May 6, 2022, 3:56am UTC](https://forum.inductiveautomation.com/t/return-opc-server-ip-address/59276/1 "2022-05-06T03:56:57Z")

</div>

For devices using the Modbus TCP, Siemens or Allen Bradley drivers, I can return the IP address using system.device.getDeviceHostname(deviceName)

I also have several PLCs with OPC-UA servers that are communicating with ignition. I can get the names of these devices using [system.opc.getServers](https://docs.inductiveautomation.com/display/DOC81/system.opc.getServers). Is there a way to return the IP address of these devices?

Thanks

---

<div class="post-metadata">

**Author:** ![jonathan.taylor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jonathan.taylor/32/4048_2.png) [@jonathan.taylor](https://forum.inductiveautomation.com/u/jonathan.taylor)\
**Post date:** [May 6, 2022, 10:41am UTC](https://forum.inductiveautomation.com/t/return-opc-server-ip-address/59276/2 "2022-05-06T10:41:48Z")

</div>

It would depend on the OPC, but certainly from Kepware you can get hostname information for each device connection configured. Normally found under each devices \_System.\_DeviceId tag

---

<div class="post-metadata">

**Author:** ![john.eichler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/john.eichler/32/24632_2.png) [@john.eichler](https://forum.inductiveautomation.com/u/john.eichler)\
**Post date:** [May 12, 2022, 3:36am UTC](https://forum.inductiveautomation.com/t/return-opc-server-ip-address/59276/3 "2022-05-12T03:36:37Z")

</div>

> [@jonathan.taylor](#):
>
> OPC, but certainly from Kepware you can get hostname information for each device connection configured. Normally found under each devices \_System.\_Devi

Thanks for the reply. I have a few different OPC servers including S7-1200 PLCs, Rittal IoT devices and others. In the OPC browser, the Siemens PLCs do display a data point called "EndpointUrl" which is the address of the OPC-UA endpoint. The problem is that the path to this data point is specific to a session. I suspect the session ID (and path) will change if the device is power cycled.

This data point is not provided by the Rittal device.

With a bit of work, the Siemens PLCs can output the IP address of their Profinet interface but this will obviously not work for OPC-UA connections to other devices.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/b/5b9f70ae9323bf38491d0a8b409670c513693dc5.png)

The best solution would be to get the IP from the Ignition OPC client. I could manually enter the IPs in a SQL table or as a plain dataset but I then have two sources of the truth and more maintenance work to do.

Any other ideas? Cheers

---

<div class="post-metadata">

**Author:** ![Jatin\_Kumar\_Singh](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@Jatin\_Kumar\_Singh](https://forum.inductiveautomation.com/u/Jatin_Kumar_Singh)\
**Post date:** [August 18, 2022, 7:26pm UTC](https://forum.inductiveautomation.com/t/return-opc-server-ip-address/59276/4 "2022-08-18T19:26:42Z")

</div>

Hi, did you get any ideas? I am kinda in the same boat and have been looking for answers.

Requirement: Get to know the IPAddresss of the OPC UA servers the Ignition is connected to.

---

<div class="post-metadata">

**Author:** ![john.eichler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/john.eichler/32/24632_2.png) [@john.eichler](https://forum.inductiveautomation.com/u/john.eichler)\
**Post date:** [September 15, 2022, 4:23am UTC](https://forum.inductiveautomation.com/t/return-opc-server-ip-address/59276/5 "2022-09-15T04:23:38Z")

</div>

@Jatin_Kumar_Singh Sorry for the slow reply. No, I did not get anywhere with this. I resorted to setting up a memory tag in the folder for each OPC-UA device. This tag contains a string with the IP address… This is not a good solution. I would welcome suggestions for anything better.
