Client and Server Caching

<< Click to Display Table of Contents >>

Manual > Server Creation Guide > Interface > IPLink-Interface > IPLinkClient Library > Function Description >

Client and Server Caching

Client and Server Caching

The IPLink client library "ClientIPLink6.ocx" and the IPLink server each have their own independent cache.

 

The relationship between the server cache of the IPLink server and the client cache of the IPLink client library is shown in the diagram below.

 

c_interface_0127

There are four ways to read PLC data from an application using the IPLink client library via an IPLink server:

 

1) Get the value by using the value change event of the IPLink client library. An example of an actual event is the "ValueChanged" event.

 

②Get the value of the client cache held by the IPLink client library. Updates to the client cache are periodically obtained from the server cache in ⑤. To actually obtain values from an application via the IPLink client library, use the "ReadVal" method. To obtain values in this case, specify "0" for the parameter "DataSource" of the "ReadVal" method. Since the server cache is not read each time a value is read, the communication load between the client and server is reduced, but since it is updated at the update cycle of "NetworkParam", the data may not be the latest depending on the cycle.

 

③ Use the server cache of the IPLink server directly. In this case, specify "1" for the parameter "DataSource" of the "ReadVal" method. Since the server cache is read, the same value as on the IPLink server can be obtained, but communication is required each time the server cache is accessed for each read. However, the value can be obtained even if the automatic update between the client and server in ⑤ is stopped, so the communication load can be reduced.

 

④ The value is obtained by communicating directly with the PLC. In this case, specify "2" for the parameter "DataSource" of the "ReadVal" method. The PLC value can be displayed directly, but this places a communication load on all routes: client/server/PLC.

 

 

The server cache obtains and updates values from the PLC via communication ⑥ (the update cycle for ⑥ can be set in the folder properties of the connected PLC on the server side). Values from PLC can only be obtained for tags that have been registered using the "AddTag" method in an application that uses the IPLink client library. Registered tags can be read via route ③, as the server cache is updated. Unregistered tags cannot be read via routes ① to ③, and can only be read via route ④, as the server cache is not updated.

 

The client cache retrieves and updates values from the server cache via communication (⑤) (the update cycle (⑤) can be specified with "NetworkParam"). Values are retrieved from the server cache when the "CtlUpdate" property of the IPLink client library is True. During updates, if the value changes, each event (①) occurs, allowing asynchronous value retrieval.

You can also read values directly from the client cache using ②ReadVal(DataSource=0).

 

 

The table below shows the conditions and features of each reading method.

 

Communication Method

Features

AddTag

CtlUpdate

①Event

 

Obtaining values in events is suitable for monitoring. Communication for automatically updating the client cache is performed in a separate task from Visual Basic, so it does not interfere with the operation of Visual Basic.

 

However, since values are always retrieved from the server at regular intervals, the communication load between the client and server may become heavy if there are a large number of tags. In such a case, please adjust the update interval to be slower.

 

Registered

(Required)

True

(Required)

②Client cache value

 

The feature of retrieving values from the client cache is that it is the fastest way to process ReadVal. If you need a fast ReadVal response in Visual or Basic, we recommend using this method.

 

Registered

(Required)

True

(Required)

③Server cache value

 

Obtaining values from the server cache reduces the network load between the client and server because automatic updates between the client and server are not required. However, no events are generated when values change.

 

Registered

(Required)

False

(Recommended)

④Device Value

 

This method takes the longest processing time to obtain values. It forcibly requests the server to communicate with the PLC, which may affect other communications. However, since the actual results of communication with the PLC are returned for each request, it is possible to obtain the most recent device values.

 

In addition, when there are a large number of tags and communication frequency is low, the communication load between the server and PLC can be reduced. Therefore, this method is ideal for control that requires synchronization with a PLC or for batch-like communication.

 

No registration

(Recommended)

False

(Recommended)

 

By selecting from these four communication methods according to the system requirements and sometimes combining them, you can improve communication performance. On the other hand, please note that some combinations may result in a decrease in performance. For example, the combination of registering a tag as active, setting CtlUpdate to True, and communicating with ReadVal(DataSource=2) is the combination that results in the lowest performance.

 

 

hint

If you do not want to be aware of these communication methods, we recommend the following combination of settings.

■ Activate all tags.

■Set CtlUpdate to True.

■Get the value using ReadVal(DataSource=0) and the ValueChanged event.