Professional OPC
Development Tools

logos

The item is no longer available in the server address space

More
16 Apr 2014 13:04 #1853 by support
Connections are handled automatically inside QuickOPC, you only have limited control over them. QuickOPC establishes the connection when it is first needed, and then keeps the connection 1) when there are any active subscriptions, and/or 2) for some time after the last subscription has been removed, or the last operation such as Read or Write has been invoked.

So, to put it simply, unless you are subscribed to something, QuickOPC will disconnect if you are not calling Reads or Writes or the like - but only after a delay. The delay is called "a "Hold period", and currently defaults to several seconds. It exists for optimization purposes (it is not efficient to open/close connections too frequently). You can modify the hold period (it is in milliseconds) e.g. like this:
easyDAClient.HoldPeriods.TopicRead = 2*1000;

(in newer versions the HoldPeriods is a bit deeper in the parameter hierarchy - let me know if you do not fid it)

Also, what is the use case for your requirement, i.e. why do you want to explicitly disconnect? Is it related to your previous question? - do you want to do it so that the OPC server gets a chance to load a new configuration? If so, disconnecting may help, but it is not the right way to resolve the problem, because the responsibility of having the right configuration should be on the server side, plus there may be other clients connected, etc.

Please Log in or Create an account to join the conversation.

More
16 Apr 2014 09:32 #1851 by support
From: f....
Sent: Wednesday, April 16, 2014 9:59 AM
To: Zbynek Zahradnik
Subject: RE: OPC Labs Contact Form - OpcLabs.EasyOpc.OpcException

Dear Sir

Is it possible to disconnect and reconnect my opcserver within my .NET application.
Iám using OPC Classic ver 5.22

Thank you
Best Regards

F.

Please Log in or Create an account to join the conversation.

More
15 Apr 2014 07:34 - 15 Apr 2014 07:34 #1833 by support
This error is never generated directly by the client component. It comes from the OPC server, and it means that the ItemID that you have specified in your OPC client program is not understood by the OPC server. There can be various reasons for it, for example:
  • A mistake in your program, such as a typo.
  • Improper configuration of the OPC server.
  • A bug in the OPC server.
  • Somebody has changed the configuration of the server.
  • The server has not yet finished loading its configuration.

The ItemIDs (the OPC server address space) is assumed to be fairly static in the OPC world: That is, the validity/invalidity of ItemIDs should change only infrequently. The OPC client can reasonably expect that if the ItemID is invalid at one point, it makes no sense to try the same again immediately.

The primary way of your investigation should therefore be to figure out WHY the server is returning this error, and try to resolve it.

Next thing you need to know is the behavior of EasyDAClient with respect to these errors. When this happens, the EasyDAClient object considers the item invalid, and you won't be able to work with for certain period of time. By default, the period is quite long - 1 minute (in current QuickOPC versions 5.23, 5.30). There is a good reason for it: Imagine that you have a client configured to read e.g. 10,000 items, and somebody misconfigures the server. There will be 10,000 requests to the server, and they will all return an error: Not nice, but still OK. But, if the client decides to the same over in a quick succession, it would probably cause a performance network either on the client computer, or on the server computer, or on the components between (network). Hence the delay is necessary.

If, however, for whatever reason you want to make the delay shorter, you can do so by setting a different delay (in milliseconds) from your code, like this:
EasyDAClient.SharedParameters.Topic.TopicRetrialDelay = 15*1000;

Note that the "retries" are only performed in groups, by a periodic "background process", which defaults to be executing each 15 seconds (the corresponding parameter is TopicRetrialPeriod, which you can also change), and therefore the actual delay may be somewhat higher.

I hope this helps
Last edit: 15 Apr 2014 07:34 by support.

Please Log in or Create an account to join the conversation.

More
15 Apr 2014 06:57 #1832 by support
From: OPC Labs Contact Form - ...
Sent: Monday, April 14, 2014 4:28 PM
To: ...
Subject: OPC Labs Contact Form - OpcLabs.EasyOpc.OpcException

...
Dear sir


I am building a .NET application which is reading data from several plc stations connected by
an ethernet network.

The plc's are programmed in Codesys, so as an ops cerver i/am using WinCoDeSysOPC.

At the start of my apllication i very often have the following error message:

OpcLabs.EasyOpc.OpcException: OPC operation failure.
---> System.Runtime.InteropServices.COMException:
The item is no longer available in the server address space.


Mostly only from one station. (not always the same station)

I only can get rid of the error by restarting the application over and
over again. At some point it is working ok.

If i use another client e.g. the so called 'OPC Quick Client' (software toolbox) very often
an error occurs.
In the picture you see that for 'AlarmStationScr3' the application items are not visible.
(true your site i can not send this picture)
I think this causes in fact the same error as min my .NEt application
(e.g. The item is no longer available in the server address space)

If i give a so called 'Device Refresh' in my OPC Quick Client everything is working ok.
My .NET application is then working correctly. (OPC Quick Client is running)

Is there a method that i 'refresh' my devices within my application, or maybe
you have another remedy to solve this urgent problem.

Thank you in advance


Kind regards / Met vriendelijke groeten,

F.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.191 seconds

      

 Recommend this on Google