# Connecting to Beckhoff OPC UA

**URL:** <https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522>\
**Category:** Ignition\
**Created:** [October 8, 2020, 11:42pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522 "2020-10-08T23:42:16Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![luis.3.flores](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@luis.3.flores](https://forum.inductiveautomation.com/u/luis.3.flores)\
**Post date:** [October 8, 2020, 11:42pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/1 "2020-10-08T23:42:16Z")

</div>

Hi guys I am using Ignition V 7.9.13 and I am able to connect to Beckhofff OPC UA V1.5.3, but the problem is that I cannot see the PLC1 Tags.

I have other PLCs with Bechhoff OPC UA V1.4.6 and it works fine.

In Ignition I am connecting to opc.tcp://ST-MTHPN2001:48050  
Beckhoff settings:

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

Any idea why I do not see the PLC1 tags? I am able to see them on the TwinCAT OPC UA Sample Client but only using por 4840 (discovery port) not 48050.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 8, 2020, 11:54pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/2 "2020-10-08T23:54:40Z")

</div>

Is the OPC UA connection in Ignition actually connected?

Are you sure you’re connecting to a Beckhoff server and not some intermediate UA gateway that needs to be configured with the tags first or something?

---

<div class="post-metadata">

**Author:** ![luis.3.flores](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@luis.3.flores](https://forum.inductiveautomation.com/u/luis.3.flores)\
**Post date:** [October 8, 2020, 11:54pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/3 "2020-10-08T23:54:17Z")

</div>

The folder TcOpcUAServer is visible but the PLC1 is not visible.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/96db5268f15ea9b4c9697c81663acbf6729c0dc6.png)

In the TwinCAT OPC UA Sample client is visible: but only using port 4840.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/d/5d8a6bbc5a40e5f80649fb5a4fcca9082d21404e.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 8, 2020, 11:57pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/4 "2020-10-08T23:57:06Z")

</div>

It may help to connect with a generic 3rd party client like UaExpert and see if you have the same issue.

---

<div class="post-metadata">

**Author:** ![luis.3.flores](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@luis.3.flores](https://forum.inductiveautomation.com/u/luis.3.flores)\
**Post date:** [October 8, 2020, 11:57pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/5 "2020-10-08T23:57:28Z")

</div>

Kevin  
Yes it is connected.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/7/e7d0c3ae2779ee559ee0dea63253e8d8a3c63532.png)

The tags are ready, You can see that If I use the sample client it is visible:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/2/2246938002c904461fe09c48bbbbd8ac43a5e3fb.png)

---

<div class="post-metadata">

**Author:** ![luis.3.flores](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@luis.3.flores](https://forum.inductiveautomation.com/u/luis.3.flores)\
**Post date:** [October 9, 2020, 12:01am UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/6 "2020-10-09T00:01:01Z")

</div>

If I use the same port 4840 in Ignition it does not work, it discovers it, but then it says Faulted. In Ignition only works with endpoint 48050 but does not show the PLC1 tags.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 9, 2020, 12:03am UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/7 "2020-10-09T00:03:21Z")

</div>

What’s the error when you use 4840?

Again, try connecting UaExpert as well, on both ports. We should be able to get some additional information from UaExpert if it works, like what kind of reference it is to the PLC1 object and what type of object it is.

---

<div class="post-metadata">

**Author:** ![luis.3.flores](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@luis.3.flores](https://forum.inductiveautomation.com/u/luis.3.flores)\
**Post date:** [October 9, 2020, 2:36pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/8 "2020-10-09T14:36:47Z")

</div>

Kevin:  
Using UaExpert to connect to tcp.opc://10.83.108.40:48050 it connects but does not show the PLC1.

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

Then, using tcp.opc://10.83.108.40:4840 I had to use security Basic256Sha256 / Sign.  
I got these errors, I trusted the cert and then it connected once I selected Ignore on last pop-up message.

 ![UaExpert cert error](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/b/7b1f35a2bb20660c974905c1d82cab586b8150eb.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/6/166fe656903d3c2e31f2abb9c0169745ea34b979.png)

Connected, it shows the PLC1.

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

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 9, 2020, 2:40pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/9 "2020-10-09T14:40:11Z")

</div>

Seems you need to get Ignition connected on port 4840 then.

What was the error in the logs or status section? A faulted connection should have an exception or stack trace associated with it.

---

<div class="post-metadata">

**Author:** ![luis.3.flores](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@luis.3.flores](https://forum.inductiveautomation.com/u/luis.3.flores)\
**Post date:** [October 9, 2020, 2:42pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/10 "2020-10-09T14:42:14Z")

</div>

The hostname or IP address in the server cert does not match the hostname or IP address the client connected to.

I am thinking maybe, I have an error on the hostnames on the cert.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 9, 2020, 2:42pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/11 "2020-10-09T14:42:51Z")

</div>

I am pretty sure Ignition only logs a warning when there is a mismatch, it’s not the underlying reason for the connection being faulted.

---

<div class="post-metadata">

**Author:** ![luis.3.flores](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@luis.3.flores](https://forum.inductiveautomation.com/u/luis.3.flores)\
**Post date:** [October 9, 2020, 2:44pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/12 "2020-10-09T14:44:32Z")

</div>

this is the error on Ignition when using port 4840.

UaException: status=Bad\_InvalidArgument, message=One or more arguments are invalid.  
at org.eclipse.milo.opcua.stack.client.transport.uasc.UascClientAcknowledgeHandler.onError(UascClientAcknowledgeHandler.java:258)  
at org.eclipse.milo.opcua.stack.client.transport.uasc.UascClientAcknowledgeHandler.decode(UascClientAcknowledgeHandler.java:167)  
at io.netty.handler.codec.ByteToMessageCodec$1.decode(ByteToMessageCodec.java:42)  
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502)  
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441)  
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278)  
at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)  
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:337)  
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1408)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359)  
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345)  
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)  
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)  
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:677)  
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:612)  
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:529)  
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:491)  
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)  
at java.lang.Thread.run(Unknown Source)

7.9.13 (b2019120915)  
Oracle Corporation 1.8.0\_241

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 9, 2020, 2:46pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/13 "2020-10-09T14:46:20Z")

</div>

Okay, so this Bad\_InvalidArgument is a channel-level error coming from the Beckhoff server.

You may need to go make sure Ignition’s client certificate is trusted in the Beckhoff server somewhere. Or it could be some other issue, maybe something it doesn’t like about the certificate. Unfortunately there’s no more information you can get from the Ignition side of this.

---

<div class="post-metadata">

**Author:** ![luis.3.flores](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@luis.3.flores](https://forum.inductiveautomation.com/u/luis.3.flores)\
**Post date:** [October 9, 2020, 2:49pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/14 "2020-10-09T14:49:59Z")

</div>

> [@luis.3.flores](#):
>
> The hostname or IP address in the server cert does not match the hostname or IP address the client connected to

Ok I will create a new certificate with the correct hostname and trust the ignition client cert.

---

<div class="post-metadata">

**Author:** ![adam.haney](https://avatars.discourse-cdn.com/v4/letter/a/4bbf92/32.png) [@adam.haney](https://forum.inductiveautomation.com/u/adam.haney)\
**Post date:** [March 17, 2021, 8:46pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/15 "2021-03-17T20:46:17Z")

</div>

Just a SnootBoop for anyone doing TwinCAT OPC UA – Ignition OPC UA Client

TC’s OPC UA Gatway uses default port 4840 and this is the port the TC Gateway will point to. However, the end-point of that TC UA Server entry is a different port; for me on localhost, it was port 48050.

So if you add your OPC variable attributes in your TC Global Variable List or in a Program above the variables you want to expose, Activate Config and login, you should be able to see the tags you exposed via an OPC client.

For me, Ignition would cycle between “connecting” and “faulted” with port 4840. Creating a new OPC Connection at same URL but Port 48050 allowed me to connect and see tags.

---

<div class="post-metadata">

**Author:** ![luis.3.flores](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@luis.3.flores](https://forum.inductiveautomation.com/u/luis.3.flores)\
**Post date:** [March 17, 2021, 9:15pm UTC](https://forum.inductiveautomation.com/t/connecting-to-beckhoff-opc-ua/39522/16 "2021-03-17T21:15:28Z")

</div>

For me the the problem was that I could not connect using security “none” but then we realized that it was disabled.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/e/eef0aa37d6e8a21148e8481248f4e4037cb0ab61.png)

It was commented on the file, we removed the comments to enable it and it started working on port 4840.
