Sample OPC Client

 

The Sample OPC Client is used as a test case to debug servers and demonstrate some of the OPC capabilities. To open the Sample OPC Client from the Windows Start menu, select Programs > ICONICS Modbus > Ethernet OPC Server 3.6 > SampleOPCClient.

 

Sample OPC Client Screen

 

From the OPC menu, select Connect. The Select OPC Server dialog box appears showing all registered OPC servers, as shown below. Select your Modbus OPC Server and then click OK. This connects the OPC client to the Modbus OPC Server.

 

Select OPC Server Dialog Box

 

From the OPC menu, choose Server Status to view the OPC server status dialog box, shown in the figure below. The server status dialog box continuously updates the server start time, the time of last update, the current time, the number of groups, and the bandwidth for the selected server. Use this window to verify that the server is running and is connected to the OPC client. Click OK to close the server status dialog box.

 

Server Status Dialog Box

 

From the OPC menu, choose Add Item. The Add Item dialog box appears, as shown in the figure below. The Add Item dialog box displays the devices, data blocks, and data tags defined in the current server configuration. These are filtered by expression * and by Data Type. You can enter an access path, type, or select an item name, and choose the Data Type in which you want to view the requested tag. In the Browse Items list, select the device, group, and tag. The full name appears in the Item Name field. Click OK. The item appears as a Tag in the OPC Client window with updating data values. You can add more tags by repeating the steps described above.

 

Add Item Dialog Box

 

From the OPC menu, choose Group Parameters. This command displays the parameters of the group of tags.

 

Group Parameters for the Selected Server

 

The Update Rate determines how fast data are sent to the client (in milliseconds). The Active state (checked) initiates active communications between the client and the server. You can change the Active state or the Update Rate, for example, and click Apply to send changes to the server. If the group is not active, data are not sent to the client. You can choose to Disconnect from the OPC menu to restore all selections and to disconnect from the server.

 

While a client is connected to a server, you cannot exit the server or open new configurations in the server. You can modify the existing server configuration while client(s) are connected; however, you cannot delete any device or tag in use. For example, you can take a device offline or change a tag's scaling values without shutting down a client that may be controlling many devices.

 

Start another instance of the OPC client and make the same server connection as those defined in the first client instance. You can add items, change the group update rate and active states, and view the server status in each instance of the OPC clients independently of the other instances. For example, the number of groups is "1" in each client because each one only has one group.

 

The only way that one client affects another is through data and data changes. Make sure both clients are showing the same tag.

 

To write a value to an item or tag, highlight a tag in the client and choose Write Value to Item from the OPC menu. This allows you to write a value for the data item, as shown in the figure below. Enter a numeric value and click OK. The client displays the new value at the update rate defined above. The client writes the value typed in the Write Item Value dialog box to the correct item in the Group object. The method of writing data is determined by the Asynchronous check box. When data are written synchronously, the call to the server blocks until the operation has completed, which may take a long time. When data are written asynchronously, the call to the server returns quickly and the operation is carried out on another thread. When the write has finished, the client's advise interface is notified with the results.

 

Note: A client defined with a very slow update rate does not receive the value immediately.

 

Writing a Value to a Data Item

 

See Also

How the Client Connects to and Gets Data From a Server

Server Status and Group Parameters

Disconnecting the Client from the Server

OPC Server Runtime Module