Using OPC com to connect to an OPC server

The PC has an OPC server installed from Bosch Rextroth/Indramat. It also has Wonderware’s OPCLink installed. I am pointing Excel at OPCLink. OPCLink is set to talk to the OPC server.

This all works.

I am now trying to point Ignition installed on the same machine at the OPC server. Somewhere I am missing something, because it will not connect.

I have installed Matrikon’s OPC Explorer 5.0. It will connect and browse the Indramat OPC server. Matrikon’s simulator was installed in the process. Ignition will connect to it as well.

Any ideas what might be wrong or where to look?

Ignition 7.3.4, OPCcom running in demo.

Thanks

Dennis

It sounds like the problems might be coming from the fact that Ignition is running as a service, under the System account, while your OPC server is running under the “interactive user”. The other OPC clients that work are also running in the interactive account, so they don’t have a problem connecting. With servers like this, the situation is more or less similar to that of connecting to a remote server, and so DCOM settings come into play.

However, you can sometimes get around the issue by simply setting the Ignition service to run as the same account you’re logged in as. You can go this by going to Administrative Tools>Services, right-clicking on Ignition and selecting “Properties”, and going to the “Log On” tab.

Give that a shot, if possible, and let me know how it goes.

Regards,

Ok, now running 7.4.1 Windows 2003 32bit JAVA 1.6_30

I changed the Ignition Gateway Login to be the same as my interactive user.

Now what I see is the OPC-COM go through a repeated Connecting, Connected, Closed cycle over and over.

Is it closing because there is no tag item open? This particular OPC server does shut down with no activity.

I just added OPCLink from Wonderware supplying data to an Excel Spreadsheet. That keeps the OPC server open.

OPC-COM is still cycling as above.

Matrikon’s OPC Explorer is working fine.

What else should I look for?

Thanks

Dennis

Matrikon’s OPC Explorer will browse the tags on the OPC server.

Thanks,

Dennis

Are there any additional errors in the console? If you look closely, it should give some reason why it’s disconnecting. If you want, post the wrapper.log file from {InstallDir}\logs, and I can take a look.

You might also go into the settings for the OPC connection and select “Force DA2”, and unselect “Use Keepalives”. If Ignition is connecting and then disconnecting, it is because it thinks that something is wrong, and this will either be an error from the server, or something wrong with status checking, like an expired keepalive.

In regards to security, there could still be an issue there. The different between Ignition as a service and Matrikon as a user application is pretty significant. Another issue that comes up from time to time is that instead of connecting to the running server, the connection attempt will launch a new instance of the server, which often isn’t configured correctly. Watch the process list in the windows task manager as Ignition tries to connect- do new instances pop up and disappear? If so, you can try changing how the server is set to run. Go to dcomcnfg, browse down to the server under “DCOM Config”, go to properties, and then “Identity”. It is likely set to “the launching user”. You can try setting it to “the interactive user”, which should force Ignition to connect to the same instance that the Matrikon explorer would be connected to.

Regards,

INFO | jvm 1 | 2012/04/05 16:51:18 | INFO [COMServerImpl ] [16:51:18,861]: Attempting to connect COM server ‘IndraLogic’
INFO | jvm 1 | 2012/04/05 16:51:28 | INFO [COMServerImpl ] [16:51:28,940]: Server ‘IndraLogic’ state set to [CONNECTED]
INFO | jvm 1 | 2012/04/05 16:51:33 | INFO [COMServerImpl ] [16:51:33,877]: [IndraLogic] Server failure detected. Disconnecting.
INFO | jvm 1 | 2012/04/05 16:51:33 | INFO [COMServerImpl ] [16:51:33,877]: Disconnecting server ‘IndraLogic’
INFO | jvm 1 | 2012/04/05 16:51:33 | INFO [COMServerImpl ] [16:51:33,877]: Server ‘IndraLogic’ state set to [CLOSED]
INFO | jvm 1 | 2012/04/05 16:51:38 | INFO [COMServerImpl ] [16:51:38,878]: Server ‘IndraLogic’ state set to [CONNECTING]
INFO | jvm 1 | 2012/04/05 16:51:38 | INFO [COMServerImpl ] [16:51:38,878]: Attempting to connect COM server ‘IndraLogic’
INFO | jvm 1 | 2012/04/05 16:51:49 | INFO [COMServerImpl ] [16:51:48,957]: Server ‘IndraLogic’ state set to [CONNECTED]
INFO | jvm 1 | 2012/04/05 16:51:53 | INFO [COMServerImpl ] [16:51:53,879]: [IndraLogic] Server failure detected. Disconnecting.
INFO | jvm 1 | 2012/04/05 16:51:53 | INFO [COMServerImpl ] [16:51:53,879]: Disconnecting server ‘IndraLogic’
INFO | jvm 1 | 2012/04/05 16:51:53 | INFO [COMServerImpl ] [16:51:53,879]: Server ‘IndraLogic’ state set to [CLOSED]
INFO | jvm 1 | 2012/04/05 16:51:58 | INFO [COMServerImpl ] [16:51:58,879]: Server ‘IndraLogic’ state set to [CONNECTING]
INFO | jvm 1 | 2012/04/05 16:51:58 | INFO [COMServerImpl ] [16:51:58,879]: Attempting to connect COM server ‘IndraLogic’

I am not using DCOM. The OPC server, Matrikon Explorer, and Ignition all all installed on the same machine.

Dennis

Did you try disabling keepalives and forcing DA 2 like I suggested? It should also be possible to get a bit more information by going to Console>Levels, searching for “COMServer” and setting its level to “debug”. You might also want to set COMSubscription to debug as well. It should at least give us a little more of an idea of what is leading the server to think it’s faulted.

Even with everything on the same machine, DCOM security still comes into play and dictates how the applications are allowed to interact. However, with the service running under a normal user account, it is unlikely that there would be a problem with security. However, it definitely could be running in to the “identity” problem that I mentioned in the previous post.

Regards,

D) 2:38:36 PM COMServerImpl Received clsid ‘{193B9F48-1D59-477B-933F-391346163677}’ for server ‘IndraLogic’
(I) 2:38:36 PM COMServerImpl Attempting to connect COM server ‘IndraLogic’
(I) 2:38:36 PM COMServerImpl Server ‘IndraLogic’ state set to [CONNECTING]
(I) 2:38:31 PM COMServerImpl Server ‘IndraLogic’ state set to [CLOSED]
(I) 2:38:31 PM COMServerImpl Disconnecting server ‘IndraLogic’
(I) 2:38:31 PM COMServerImpl [IndraLogic] Server failure detected. Disconnecting.
(D) 2:38:31 PM COMServerImpl [IndraLogic] Bad server connection detected. Server state returned code ‘3’.
(I) 2:38:26 PM COMServerImpl Server ‘IndraLogic’ state set to [CONNECTED]
(D) 2:38:16 PM COMServerImpl Received clsid ‘{193B9F48-1D59-477B-933F-391346163677}’ for server ‘IndraLogic’
(I) 2:38:16 PM COMServerImpl Attempting to connect COM server ‘IndraLogic’
(I) 2:38:16 PM COMServerImpl Server ‘IndraLogic’ state set to [CONNECTING]
(I) 2:38:11 PM COMServerImpl Server ‘IndraLogic’ state set to [CLOSED]
(I) 2:38:11 PM COMServerImpl Disconnecting server ‘IndraLogic’
(I) 2:38:11 PM COMServerImpl [IndraLogic] Server failure detected. Disconnecting.
(D) 2:38:11 PM COMServerImpl [IndraLogic] Bad server connection detected. Server state returned code ‘3’.
(I) 2:38:06 PM COMServerImpl Server ‘IndraLogic’ state set to [CONNECTED]
(D) 2:37:56 PM COMServerImpl Received clsid ‘{193B9F48-1D59-477B-933F-391346163677}’ for server ‘IndraLogic’
(I) 2:37:56 PM COMServerImpl Attempting to connect COM server ‘IndraLogic’
(I) 2:37:56 PM COMServerImpl Server ‘IndraLogic’ state set to [CONNECTING]
(I) 2:37:51 PM COMServerImpl Server ‘IndraLogic’ state set to [CLOSED]
(I) 2:37:51 PM COMServerImpl Disconnecting server ‘IndraLogic’
(I) 2:37:51 PM COMServerImpl [IndraLogic] Server failure detected. Disconnecting.
(D) 2:37:51 PM COMServerImpl [IndraLogic] Bad server connection detected. Server state returned code ‘3’.
(I) 2:37:46 PM COMServerImpl Server ‘IndraLogic’ state set to [CONNECTED]
(T) 2:37:41 PM COMServerImpl [IndraLogic] Server state not verified, currently in CONNECTING state.
(D) 2:37:36 PM COMServerImpl Received clsid ‘{193B9F48-1D59-477B-933F-391346163677}’ for server ‘IndraLogic’
(I) 2:37:36 PM COMServerImpl Attempting to connect COM server ‘IndraLogic’
(I) 2:37:36 PM COMServerImpl Server ‘IndraLogic’ state set to [CONNECTING]
(I) 2:37:31 PM COMServerImpl Server ‘IndraLogic’ state set to [CLOSED]
(I) 2:37:31 PM COMServerImpl Disconnecting server ‘IndraLogic’
(I) 2:37:31 PM COMServerImpl [IndraLogic] Server failure detected. Disconnecting.
(D) 2:37:31 PM COMServerImpl [IndraLogic] Bad server connection detected. Server state returned code ‘3’.
(T) 2:37:31 PM COMServerImpl [IndraLogic] Verifying connection state for COM server.
(T) 2:37:31 PM COMServerImpl [Matrikon] Server state verified successfully.
(T) 2:37:31 PM COMServerImpl [Matrikon] Verifying connection state for COM server.
(I) 2:37:26 PM COMServerImpl Server ‘IndraLogic’ state set to [CONNECTED]
(T) 2:37:26 PM COMServerImpl [IndraLogic] Server state not verified, currently in CONNECTING state.
(T) 2:37:21 PM COMServerImpl [IndraLogic] Server state not verified, currently in CONNECTING state.

Us DA2 is checked.

Keepalive is unchecked.

Dennis

The key is this message:

According to my sources, that translates to the OPC server saying "OPC_STATUS_NOCONFIG" when asked about its state.

This, to me, indicates that another instance of the OPC server is being launched when Ignition tries to connect. Did you try setting the opc server to always run as the interactive user as I mentioned in the post before last? I think this is likely what you need to do.

Regards,

Thanks for the response.

In looking at the task manger, it looks like a second instance of the OPC server might be being spawned.

I will keep checking things. Thanks for your help and patience.

Dennis

Looks like it is almost working. Almost…

To separate out the wheat from the chaff, I did the following:

  1. I created a clean VM. XP SP3.
  2. Installed Indramat’s VM11v06. This is the program that has the OPC server.
  3. Installed Matrikon’s lastest OPC Explorer.
  4. Configured the OPC server to point at some physical motion controllers on our network. I just copied an existing configuration that was working in another machine.
    5 I verified that Matrikon OPC Explorer could see the OPC server. Both are on the same VM.
  5. I verified that Matrikon OPC Explorer could connect to the OPC server.
  6. I verified that Matrikon OPC Explorer could browse the items in the OPC server.
  7. I verified that Matrikon OPC Explorer could continuously display the contents of the OPC items.
  8. Then I installed Ignition 7.4.1 and verified it is functional.
  9. I verified that the services for the OPC server and Ignition were different logins. Matrikon and the OPC server are using the same login.
  10. I setup OPCCOM to point at the OPC server on the same VM.
  11. I verifed OPCCOM couild not connect to the OPC server.
  12. I changed the login of the Ignition Gateway to be the same as the OPC server.
  13. Now OPCCOM would connect to the OPC server and stay connected.
  14. Next I opened Designer and tried to use the OPC browser to view the tags in the OPC server.
  15. Now it gets interesting. The tags in the conttroller could be seen in the OPC browser, and drag and dropped into the realtime tag database. (SQL Tags) But, in both cases they are shown as folders.

Any ideas?

I can send you the VM next week, if it would help.

Thanks,

Dennis

One more word…

The OPC server configuration can be either Multi PLC or Single PLC.
I tried both ways.

As Multi PLC a tag name looks like MachineName:.SomeGlobalValue.

As Single PLC a tagname looks like .SomeGlobalValue.

Wonderware’s OPCLink can be pointed at the OPC server and it works.

Excel cells can contain links to OPCLink and tags defined as above.

Live data is in the cells of the spreadsheet.

Thanks for your help.

Dennis

Maybe next week we can just get on GoToMeeting and I can take a look. If the tags are showing up erroneously as folders, Ignition probably isn’t succeeding in getting additional tag properties that it needs from the server. We can installed the OPC Analyzer and take a look, but it’ll probably be a bit quicker if I get on there and do it instead of trying to direct you. There are some other things we can look at, and also compare what the other OPC clients are doing.

Regards,

I can’t do go to meeting in the plant.

That is part of the reason I created the VM. I can run it ex plant and we can do go to meeting there.

The OPC server has a simulation mode we can hit in the VM.

I’ll get back to you next week.

Thanks

Dennis

More testing today with the VM showed an interesting result.

Remember I said the tags were showing up as folders in the OPC browser?

These machines have a lot of tags, and I had not scrolled all the way down to see what things look like at the end of the list.

What I found today is this… The tag names were coming across as folders and as tags, same tag name.

When I dragged a tag from the OPC browser to the Realtime DB, it works. The OPC browser is correctly showing the tagname as “.tagname”. That’s the way they show up in Matrikon’s OPC Explorer.

When dragged into the Realtime DB, the dot is changed to an underscore. i.e.: _tagname

The tags are animated and can be used to animate a display in a window.

In the controller software global variables are seen as .tagname. I think the . means element of, so this is the same as saying project.tagname.

The OPC server appears to not like multiple local connections.

Still testing.

Dennis

I have been working on this some more and have mixed results.

On an XP SP3 VM I have things working, but on the Windows 2003 R2 VM it just won’t work.

On both machines I have Matrikon’s OPC Explorer 5.0 installed.

On both machines Matrikon’s OPC Explorer 5.0 can browse the target OPC server, see tags, and display tag data.

The Ignition install on Windows 2003 R2 can’t authenticate against the target OPC server.

Matrikon’s OPC Analyzer was run on both machines and the data from the DCOMinfo.txt files is below:

From the XP SP3 VM (Modicon) that works:


////////////////////////////////////////////////////////////////////////////////////////////////////////////
**************************************** DCOM Settings *******************************************************
////////////////////////////////////////////////////////////////////////////////////////////////////////////


Default Access Permission list:

ALLOWED-> NT AUTHORITY\ANONYMOUS LOGON
ALLOWED-> \Everyone
ALLOWED-> NT AUTHORITY\SELF
ALLOWED-> NT AUTHORITY\SYSTEM
Error retrieving Default Access Permissions

Default Launch and Activation Permission list:

ALLOWED-> BUILTIN\Administrators
ALLOWED-> NT AUTHORITY\ANONYMOUS LOGON
ALLOWED-> \Everyone
ALLOWED-> NT AUTHORITY\INTERACTIVE
ALLOWED-> NT AUTHORITY\SYSTEM
Error retrieving Default Launch Permissions


		General Properties of DCOM Application : OPC BRC Server Version IW-SCP 4.0


ACCESS PERMISSIONS :

Using Default Permissions

LAUNCH AND ACTIVATION PERMISSIONS:

Using Default Permissions

IDENTITY SETTINGS

Running as a: Application
Identity is set to: Launching User
AuthenticationLevel : Default


		General Properties of DCOM Application : OPC BRC Server Version IW-SCP 4.0


ACCESS PERMISSIONS :

Using Default Permissions

LAUNCH AND ACTIVATION PERMISSIONS:

Using Default Permissions

IDENTITY SETTINGS

Running as a: Application
Identity is set to: Interactive User
AuthenticationLevel : Default


		General Properties of DCOM Application : OpcEnum


ACCESS PERMISSIONS :

ALLOWED-> NT AUTHORITY\SYSTEM
ALLOWED-> NT AUTHORITY\SELF
ALLOWED-> \Everyone

LAUNCH AND ACTIVATION PERMISSIONS:

ALLOWED-> NT AUTHORITY\SYSTEM
ALLOWED-> BUILTIN\Administrators
ALLOWED-> NT AUTHORITY\INTERACTIVE
ALLOWED-> \Everyone

IDENTITY SETTINGS

Running as a: Service
Identity is set to: System Account
AuthenticationLevel : None


		General Properties of DCOM Application : IndraLogicOPCDA V34.4.70.0


ACCESS PERMISSIONS :

Using Default Permissions

LAUNCH AND ACTIVATION PERMISSIONS:

Using Default Permissions

IDENTITY SETTINGS

Running as a: Application
Identity is set to: Interactive User
AuthenticationLevel : Default


		General Properties of DCOM Application : OPC Server for IndraLogic 1.80  (1, 80, 239, 36) based on 2.3.13.10


ACCESS PERMISSIONS :

Using Default Permissions

LAUNCH AND ACTIVATION PERMISSIONS:

Using Default Permissions

IDENTITY SETTINGS

Running as a: Application
Identity is set to: Interactive User
AuthenticationLevel : Default


		General Properties of DCOM Application : Studio Scada OPC Server


ACCESS PERMISSIONS :

Using Default Permissions

LAUNCH AND ACTIVATION PERMISSIONS:

Using Default Permissions

IDENTITY SETTINGS

Running as a: Application
Identity is set to: Interactive User
AuthenticationLevel : Default


		General Properties of DCOM Application : MatrikonOPC Server for Simulation and Testing


ACCESS PERMISSIONS :

ALLOWED-> NT AUTHORITY\SELF
ALLOWED-> \Everyone
ALLOWED-> NT AUTHORITY\SYSTEM
ALLOWED-> NT AUTHORITY\INTERACTIVE

LAUNCH AND ACTIVATION PERMISSIONS:

ALLOWED-> NT AUTHORITY\SYSTEM
ALLOWED-> BUILTIN\Administrators
ALLOWED-> NT AUTHORITY\SYSTEM
ALLOWED-> \Everyone
ALLOWED-> NT AUTHORITY\INTERACTIVE

IDENTITY SETTINGS

Running as a: Service
Identity is set to: System Account
AuthenticationLevel : Default

From the Window 2003 R2 machine that has issues:


////////////////////////////////////////////////////////////////////////////////////////////////////////////
**************************************** DCOM Settings *******************************************************
////////////////////////////////////////////////////////////////////////////////////////////////////////////


Default Access Permission list:

ALLOWED-> BUILTIN\Administrators
ALLOWED-> NT AUTHORITY\ANONYMOUS LOGON
ALLOWED-> \Everyone
ALLOWED-> NT AUTHORITY\SELF
ALLOWED-> NT AUTHORITY\SYSTEM
Error retrieving Default Access Permissions

Default Launch and Activation Permission list:

ALLOWED-> NT AUTHORITY\SYSTEM
ALLOWED-> NT AUTHORITY\INTERACTIVE
ALLOWED-> BUILTIN\Administrators
ALLOWED-> NT AUTHORITY\ANONYMOUS LOGON
ALLOWED-> \Everyone
Error retrieving Default Launch Permissions


		General Properties of DCOM Application : OPC Indramat Server Version SCP 3.0


ACCESS PERMISSIONS :

Using Default Permissions

LAUNCH AND ACTIVATION PERMISSIONS:

Using Default Permissions

IDENTITY SETTINGS

Running as a: Application
Identity is set to: Launching User
AuthenticationLevel : Default


		General Properties of DCOM Application : OpcEnum


ACCESS PERMISSIONS :

ALLOWED-> NT AUTHORITY\SYSTEM
ALLOWED-> NT AUTHORITY\SELF
ALLOWED-> NT AUTHORITY\ANONYMOUS LOGON
ALLOWED-> \Everyone

LAUNCH AND ACTIVATION PERMISSIONS:

ALLOWED-> NT AUTHORITY\SYSTEM
ALLOWED-> BUILTIN\Administrators
ALLOWED-> NT AUTHORITY\INTERACTIVE
ALLOWED-> NT AUTHORITY\ANONYMOUS LOGON
ALLOWED-> \Everyone

IDENTITY SETTINGS

Running as a: Service
Identity is set to: System Account
AuthenticationLevel : None


		General Properties of DCOM Application : OPC Server for IndraLogic 1.61  ( 1, 61, 238, 3)


ACCESS PERMISSIONS :

Using Default Permissions

LAUNCH AND ACTIVATION PERMISSIONS:

Using Default Permissions

IDENTITY SETTINGS

Running as a: Application
Identity is set to: Interactive User
AuthenticationLevel : Default


		General Properties of DCOM Application : Studio Scada OPC Server


ACCESS PERMISSIONS :

Using Default Permissions

LAUNCH AND ACTIVATION PERMISSIONS:

Using Default Permissions

IDENTITY SETTINGS

Running as a: Application
Identity is set to: Interactive User
AuthenticationLevel : Default


		General Properties of DCOM Application : OPC Indramat Server Version SCP 3.0


ACCESS PERMISSIONS :

Using Default Permissions

LAUNCH AND ACTIVATION PERMISSIONS:

Using Default Permissions

IDENTITY SETTINGS

Running as a: Application
Identity is set to: Interactive User
AuthenticationLevel : Default


		General Properties of DCOM Application : MatrikonOPC Server for Simulation and Testing


ACCESS PERMISSIONS :

ALLOWED-> NT AUTHORITY\SYSTEM
ALLOWED-> NT AUTHORITY\SELF
ALLOWED-> NT AUTHORITY\SYSTEM
ALLOWED-> \Everyone
ALLOWED-> NT AUTHORITY\INTERACTIVE

LAUNCH AND ACTIVATION PERMISSIONS:

ALLOWED-> NT AUTHORITY\SYSTEM
ALLOWED-> BUILTIN\Administrators
ALLOWED-> NT AUTHORITY\SYSTEM
ALLOWED-> \Everyone
ALLOWED-> NT AUTHORITY\INTERACTIVE

IDENTITY SETTINGS

Running as a: Service
Identity is set to: System Account
AuthenticationLevel : Connect

This is the error:

com.jniwrapper.win32.com.ComException: COM object method returns error code: 0x8000401A; The server process could not be started because the configured identity is incorrect. Check the username and password.
com.jniwrapper.win32.com.ComException.checkResult(SourceFile:172)
com.jniwrapper.win32.com.ComFunctions.coCreateInstanceEx(SourceFile:230)
com.inductiveautomation.opccom.COMServerImpl$ConnectServerJob.internalRun(COMServerImpl.java:719)
com.inductiveautomation.opccom.wrapper.OleJob.run(OleJob.java:50)
com.jniwrapper.win32.MessageLoopThread$ThreadSynchronizedAction.run(MessageLoopThread.java:585)
com.jniwrapper.win32.MessageLoopThread$LoopThread.run(MessageLoopThread.java:527)

Attached are the full Matrikon Analyzer folders for each install

Thanks

Dennis
2012-11-09-14.28.02-MODICON.zip (63.7 KB)
2012-11-09-14.44.37-TNPLCSUPPORT.zip (2.12 MB)