SITEMAP   PRIVACY   JAPANESE
FAWEB
  JAPAN   HOME  |  Product  |  Support  |  Knowledge  |  Download  |  Sales  |  Company  |  Contact
opc

Advanced OPC
Inside MELSEC
Advanced OPC
Wonder World
You are Here : HOME > Knowledge Base > Advanced OPC BACK

It explains the method to update automatically by the use of the asynchronous mode though it is in the article before there are a synchronous mode and an asynchronous mode in OPC. When it is necessary to process a large amount of data at high speed, this method is effective.

Commentor
Commentor / R.Takeuchi


Operation of DataChange event in Advise mode
OPC Server keeps beginning reading the tag value registered at the demanded update cycle, and renewing internal cache data when ssuming "MyGroup.IsActive=True" after AddItem() is executed for OPC Server. The value read to the client is not returned, and at this point, it is necessary to call SyncRead or AsyncRead actively, and to acquire the value.

At this time, the response worsens considerably when the load is high because OPC Server is read according to the demand of the client while executing a usual reading cycle and will be processed by it.

As an ideal programming, is it method of writing necessary processing in the DataChange event that the call backing is done when the Advise mode is set as "MyGroup.IsSubscribed=True", and there is a change in the value.

Because the server does the polling of the tag that has been registered at the specified update cycle all, and notifies the client only tag with the change in the Advise mode, the system without useless processing at all can be achieved.

The handler of the DataChange event accompanies the following arguments in VB.

Public Sub Mygroup_DataChange(ByVal TransactionID As Long,_
     ByVal NumItems As Long, ClientHandles() As Long,_
     ItemValues() As Variant, Qualities() As Long, TimeStamps() As Date)

The code in which the transaction is identified returns to "TransactionID". For example, because the response event of this processing returns as "TransactionID=200" when "200" is specified for the second argument of AsyncRefresh, the event notification of the event notification by the value change or the refreshing demand can be identified.

The total of tag included in this event notification is returned to "NumItems", and it becomes the number of array elements of the following client steering wheel, the value, the quality flag, and time stamp.

Here, two of the methods of doing the change notification at the method and each reading processing that returns all tag with the change every update cycle in bulk are prepared for the generation timing of the DataChange event as for our OPC Server.


It the change notifies every update cycle in bulk.
For example, the reading processing divides into three times because it can access it up to 960 points or less by one communication in MELSEC-Q series when tag in 2000 points is registered from D1. The DataChange event is generated when assuming that there was a change in all data according to timing in which the third reading processing ends, and the change notification of 2000 point's worth is done at a time. It becomes easy to program the client because the event is generated only by one degree synchronizing with the reading cycle, and when a large amount of data is treated, the response might become bad.

DataChange


It the change notifies at each reading processing
On the other hand, the change notification can be generated at each reading processing. If it is the above-mentioned example, the change notification in 80 points is generated in 960 points and the 3rd times in the second times in the first time by 960 points. In this case, because the client is treatable of the previous reading one result while OPC Server reads and it is processing it, operation without uselessness can be done. However, some processing of the client becomes complex because data divides and it is returned.

DataChange


The system that treats a large amount of data of tens of thousands of points or more should unite a smart program by using a latter mechanism though the difference of operation like the above-mentioned ends consciously if it is a small amount of data.

The function being offered with OPC is made the best use of to its maximum, and it is light and is the one to want to construct the OPC client with the scalability.

BACK

Copyright © 1998-2006 TAKEBISHI Corporation All rights reserved.

FAWEB.NET
TAKEBISHI Corporation
29 Mamedacho Nishikyogoku Ukyoku Kyoto 615-8501, JAPAN
TEL: +81-75-325-2171 / FAX: +81-75-325-2273 fa-support@takebishi.co.jp