opc test

Upload: marklmendoza

Post on 03-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Opc Test

    1/25

    Rockwell Software OPC Test Client Application

    Page 1 of 25

    Wednesday, July 10, 2013

    Rockwell Software OPC Test Client Application

    Version 1.1User Manual

  • 7/28/2019 Opc Test

    2/25

    Rockwell Software OPC Test Client Application

    Page 2 of 25

    Wednesday, July 10, 2013

    Table of Contents

    INTRODUCTION .............................................................................................................................. 3

    LICENSE .......................................................................................................................................... 4

    GETTING STARTED ....................................................................................................................... 6

    SETTING UP THE SERVER................................................................................................................ 6CONNECTING TO THE SERVER ......................................................................................................... 6ABOUT THE SERVER VIEW............................................................................................................... 7CREATING A GROUP........................................................................................................................ 7CONNECTING TO AN ITEM ................................................................................................................ 9REMOVING AN ITEM....................................................................................................................... 10REMOVING A GROUP..................................................................................................................... 10DISCONNECTING FROM A SERVER.................................................................................................. 10

    IN DEPTH LOOK AT FUNCTIONALITY ....................................................................................... 11

    SERVER OBJECT........................................................................................................................... 11GROUP OBJECT............................................................................................................................ 12ENUMOPCITEMATTRIBUTES OBJECT............................................................................................. 14

    ADVANCED MECHANISMS ......................................................................................................... 15

    MMIEMULATION MODE ................................................................................................................ 15GROUP EVENTS............................................................................................................................ 16LOG VIEWER................................................................................................................................. 17ITEM VIEW COLUMNS .................................................................................................................... 19

    FILE MANAGEMENT .................................................................................................................... 21

    OPENING A FILE............................................................................................................................ 21EDITING THE CSVFORMAT FILE.................................................................................................... 21THE FILE FORMAT FOR THE TEST CLIENT ....................................................................................... 21

    INDEX ............................................................................................................................................ 25

  • 7/28/2019 Opc Test

    3/25

    Rockwell Software OPC Test Client Application

    Page 3 of 25

    Wednesday, July 10, 2013

    INTRODUCTIONRockwell Software has provided this program for the purpose of testing OLE for ProcessControl (OPC). Specifically, this clients primary focus is to test the implementation ofthe 1.0a specification on servers created with the RSServer OPC Toolkit. The goal for

    this program will be to use the entire OPC interface and enable the user to test theirserver for compliance to the spec.

    This manual will detail the functional behavior of the RSOPC Test Client, specifically withregards to its implementation of the OPC 1.0a version of the specification. At the time ofwriting, the RSOPC Test Client only implements the required interfaces from the OPC1.0a specification.

    This manual assumes minimalfamiliarity with OPC. It is not intended to be a rewrite ofthe OPC specification.

    This is an additional tool for the RSServer OPC Toolkit. It is not redistributable ortransferable. Please refer to your license agreement in your toolkit documentation formore information on redistributable files.

  • 7/28/2019 Opc Test

    4/25

    Rockwell Software OPC Test Client Application

    Page 4 of 25

    Wednesday, July 10, 2013

    LICENSE

    GRANT OF LICENSE

    Rockwell Software Inc. ("RSI") and its third party licensors grant to you a non-exclusive license to install and use

    the software programs in this package (collectively referred to as the "Software") on either: (a) a single computer, or

    (b) a network server for access by one user, by way of terminal or computer attached to the network server. Should

    you choose to install the Software on additional computers, or increase user access via a network server, you must

    first acquire a license for each additional user who will use the Software, with the understanding that at any one

    point in time (and regardless of the number of media sets included with the Software), the number of users who are

    permitted to use the Software may not exceed the number of single-user licenses you have acquired.

    If this Software is an upgrade from a previous version of an RSI product, you may not transfer the prior version to

    another user. This Agreement supersedes any prior license with respect to your use of the Software.

    Any attempted sublicense, rental, sale, or lease of the Software is prohibited. However, you may transfer your rights

    to use the Software on a permanent basis, provided: (1) you transfer this Agreement, the Software, and allaccompanying written materials and retain no copies; (2) the recipient agrees to the terms of this Agreement; and (3)

    you first notify RSI in writing of the date of transfer and the recipient's full name and address. This Agreement will

    automatically terminate without notice to you if you fail to comply with its terms.

    The Software and the accompanying documentation are copyrighted. Unauthorized copying, reverse assembly,

    reverse engineering, decompilation, and creating derivative works based on the Software are prohibited. You may

    not make copies of the Software except that you may install the Software into permanent memory of a single storage

    device provided you keep the original media solely for backup or archival purposes. You may not copy the

    accompanying documentation. Ownership and title to the Software is retained by RSI or its licensors, as applicable.

    You may not use this software to develop a software product that configures or communicates to any Rockwell

    Automation Network Product or any Rockwell Automation Devices, including but not limited to Programmable

    Controllers, I/O Devices / Systems, Numerical Controllers, Motion Controllers, and Operator Interface Devices.

    LIMITED WARRANTY

    The Software is warranted for ninety days after it is delivered to you that it will conform with the accompanying

    documentation supplied by RSI at the time of delivery. Defective media will be replaced without charge if returned

    during the warranty period. This warranty shall be void if you attempt to modify the Software. RSI makes no

    representation or warranty, express or implied, that the operation of the Software will be uninterrupted or error free,

    or that the functions contained in the Software will meet or satisfy your intended use or requirements; you assume

    complete responsibility for decisions made or actions taken based on information obtained using the Software.

    THE LIMITED WARRANTY IN THIS AGREEMENT IS IN LIEU OF ALL OTHER WARRANTIES, EXPRESS

    OR IMPLIED, INCLUDING (WITHOUT LIMITATION) ANY WARRANTIES OF MERCHANTABILITY OR

    FITNESS FOR A PARTICULAR PURPOSE. ROCKWELL SOFTWARE INC. AND ITS LICENSORS SHALLNOT BE LIABLE FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST SAVINGS, OR OTHER

    INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF YOUR USE OR INABILITY TO USE

    THE SOFTWARE, EVEN IF RSI OR ITS RESELLER HAVE BEEN ADVISED OF THE POSSIBILITY OF

    SUCH DAMAGES.

    This warranty gives you specific legal rights, and you may also have other rights which vary from jurisdiction to

    jurisdiction. Some jurisdictions do not allow the exclusion or limitation of liability for incidental or consequential

    damages, or the exclusion of an implied warranty, so the above limitation or exclusion may not apply to you.

  • 7/28/2019 Opc Test

    5/25

    Rockwell Software OPC Test Client Application

    Page 5 of 25

    Wednesday, July 10, 2013

    LIMITATION OF REMEDIES

    RSI's entire liability and your exclusive remedy shall be:

    1. The replacement of the Software not meeting the Limited Warranty specified above which is returned with proof

    of purchase; or

    2. If RSI is unable to deliver replacement Software which meets the Limited Warranty specified above, RSI or its

    reseller will refund your purchase price. IN NO EVENT SHALL RSI's LIABILITY TO ANY PARTY EXCEED

    THE PURCHASE PRICE OF THE SOFTWARE.

    OTHER PROVISIONS

    This Agreement shall be governed by the laws of the State of Wisconsin. This Agreement is the complete and

    exclusive agreement between RSI and you, and supersedes all prior agreements, whether written or oral, relating to

    the Software provided in this package and the accompanying documentation. This Agreement may not be changed

    or modified except by an instrument in writing signed by a duly authorized representative of RSI.

  • 7/28/2019 Opc Test

    6/25

    Rockwell Software OPC Test Client Application

    Page 6 of 25

    Wednesday, July 10, 2013

    GETTING STARTEDIf you are somewhat familiar with what went into DDE implementations for processcontrol, then most of the aspects of OPC should seem relatively similar from a generalperspective.

    The key differences come in the implementation. OPC uses Microsoft's COM(Component Object Model) technology to enable high-speed movement of control data.This is the same base technology Microsoft uses for ActiveX, OLE, DirectX, and API'sthat use what are called interfaces. For more information on the basics of OPC, pleaserefer to the OPC Specification.

    To effectively use this client, it is recommended that the user have some familiarity withthe OPC Specification or some implementation thereof. There are many things thatwere not available in DDE that are now possible via OPC. These include improvedgroup and item management, as well as the ability to seamlessly enable the user to useremote servers using DCOM.

    Setting Up the ServerThe following steps must happen before the client can talk using OPC:

    The OPC Proxy / Stub (opcproxy.dll) must be registered locally on the machine.This can be accomplished by running the following: regsvr32 opcproxy.dll. If theDLL is not in the appropriate system directory, you should include the path in thefilename.

    Register the data server. (Information to do this should have been provided withthe software package that allows users to upgrade using the toolkit. Other nativeOPC servers will need to be self-registered using the "/regserver" command lineargument.)

    Connecting to the Server

    Selecting the Server

    Connecting to a server is the first thing a user must do before he/she can startcommunicating with it. In the client application, select Server: Connect from the menu.This will bring up a dialog similar to the one shown. If the server is properly registeredas an OPC server, the ProgID of that server will appear in the list box. If it did not, eitherthe server is not properly registered, or you can enter the ProgID in the text box belowthe list box.

    Node Name (optional)The optional node name is for using DCOM. If the server is on a remote machine, thename of that machine can be entered here. Unlike NetDDE, there is nothing special forusing OPC over a network. Entering the node name here is sufficient to talk with aremote server. If the server you want to talk to be local to this machine, you should leavethis field blank.

    After selecting or typing in the ProgID (and node name), the dialog box will disappear,and the client will try to connect to the server. When the server view (3-way split view)

  • 7/28/2019 Opc Test

    7/25

    Rockwell Software OPC Test Client Application

    Page 7 of 25

    Wednesday, July 10, 2013

    appears and the waiting cursor goes away, you are connected to the server. If the waitcursor goes away and the server view goes away too, then there has been a problemconnecting to the server. Improved logging and error handling will make these problemseasier to debug in the future.

    To adequately test the implementation of your server, you should definitely trystarting the application both locally and remote from the client. What this means is

    that by only calling up the client and attempting to attach to your server, the servershould automatically launch. The only way this wont work is by using DCOM tolaunch a server residing on a Windows95 server. Please see the Microsoftdocumentation regarding the implementation of DCOM under Windows95,

    especially those sections concerning using the operating system as a server.

    About the Server ViewThe server view is the heart of the whole program. From here, most of the operationsthat can be performed through OPC can be directly tested.

    Group ViewThe group view is the frame in the top-left corner of the server window. From this view,group based-operations can be performed.

    Item ViewThe top-right view is the item view. This displays the information concerning individualitems in a selected group.

    Log View

    The log view is in the bottom panel of the server view. This pane shows events that

    have occurred in the client. It is included for diagnostic purposes.

    The View Timer

    Views are updated on a timer basis. That timer can be configured under the "View |View Update Timer" menu. This value is set in milliseconds. The reason for this is thatfor optimization purposes, the screen should not redraw on the server or other entityupdating the client. This could steal valuable processor time faster than we intended,possible causing us to lose control of the GUI. This timer keeps those processorintense, non-OPC related updates in check.

    If you want to see item changing quickly, set the timer low. If you want optimalperformance, set it to 250ms or better.

    Creating a GroupTo connect to a group, first select the group item on the menu. A popup menu shouldappear. Select add group. This will display the dialog shown.

  • 7/28/2019 Opc Test

    8/25

    Rockwell Software OPC Test Client Application

    Page 8 of 25

    Wednesday, July 10, 2013

    Group Name

    The group name is a client-defined string that is used to maintain a logical group of items.The items in this group all share the same poll-rate (see below), as well as several otherattributes that will be described below.

    This name is completely arbitrary and can be defined as anything. A group can also be

    an empty string, in which case, the server will provide a group name for the client.

    The only limitation is that each group name must be unique to the server object. Forexample, you cannot have two groups of the same name in a single group view. Anattempt to do so will result in an error. You can however have two groups of the samename on different clients.

    Update Rate

    This is a client-requested poll rate. What this will do (in the case of the toolkit) is throttlethe rate at which the client can be updated. The server itself may poll and post datamuch faster, but the client will not get data any faster than the poll rate supplied by thegroup.

    The server will return an actual poll rate, which is displayed with the group in the groupview. The server returns this poll rate to indicate that based on the requested poll rate,this is the fastest the server will send data. (Note: this rate should never be faster thanthe rate requested.)

    Time Bias

    The offset for the server for the time stamp returned with the data.

    This feature is not used in the RSServer OPC Toolkit 2.0.

    % Deadband

    Deadband is an ordinal between 0 and 100 that dictates the amount of change that isallowed between the last value and the current one. The server only provides data tothe client if the data has changed outside of this percentage.

    This feature is not used in the RSServer OPC Toolkit 2.0.

    Advise (Check box)

    The advise option allows the group to use an IAdviseSink to get data backasynchronously from the server. This interface is used for all asynchronous returns fromthe server. This includes asynchronous reads, asynchronous write completenotifications, and item subscription data.

    Active (Check box)This flag advises the server to send data continuously (throttled by the update rate) usingthe IAdviseSink. Without the advise flag set, the active state is useless, as it will ask theserver to send data, but there is no place for the data to be returned.

    An item can be advised on without being active. This would be a case whereasynchronous IO would be implemented.

  • 7/28/2019 Opc Test

    9/25

    Rockwell Software OPC Test Client Application

    Page 9 of 25

    Wednesday, July 10, 2013

    Allow Timeout (Check box)

    This enables and disabled a 10-second timeout on asynchronous calls to theIOPCAsyncIO interface of the OPC server. After 10 seconds, the client will call cancelon that specific transaction that was not returned to through the IAdviseSink. Thisaffects read requests and write requests.

    Connecting to an ItemAn item is an identifier to a specific piece of data that a user can request operations on.It is the smallest symbolic representation of the data without referring to the data itself.

    Access Path

    The access path is an OPC implementation that would dictate the route that a servershould take to get to the data requested.

    In the case of data servers upgraded from DDE using the RSServer OPC Toolkit, theaccess path is equivalent to the topic.

    Item ID

    The item ID is a server-implemented string that pertains to the specific piece of data theuser is requesting. This is usually a string of a specific format or a tag-name thatcorrelates directly to data.

    Active

    This flag sets this item to an active state. This is similar to the active state on a groupbasis, where this item is requesting to be updated all the time, not on a client pull basis.

    Datatype

    This is the format that the client is requesting the items data to come back in from theserver. This is not necessarily how the client will display it, as the client will just parsethe data type from the variant that was given it by the server.

    If the datatype is invalid (i.e. array of more than 1 on a single item with a canonicaldatatype of VT_I2), the server will return an error and NOT add the item. There are alsotimes when the server will return a canonical datatype different from the requested one.The server will add the item and make the proper conversions to send the data in therequested format.

    ArrayThis flag tells the server that the data is in an array format. The client does the somewith this as the requested data type.

    Add ItemYou can add multiple items at once. Clicking on "Add Item" will add a logical item intoyour item list. If you find that you have to many, or didn't want to ad one of them, changethe item name to a blank, and the client will not request that item to be added.

  • 7/28/2019 Opc Test

    10/25

    Rockwell Software OPC Test Client Application

    Page 10 of 25

    Wednesday, July 10, 2013

    Validate

    A user can validate an item with the server, get it's canonical datatype, etc. withoutadding the item. This is called a "Validate". The server immediately returns informationabout all of the items in question. For this client, all the items will be queried on. Theinformation is displayed in the dialog that results. If the server can't get any informationon the item, it will display an error next to the requested item name.

    Removing an ItemHighlight all of the requested items to be removed and select "Remove item" from eitherthe drop-down menu under "Item", or use the right-mouse button menu.

    Removing a GroupTo remove a group from being monitored by the client, simply highlight it in the groupview, then select remove group from the group menu. It will disconnect.

    Disconnecting from a ServerTo disconnect from a server, use the close button for the server view. This willdisconnect all items and groups first. It will then close the server connection.

  • 7/28/2019 Opc Test

    11/25

    Rockwell Software OPC Test Client Application

    Page 11 of 25

    Wednesday, July 10, 2013

    IN DEPTH LOOK AT FUNCTIONALITYThese tests assume that the tester has already connected with the server. Forinstructions on connecting with an OPC server, see section 0 above.

    Server ObjectThe server object is the object that embodies the OPC servers attributes. From thisobject, one can create group objects that actually access the data for the client. Settingup and testing all of the features of the server object is critical to ensuring that your serveris compatible.

    IOPCServer Interface

    The server object only has one required interface, IOPCServer. From this interface, onecan add groups, get an OPC error string, inquire about an existing group, get the statusof the server, remove a group, and create a group enumerator (discussed below). This

    is the only required interface for an OPC server. Any other interfaces supported may ormay not be part of the OPC specification, depending on how the developer implementedthem. Other optional interfaces that are a part of the OPC specification will beaddressed in future versions of the OPC Test Client.

    Add a Group

    This feature was discussed in section 0 above.

    Get Error String

    Select Server | Get Error String from the menu. Doing this will popup a display of thestring that were obtained from the server. These were all queried before the dialog wasdisplayed. Please make sure all of the strings are correct. These strings could be usedfor error reporting or systems alarming.

    Get Group by Name

    Select Server | Get Group by Name from the menu. This will display a dialog box thatcontains a drop-down combo box with the names of all the groups on the server shown.By using this valid name, one can query for an interface and see if the group really isvalid. By clicking on the Test button, the client will query the server with that stringcurrently displayed in the combo box.

    More functionality should be added in the future to this feature, like the ability to ask foran invalid name, etc.

    Get Status

    Select Server | Get Status from the menu. This will display a dialog that will contain theinformation obtained from the server. This information includes: The vendor information,the version number of the server, the current state (see the OPC Spec for meaning), thenumber of groups currently in use on the server, the bandwidth (-1 if unimplemented), thetime the server started, the current time (on the server), and the time the last update wassent for any item on the server.

  • 7/28/2019 Opc Test

    12/25

    Rockwell Software OPC Test Client Application

    Page 12 of 25

    Wednesday, July 10, 2013

    Remove Group

    Select a group from the group list. Select Server | Remove Group from the main menuor Remove Group from the right-mouse button menu. This will ask the server to removethe group. If the function succeeds, the client will destroy all information it had about thegroup including any items regardless of state.

    Create Group Enumerator

    The OPC specification includes a couple of different ways that an enumeration list can begenerated. The Test Client implements this list in a top-down fashion. That is, theprevious function is never called in this implementation of the test client, but this maychange in the future.

    To start playing with the group enumerator, click on the menu item Server : GroupEnum.This will pop up a dialog with several different options.

    The top combo box includes all the different scopes that can be used to get items. Thislist is compliant to the 1.0a specification. These options include:

    All groups (whether connected to or not)

    All public groups (whether connected to or not)

    All private groups (whether connected to or not)

    All groups connected to by the client (DEFAULT)

    All public groups connected to by the client

    All private groups connected to by the client

    Group ObjectThe group object contains all of the functionality needed to manipulate the group objectitself, all items that are associated with the group, as well as the ability to do a host of

    other functions.

    Group StateThe group state can be obtained in several ways, but the easiest is to double-click on thegroup name in the group view. All information if The state displays valuable informationabout the group, including the name, update rate, active state, time bias, deadband,location ID, and client and server handles. From this dialog, the user can edit thevalues, and have the server adopt those values by clicking on OK, or Apply. The clientwill query the server again to get the updated values.

    Subscription UpdatesA subscription is basically having an active item on an active group with an advised dataobject. In other words, this means that and will constantly receive data on an item. Theclient will be updated every time the item changes. This includes state information, aswell as the actual data itself.

  • 7/28/2019 Opc Test

    13/25

    Rockwell Software OPC Test Client Application

    Page 13 of 25

    Wednesday, July 10, 2013

    Synchronous Reads and Writes

    Synchronous operations are functions that return with the data requested. Thesefunctions block other calls until the synchronous call returns. OPC's synchronousoperations on the group object are the read and the write.

    A read is performed by selecting/highlighting the desired item(s), and using the menu to

    read the item. The check in the menu tells you that you are reading from cache, a lackof one tells you are reading from device. The returned values are displayed in the "Syncvalue" column.

    A write can be performed on a group of items by selecting them in the item view, andselecting the Sync Read operation from the Item menu of the item view right-mousemenu. Values and DataTypes may be selected and changed in this dialog. Once done,the user may click on OK to send the data to the server. The function will return with thestatus of the attempt to write the items.

    Asynchronous Interface Calls

    Asynchronous operations are function calls that are made, but the expected reply does

    not return from the function call directly. Instead, the intended data returns in acallback-style function. This ensures optimal performance of the application.

    OPC's asynchronous function calls include read, write, refresh and cancel.

    A read is performed by selecting/highlighting the desired item(s), and using the menu toread the item. The check in the menu tells you that you are reading from cache, a lackof one tells you are reading from device. The returned values are displayed in the"Async value" column.

    A write can be performed on a group of items by selecting them in the item view, andselecting the Async Read operation from the Item menu of the item view right-mousemenu. Values and DataTypes may be selected and changed in this dialog. Once done,the user may click on "OK" to send the data to the server. A write complete event willnotify the client the status of the attempt to write the items.

    If a read, write, or refresh operation is not completed within twelve seconds, the client willcall the server with a cancel request. (The cancel function is not available from the userinterface.)

    Item Management

    There are several things that a client can to do manipulate items on a server. Theinterface used for this is the IOPCItemMgt interface on the Group Object. In addition toadding and removing items to/from a server, the client can change client item handles,DataTypes, and active states for all of the items.

    Client HandlesThe item handle is an identifier used by a client to identify a particular item. This is anumber that could be a pointer, an array index, or a hash table key, for example. The"Change item handle" mechanism is a method of informing the server that from now on,the client will no longer refer to an item by the old handle, but by the new. No moreinformation should be received by the client regarding an item with the old client handle.

    In the test client, the client handle is equivalent to a pointer. This allows rapid lookup ofitem information from a server. (It just uses a type cast, really.) If we want to changethe object or structure that the handle for an item points to, we can use the change client

  • 7/28/2019 Opc Test

    14/25

    Rockwell Software OPC Test Client Application

    Page 14 of 25

    Wednesday, July 10, 2013

    handle to do that. For this pointer implementation, we create a copy of the item object,call change client handle with the new handle, and destroy the old object. No more callswill be made or received with the old item handle. The client wraps all of thisfunctionality for you, so changing the client handle involves nothing more than selectingthe items, select change handles from the menu, and clicking OK in the dialog box.

    Set datatype

    The client can set the requested datatype after the server has added the item. Thisallows the server to send the item in a different format

    Active state

    The active state of the item refers to the state of expecting to get data. An active itemshould receive data every time the value changes (outside of the deadband, and outsidethe

    Advising / De-Advising the group

    The group can be advised an de-advised by using the menu item available under thegroup and right mouse menus, labeled "Advise". When checked, the group has been"advised". There are actually two "advises" for each group. One receives subscriptionand asynchronous data. The other receives write complete information. When a groupis unadvised, both "advises" are removed. When "advised", then both are added. Theclient will also give the user the option to use time stamped format when the group isre-advised, so that the user can change formats.

    EnumOPCItemAttributes ObjectThe EnumOPCItemAttributes object is a simple object that supports only one interface.It is created on the group object and can be accessed by selecting "Enumerate Items"

    from the group menu.

    Enumerating Item AttributesWhen initialized, the "Enumerate Item Attributes" dialog will query the server for allavailable items. This will be done using repeated calls of increasing size using theFibonacci sequence, as with other enumerations in this application. (This enumerationwill not pass a negative number to the server.) This is done only to get the item namesto fill them into the item list in the dialog.

    The user can then select each item in the list to query its attributes. This is done byrequesting a single item in the enumeration by getting its remembered position in the list,and requesting that position from the origin in the enumeration. The results aredisplayed next to the item list.

    The "Clone" button will clone the item attributes interface and present an identical dialogthat the user can use to query attributes. These dialogs must be exited successively (orrecursively, if you will) as they are all "modal".

  • 7/28/2019 Opc Test

    15/25

    Rockwell Software OPC Test Client Application

    Page 15 of 25

    Wednesday, July 10, 2013

    ADVANCED MECHANISMSThe RSOPC Test Client has many extra "goodies" that aid in the testing of an OPCserver beyond the functional testing we discussed above. These goodies are tools thatallow the user to create common situations that a server might be used in so as to check

    for leaks, timing problems, and other anomalies.

    MMI Emulation ModeThe MMI emulation mode feature is designed to switch groups at periodic intervals,setting only the viewed group active. This gives the simulation of an MMI applicationchanging screens, using groups to activate and deactivate several items in one shot.

    How it worksThe user can set up an emulation based on a couple parameters. First, the user canelect to have only the viewed group active. This has the effect that as a new group is

    selected, all other groups are deactivated, and only the viewed one is made active.Secondly, the user can have the groups change which one is the view and active group.This will be done on a rolling basis.

    Configuration

    The configuration of the MMI emulation mode can be done from the server menu byselecting "MMI Emulation Mode". A dialog will appear on the screen presenting a set ofoptions. As described above, these options include: only the displayed group is active,enable the MMI emulation (automatically change screens) and the interval betweenscreen changes.

    All data from this configuration can be saved with the server information in the server lineof the CSV file.

    ProblemsAlthough there have not actually been reported problems, there may be difficultyremoving groups while the MMI emulation is running. Use with caution.

  • 7/28/2019 Opc Test

    16/25

    Rockwell Software OPC Test Client Application

    Page 16 of 25

    Wednesday, July 10, 2013

    Group EventsGroup events are timed operations that can happen on a group and the items containedin that group. These include read and write operations, as well as setting the activestate of a set of items. The operations can be performed on a single or multiple items.

    How it works

    Any given group can contain any number of events. Each event has a list of items thatthe operation can be performed on, the operation type, a name (which does not have tobe unique), and a timer value in milliseconds. When an event is initiated on a group, theevent triggers after the first timed event has completed. Then at every interval it willperform the operation again and again until the user removes the event, or removes thegroup.

    The reads work as follows in all situations: whenever a read event happens, the serverrequests the read in the desired way. For asynchronous, the client does not wait for a

    response before sending the next one.

    It should also be noted that asynchronous reads can supercede the subscriptionnotifications. That is, if an item is updated via subscription, and an asynchronous read isperformed, and the item does not change before the next scheduled subscriptionnotification, then the subscription will not be updated.

    For writes, the client posts an increment into the Fibonacci sequence {1, 1, 2, 3, 5, 8, 13,21, 34, ...} on each iteration of the event, and writes it to the item. This sequence is

  • 7/28/2019 Opc Test

    17/25

    Rockwell Software OPC Test Client Application

    Page 17 of 25

    Wednesday, July 10, 2013

    applied to all DataTypes, including strings and arrays. Each item in the array will begiven the next increment in the sequence. The sequencer built into the program isdisrespectful of datatype limitations, so there will be negative numbers written to the itemafter several iterations of the event. This ensures a nice mix of numbers sent to dataitems. (Note: For this reason, do not use this event to write to items like timer presets,as they may fault a processor, such as an Allen-Bradley PLC5.)

    The active state event toggles all items in the item list uniformly. That is, all items in thelist will be set active or inactive. The state of the items will always change on each eventthat occurs, hence the toggling effect.

    Configuration

    Event configuration can be set up by selecting the "Configure Events" item on the groupmenu. The resulting dialog will show a list of events on the group. Initially there will benone, so we will add one.

    Select Add Event to add a new event to the group. The shown dialog will appear inwhich we can set our event parameters. The first thing we can set is the name. Thiscan be any string. It is only a helpful reminder to the user what the event is. Secondly,

    we can set the time interval in milliseconds. This will be the time between each event'sstart. It does not relate in any way to the event's completion time. This is why it isimportant to configure your events carefully so as not to loose control of the userinterface. (See problems.)

    You can also select the type of event desired, discussed in the previous section. Thisdetermines what action will be performed on the items selected below. The user canalso elect to only have the operation performed when the group is active. This is anextension of the MMI emulation, so that only items in the active group will be operationsperformed on them. If this is not selected, the items will have the operations performedregardless of the active state of the group.

    Finally, in order for an item to have an operation performed on it, it must be highlighted inthe item list at the bottom of the dialog. All selected items at the time of hitting OK in the

    dialog will have the operation performed on them. Those that do not, will not have thatoperation performed.

    Group event configuration information is not saved to file at the time of writing.

    Problems

    There have been problems with removing an item in an event list. Although it is possibleto perform many events without items in the event list, this has not been thoroughly test,and is not recommended.

    It is also very possible to bog down an OPC server, or an entire machine with events.Adding a malicious event can cause the client to lose control of it's own user interface,making it impossible for the user to kill without using the operating system to kill the

    process. Things that can do this are fast events doing synchronous reads and writes todevice. Rockwell Software does not recommend using these except in cases where thedata must be guaranteed to get to the device.

    Log ViewerThe log viewer is a mechanism to view events and potential problems without disturbingthe normal operation of the OPC client, i.e. popping up a dialog box to show a problem.

  • 7/28/2019 Opc Test

    18/25

    Rockwell Software OPC Test Client Application

    Page 18 of 25

    Wednesday, July 10, 2013

    The logger is fully configurable, though incomplete in places. It takes care of mostevents that could be problematic to developers.

    How it worksWhen an event that the logger may be interested in occurs, the event is passed through

    several levels to get as much information as possible as to the context of the event.When the entire message is formulated, it is passed to the document which checksagainst a log filter. If the filter passes, the event is logged to the screen. The log on thescreen will be updated at the same rate as the item view, which by default is set at250ms.

    Log file support is not available at the time of writing.

    ConfigurationLogger configuration can be done through a dialog available from the menu by selecting"Configure Logger" from the "Log" menu. This sets up the simple filter that posts theevents to the screen. A check indicates that the item will be logged.

    The on-screen log can be cleared by selecting "Clear the log window" from the "Log"

    menu. (This does free up memory.)

    We have also enable the results to be logged to a file (and we persistently save both thefilter and logfile name as part of the OPC test client CSV File).

    Problems

    At the time of writing, not all events listed may be implemented

    At times, events may be cryptically logged with things like "HR=80040005", or somethinglike that. These are typically error codes or handles so one can keep track of events andresults as they happen.

    Because the logger logs the events to the screen, and that view is continuous it ispossible to eat up memory with the logger. Using the "clear" function as the log view fillscan avoid problems with running out of memory over long tests. (In long tests, the usermay want to only enable errors that will show the specific problem.)

  • 7/28/2019 Opc Test

    19/25

    Rockwell Software OPC Test Client Application

    Page 19 of 25

    Wednesday, July 10, 2013

    Item View ColumnsBy default, the user only sees a small subset of the number of columns that can bedisplayed in the OPC Test Client. This is to simplify the task of getting users up andrunning, and greatly simplifies the user interface. There are 15 columns that can bedisplayed in the item view. They are:

    ItemID The string identifier of the item.

    Access Path The access path associated with thisparticular item.

    Subscription Value The last value received via asubscription update.

    Subscription Quality The quality of the last update receivedvia a subscription update.

    Subscription Time The last time a subscription update wasreceived. Set only if the data object onthe group uses "timestamped" format.

    Subscription Updates The number of updates received viasubscription since the item was added tothe group.

    Asynchronous Value The last value received via anasynchronous read.

    Asynchronous Quality The quality of the last update receivedvia an asynchronous read.

    Asynchronous Time The last time an asynchronous read wasreceived. Set only if the data object onthe group uses "timestamped" format.

    Asynchronous Updates The number of updates received viaasynchronous read since the item wasadded to the group.

    Synchronous Value The last value received via ansynchronous read.

    Synchronous Quality The quality of the last update receivedvia an synchronous read.

    Synchronous Time The last time an synchronous read wasreceived.

    Synchronous Updates The number of updates received viasynchronous read since the item wasadded to the group.

    Update Rate The rate at which an item is receivingsubscription updates.

    Server Handle The handle (number) the server uses toidentify the item when the client requestsinformation. Useful for debugging.

    All of these columns can be added and removed from the item view. They are all validfields, depending on the condition of the item. Uninitialized data will be stated as suchand carry an "Uncertain" quality, and have an update count of 0. Otherwise, all the data

  • 7/28/2019 Opc Test

    20/25

    Rockwell Software OPC Test Client Application

    Page 20 of 25

    Wednesday, July 10, 2013

    is up to date with the last update received (accepting for the rate at which the clientupdates the screen.)

    Adding and Removing ColumnsColumns can be added and removed from view by selecting from the "View" menu the

    "Item Columns" menu item. This will display a dialog box that will show all visible andinvisible columns. A visible column may be removed by double clicking on its name in theenabled list. An invisible column may be added by double clicking on its name in thedisabled list. Although the columns may appear in any order in the dialog, they willalways appear in the order detailed above.

    Click on OK to accept, cancel to disregard the changes.

    Column information is not saved with the CSV file, and always initialized to the defaultview configuration.

    Expert Versus Non-Expert Mode

    There are two autonomous ways to look at the data in the item view. These are calledthe Expert and Non-Expert modes. They are selectable under the "View" menu, usingthe menu item, "Expert Mode". If this item is check, then the view is in expert mode. Ifnot, then the user is in Non-Expert mode.

    The differences in the views are that the Non-Expert mode (default) has wide columnsand only displays five of the available fifteen columns. Expert mode displays all thecolumns, and constricts the width to fit the maximum number on the screen. Both modescan have columns added and removed, widths changed, and all will be retained betweeneach mode. Other than that, there is no difference between these mode.

  • 7/28/2019 Opc Test

    21/25

    Rockwell Software OPC Test Client Application

    Page 21 of 25

    Wednesday, July 10, 2013

    FILE MANAGEMENTThe OPC Test Client supports a simple file type called CSV (comma separated values).Each value in the file is separated by a comma, unless the value contains a comma in it.In that case, the value will be contained in quotations, including the comma, with commas

    delimiting the value on the outside of the quotation marks.

    Opening a FileAs with most Windows programs, the OPC Test Client supports opening a file by usingthe OPEN:FILE menu command to display a common dialog for opening a file. The TestClient will support any file extension, provided that the contents of that file can beinterpreted as a CSV with the appropriate fields filled in. See below for details about thefile format.

    Editing the CSV Format FileEditing and saving your configuration for the OPC Test Client can be done either the inTest Clients own limited editor, or the more robust editor of a spreadsheet, such asMicrosoft Excel. OPC Test Client will read CSV files generated by Excel providedthey follow the file format rules given below. Make sure you enter values correctly, or itmay cause unpredictable behavior in the OPC Test Client.

    The File Format for the Test ClientThe OPC Test Client operates on what is called a CSV format, or comma separatedvalues format. Many other types of editors and programs are able to use this format, aswell as it is easy to read without the help of a special editor.

    An example CSV file, called SAMPLE.CSV should have been included with the OPCTest Client. This file contains an example of what a file would look like including fieldcomments. It can be easily viewed with Microsoft Excel.

    The following details the rules for building your own CSV files. Creating ones ownconfigurations files should never be done on a non-critical system and only by someonewho fully understands the file format.

    1 ServerProgID

    Node NumGroups

    ActiveDisplay

    MMIEnabled

    MMITime

    LogFilter

    LogFileName

    2 GroupOrdinal

    Name Rate Bias % Deadband

    TimeStamp

    Active Advise Timeout

    3 GroupOrdinal

    AccessPath

    Name Active Vartype

    Server LineThe server line is started with a 1 in the first column (no quotes). As of writing, therecan be only one server per file.

  • 7/28/2019 Opc Test

    22/25

    Rockwell Software OPC Test Client Application

    Page 22 of 25

    Wednesday, July 10, 2013

    Server ProgID (String)

    The Server ProgID is the simple string name given to a server through OLE. OLE canthen use this ID to lookup the servers global identifier (GID) to start talking with theserver.

    Node (String)The node name is the name of the computer on a given network that is to be connectedto by the OPC Test Client. Make sure that the client can connect to that externalresource before trying to connect to it with a large configuration file.

    If the server is on the local machine, this field is to be left blank.

    Number of Groups(Integer)

    This is the number of groups maintained on the server. Unlike other object counts in thisfile, this one is critical to be accurate, as it predetermines memory allocation in the testclient.

    Display Active Group (Boolean)

    If this field is set to "1", then only the selected group (displayed) will be active, and allothers will be deactivated.

    MMI Emulation Enabled(Boolean)

    If this field is set to "1", then only the selected group (displayed) will be active, and allothers will be deactivated, as per above configuration. In addition, the selected groupwill be rotated based on the number of seconds stored in the following field, MMI Time.

    MMI Emulation Time(Integer)

    This field contains the number of seconds between group changes when the MMIEmulation mode is active. If emulation is not active, then this field is irrelevant.

    Log Filter (DWORD)

    This field holds a set of high-assertion bits that are used for the log filter mechanism. Asthe use of this field may change with revisions of the test client, this field should not beedited. Omitting this field results in all events being logged in the default format. Thisbehavior is recommended.

    LogFileName(String)

    This field holds the logfile name where the logfile for the log mechanism is defined.

    Omitting this field results in all events being logged only to the looger window

    Group Line

    The group line is started with a number 2. There can be any number of groups on aserver. The only restriction is that the declaration of a group must come before the itemsthat use it.

  • 7/28/2019 Opc Test

    23/25

    Rockwell Software OPC Test Client Application

    Page 23 of 25

    Wednesday, July 10, 2013

    Group Ordinal (Integer)

    This (for the OPC Test Client) the most critical field in the group line. This field containsa 0-based integer to the array that will be built of your groups. This number must beunique. It must start at 0 for the first group. Each successive group must have thisordinal incremented by 1.

    An item will use this field as a reference point for the group that the items will be addedto.

    Name (String)

    The group name can be almost anything from a number to the third act of Hamlet(shouldyou be so inclined). This field will be interpreted as a string, so if the field containscommas, the field must be enclosed in quotation marks.

    Rate (Integer)

    This is the requested update rate. This rate will be truncated to the nearest quartersecond by the server in the revised update rate. This revised rate will the closest

    interval the client will be updated to by the server.

    Bias (Integer)

    This is the time bias field as shown in the group configuration dialog. It will give theserver an offset at which to send data to the client.

    Percent Deadband (Float 0.0 - 1.0)

    This is the percentage that an item can change without being updated by the server tothe client.

    Timestamp (BOOL)OPC offers a timestamp option for items that use an advise (a mechanism for beingcalled back). This timestamp is put on an item the last time the item was updated. Theclient can display this or use this for logging times on each item.

    Active (BOOL)

    This can be either a 0 or a 1. 1 = TRUE, and 0 = FALSE. If set to true, then the groupwill be set active and all the items in the group can updated on a continual basis.

    Advise (BOOL)

    As above, this field can be set to a 0 or a 1. If true, then the group will have an advise

    set up for it. This advise is capable of being called by the server to receive data.

    Timeout (BOOL)

    If true, the group will be able to timeout on asynchronous calls. As described in thegroup configuration, with the timeout enabled, the client will call the server with a cancelon outstanding transactions after at least 10 seconds after the calls have been made.

  • 7/28/2019 Opc Test

    24/25

    Rockwell Software OPC Test Client Application

    Page 24 of 25

    Wednesday, July 10, 2013

    Item Line

    The item line is started with a number 3. This item will be added to a group (all at once)after the file is finished loading. All items are able to be configured separately, but theymust each have a unique group. This is why it is a good idea to edit CSV files in anadvanced editor, such as Excel, when many data items are to be added per group.

    Group Ordinal (Integer)

    This is the unique identifier of a group given before the item is listed in the file. Itemsneed not be in any particular, as long as they follow the group they belong to. Thisordinal uniquely identifies the group the item is related to.

    Access Path (String)

    This is the access path that will be passed to the server for the given item. In legacypackages, this may be the same as a DDE topic. In other systems, it is often a hint asto where to go to get data for the item, such as a driver identifier.

    Name (String)

    This is the actual string name for the item. This must be a valid data point available tothe server. At this point (loading the configuration file), the access permissions to thatdata (read/write) does not matter.

    Active (BOOL)

    If this is set to true (1), then the item will be able to get data, provided that the group isactive and has an advise available to receive data. If all these conditions are met, thenthe item should be updated with data.

    Variant Type (VARTYPE)

    This is the decimal representation of a variant type. For example, an I4 (four byteinteger), which is 0x0004, would be simply 4. An array of four byte integers would be0x2004, or 8196.

    Examples of these data types can be easily generated by saving configurations from theTest Client.

  • 7/28/2019 Opc Test

    25/25

    Rockwell Software OPC Test Client Application

    INDEXDDE ................................................................... 6

    EnumOPCItemArrtibutes

    InterfacesIOPCEnumItemAttributes

    Clone .....................................................14Next .......................................................14Reset .....................................................14Skip .......................................................14

    Events ...............................................................16

    Configuration .................................................17Problems .......................................................17Types ............................................................16

    Files ..................................................................21

    Editing ...........................................................21Format ...........................................................21Open .............................................................21

    Group .......... 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18

    Active ............................................................. 8Deadband ...................................................... 8Enumerating ..................................................12IAdvise ........................................................... 8Interfaces

    IDataObjectDadvise .................................................14

    IOPCAsyncIOCancel ...................................................13Read......................................................13Refresh..................................................13Write ......................................................13

    IOPCGroupStateMgt

    GetState ................................................12SetName ...............................................12SetState ................................................12

    IOPCItemManagementAddItem .................................................10RemoveItem ..........................................10Validate .................................................10

    IOPCItemMgt ............................................13ChangeClientHandles ...........................13SetActiveState .......................................14SetDataTypes .......................................14

    IOPCSyncIORead......................................................13Write ......................................................13

    Name ............................................................. 8Removing ................................................10, 12State ..............................................................15Time Bias ....................................................... 8Timeout .......................................................... 9Update Rate ................................................... 8

    Group View ........................................................ 7

    Item ....................................... 9, 10, 13, 14, 17, 18

    Access Path ................................................... 9

    Active ............................................................. 9Add ................................................................13Array .............................................................. 9

    Asynchronous ...............................................14Data type ........................................................ 9DataType ......................................................14Enumeration ..................................................14Item ID ........................................................... 9Read .............................................................13Remove .........................................................13State ..............................................................14Subscription ............................................12, 14Write ..............................................................13

    Item View

    Columns ..................................................19, 20Expert Mode ..............................................20Types ........................................................19

    Item View ........................................................... 7Logging .............................................................18

    Configuration .................................................18Messages ......................................................18

    Logging .........................................................7, 18

    MMI Emulation ..................................................15

    Configuration .................................................15OPC

    DCOM ............................................................ 6Group ............................................................. 7Item ................................................................ 9Proxy .............................................................. 6

    Server ............................................................ 6Specification ................................................3, 6

    Rockwell Software

    RSServer OPC Toolkit ................................... 3Screen Timer...................................................... 7

    Server ......................................... 6, 10, 11, 12, 18

    Connecting to ................................................. 6Disconnecting................................................10Interfaces

    IOPCServer ...............................................11CreateGroupEnumerator .......................12GetErrorString .......................................11GetGroupByName .................................11

    GetStatus ..............................................11GroupAdd ............................................... 7RemoveGroup .......................................12

    Node .............................................................. 6Object ............................................................11ProgID ............................................................ 6Registering ..................................................... 6View ............................................................... 7

    Status ................................................................12