0% found this document useful (0 votes)
119 views

Tech Note 765 - Implementing Block Reads Using The OPCClient Object

Uploaded by

Chau
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views

Tech Note 765 - Implementing Block Reads Using The OPCClient Object

Uploaded by

Chau
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Implementing Block Reads Using the OPCClient Object

Tech Note 765


Implementing Block Reads Using the OPCClient Object

All Tech Notes, Tech Alerts and KBCD documents and software are provided "as is" without warranty of any kind. See the Terms of Use for more information.

Topic#: 002544
Created: March 2011

Introduction
The OPCClient object is a DeviceIntegration (DI) object that allows access to a running OPC Data Access (DA) Server. An OPCClient object supports the following
operations on I/O points for the OPC DA Server:

Subscriptions, which are implemented via scan groups.

Read transactions, which are implemented via block reads.

Write transactions, which are implemented via block writes.

This Tech Note describes implementing Block Reads.

Note: This Tech Note assumes you have a basic understanding of Wonderware Application Server and DAServers. You should also be familiar with OPC
communications. For information about OPC communications, see Tech Note 761 OPC Connections at a Glance.

Application Versions
Wonderware Application Server 3.1 and later

Block Read Description


A block read is a set of user-defined attributes for which you want to retrieve values in a single transaction. Instead of the I/O points being on advise, as with a
scan group, the attributes are updated once per transaction. A block read must be initiated from a user or script via the BlockRead.TransactionTrigger attribute.

For this Tech Note, we create a basic configuration that performs a block read from a local MBTCP DAServer via the OPCClient object.

Set Up a Basic Galaxy


Follow the steps below to create a basic galaxy and objects required for this technote:

1. Open the IDE and create a Galaxy.

2. Create an instance of the $WinPlatform object called Platform.

3. Create an instance of the $AppEngine object called Engine.

4. Create an instance of the $OPCClient object called OPC.

5. Create an instance of the $Area object called Area.

6. Create an instance of the $UserDefined object called Tags.

7. In Deployment view, arrange the object instances as follows:

file:///C|/inetpub/wwwroot/t002544/t002544.htm[4/1/2011 10:39:26 AM]


Implementing Block Reads Using the OPCClient Object

FIguRe 1: OBJect ARRangeMent In DepLoYMent VIeW

Configuring DASMBTCP

Note: This Tech Note assumes you have a basic understanding of a DAServer and can configure the DAServer to communicate to a PLC.

To configure DASMBTCP

1. Open the SMC.

2. Navigate to DASMBTCP in the DAServer manager section.

3. Create a port object called Port.

4. Create a PLC object called PLC.

5. Configure the PLC object to communicate to a PLC.

file:///C|/inetpub/wwwroot/t002544/t002544.htm[4/1/2011 10:39:26 AM]


Implementing Block Reads Using the OPCClient Object

FIguRe 2: PLC OBJect CoMMunIcatIon SettIngs

Configure the OPCClient object


1. Open the OPCClient object called OPC.

2. Under the General tab, select the Server name.

3. For this example, the Server name is ArchestrA.DASMBTCP.2. Leave all other default attribute settings.

file:///C|/inetpub/wwwroot/t002544/t002544.htm[4/1/2011 10:39:26 AM]


Implementing Block Reads Using the OPCClient Object

FIguRe 3: GeneRaL TaB SeRveR NaMe and DefauLts

4. Click the Block Read tab.

This is where we enter the block of PLC addresses that we want to read in a single transaction.

For this example, we will read addresses 400001, 400002, 400003, 400006, 400008, and 400200. We will also assign an attribute to each register.

file:///C|/inetpub/wwwroot/t002544/t002544.htm[4/1/2011 10:39:26 AM]


Implementing Block Reads Using the OPCClient Object

FIguRe 4: BLocK Read AddResses

Note: Although a Scan Group is not required for Block Reads, go to the "Scan Group" tab and enter a scan group. This will allow the saving of the OPC object
without any warnings.

Configure the UserDefined Object


1. Open the Tags UserDefined Object.

2. Create six analog Field attributes (Figure 5 below).

3. Provide each attribute with an input source that points to the six block read attributes as shown in the following table.

Field Attribute Name Input Source


Tag1 OPC.ReadPLC.Register1
Tag2 OPC.ReadPLC.Register2
Tag3 OPC.ReadPLC.Register3
Tag6 OPC.ReadPLC.Register6
Tag8 OPC.ReadPLC.Register8
Tag200 OPC.ReadPLC.Register200

file:///C|/inetpub/wwwroot/t002544/t002544.htm[4/1/2011 10:39:26 AM]


Implementing Block Reads Using the OPCClient Object

FIguRe 5: AnaLog FIeLd AttRIBute and Input SouRce

Test the Configuration


1. Deploy the Platform, Engine, Area, Tags and OPC objects. After all objects are deployed, open Object Viewer.

2. Add the following attributes to the watch list:

Tags.Tag1

Tags.Tag2

Tags.Tag3

Tags.Tag6

Tags.Tag8

Tags.Tag200

file:///C|/inetpub/wwwroot/t002544/t002544.htm[4/1/2011 10:39:26 AM]


Implementing Block Reads Using the OPCClient Object

OPC.ConnectionStatus (Displays the connection status between the OPC object and the OPC Server)

OPC.ReadPLC.TransactionTrigger (Write a "True" to trigger a block read)

OPC.ReadPLC.TransactionStart (Displays the time and date when the block read starts)

OPC.ReadPLC.TransactionEnd (Displays the time and date when the block read ends)

The Watch List window should look like Figure 6 (below).

FIguRe 6: WatcH LIst WIndoW WItH OPC AttRIButes

3. Trigger a block read by writing a True value to OPC.ReadPLC.TransactionTrigger.

file:///C|/inetpub/wwwroot/t002544/t002544.htm[4/1/2011 10:39:26 AM]


Implementing Block Reads Using the OPCClient Object

FIguRe 7: TRIggeR BLocK Read

If everything is configured correctly, the values are read from the PLC every time the OPC.ReadPLC.TransactionTrigger is set to True.

OPC.ReadPLC.TransactionStart and OPC.ReadPLC.TransactionEnd will display the transaction start and end date and times (Figure 8 below).

FIguRe 8: BLocK Read WItH TIMestaMps

G. Alldredge

Tech Notes are published occasionally by Wonderware Technical Support. Publisher: Invensys Systems, Inc., 26561 Rancho Parkway South, Lake Forest, CA 92630. There is also technical information on our

file:///C|/inetpub/wwwroot/t002544/t002544.htm[4/1/2011 10:39:26 AM]


Implementing Block Reads Using the OPCClient Object
software products at Wonderware Technical Support.

For technical support questions, send an e-mail to [email protected].

Back to top
©2011 Invensys Systems, Inc. All rights reserved. No part of the material protected by this copyright may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying,
recording, broadcasting, or by anyinformation storage and retrieval system, without permission in writing from Invensys Systems, Inc. Terms of Use.

file:///C|/inetpub/wwwroot/t002544/t002544.htm[4/1/2011 10:39:26 AM]

You might also like