Sei sulla pagina 1di 25

Rockwell Software OPC Test Client Application

Rockwell Software OPC T est Client Application

Version 1.1
User Manual

Page 1 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

Table of Contents INTRODUCTION.............................................................................................................................. 3 LICENSE .......................................................................................................................................... 4 GETTING STARTED ....................................................................................................................... 6 SETTING UP THE SERVER................................................................................................................ 6 CONNECTING TO THE SERVER ......................................................................................................... 6 ABOUT THE SERVER VIEW ............................................................................................................... 7 CREATING A GROUP........................................................................................................................ 7 CONNECTING TO AN ITEM ................................................................................................................ 9 REMOVING AN ITEM ....................................................................................................................... 10 REMOVING A GROUP ..................................................................................................................... 10 DISCONNECTING FROM A SERVER .................................................................................................. 10 IN DEPTH LOOK AT FUNCTIONALITY ....................................................................................... 11 SERVER OBJECT........................................................................................................................... 11 GROUP OBJECT ............................................................................................................................ 12 ENUMOPCITEMATTRIBUTES OBJECT............................................................................................. 14 ADVANCED MECHANISMS ......................................................................................................... 15 MMI EMULATION MODE ................................................................................................................ 15 GROUP EVENTS ............................................................................................................................ 16 LOG VIEWER................................................................................................................................. 17 ITEM VIEW COLUMNS .................................................................................................................... 19 FILE MANAGEMENT .................................................................................................................... 21 OPENING A FILE ............................................................................................................................ 21 EDITING THE CSV FORMAT FILE .................................................................................................... 21 THE FILE FORMAT FOR THE TEST CLIENT ....................................................................................... 21 INDEX ............................................................................................................................................ 25

Page 2 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

INTRODUCTION
Rockwell Software has provided this program for the purpose of testing OLE for Process Control (OPC). Specifically, this clients primary focus is to test the impl ementation of the 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 their server for compliance to the spec. This manual will detail the functional behavior of the RSOPC Test Client, specifically with regards to its implementation of the OPC 1.0a version of the specification. At the time of writing, the RSOPC Test Client only implements the required interfaces from the OPC 1.0a specification. This manual assumes minimal familiarity with OPC. It is not intended to be a rewrite of the OPC specification. This is an additional tool for the RSServer OPC Toolkit. It is not redistributable or transferable. Please refer to your license agreement in your toolkit documentation for more information on redistributable files.

Page 3 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

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 all accompanying 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 SHALL NOT 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.

Page 4 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

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.

Page 5 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

GETTING STARTED
If you are somewhat familiar with what went into DDE implementations for process control, then most of the aspects of OPC should seem relatively similar from a general perspective. 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's that use what are called interfaces. For more information on the basics of OPC, please refer to the OPC Specification. To effectively use this client, it is recommended that the user have some familiarity with the OPC Specification or some implementation thereof. There are many things that were not available in DDE that are now possible via OPC. These include improved group and item management, as well as the ability to seamlessly enable the user to use remote servers using DCOM.

Setting Up the Server


The 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 the DLL is not in the appropriate system directory, you should include the path in the filename. Register the data server. (Information to do this should have been provided with the software package that allows users to upgrade using the toolkit. Other native OPC servers will need to be self-registered using the "/regserver" command line argument.)

Connecting to the Server


Selecting the Server
Connecting to a server is the first thing a user must do before he/she can start communicating 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 registered as an OPC server, the ProgID of that server will appear in the list box. If it did not, either the server is not properly registered, or you can enter the ProgID in the text box below the list box.

Node Name (optional)


The optional node name is for using DCOM. If the server is on a remote machine, the name of that machine can be entered here. Unlike NetDDE, there is nothing special for using OPC over a network. Entering the node name here is sufficient to talk with a remote server. If the server you want to talk to be local to this machine, you should leave this 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) Page 6 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

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

To adequately test the implementation of your server, you should definitely try starting 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 server should automatically launch. The only way this wont work is by using DCOM to launch a server residing on a Windows95 server. Please see the Microsoft documentation regarding the implementation of DCOM under Windows95, especially those sections concerning using the operating system as a server.

About the Server View


The server view is the heart of the whole program. From here, most of the operations that can be performed through OPC can be directly tested.

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

Item View
The top-right view is the item view. This displays the information concerning individual items 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 that for optimization purposes, the screen should not redraw on the server or other entity updating 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 processor intense, non-OPC related updates in check. If you want to see item changing quickly, set the timer low. If you want optimal performance, set it to 250ms or better.

Creating a Group
To connect to a group, first select the group item on the menu. A popup menu should appear. Select add group. This will display the dialog shown.

Page 7 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

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 other attributes 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. For example, you cannot have two groups of the same name in a single group view. An attempt to do so will result in an error. You can however have two groups of the same name on different clients.

Update Rate
This is a client-requested poll rate. What this will do (in the case of the toolkit) is throttle the rate at which the client can be updated. The server itself may poll and post data much faster, but the client will not get data any faster than the poll rate supplied by the group. The server will return an actual poll rate, which is displayed with the group in the group view. 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 than the 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 is allowed between the last value and the current one. The server only provides data to the 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 back asynchronously from the server. This interface is used for all asynchronous returns from the server. This includes asynchronous reads, asynchronous write complete notifications, and item subscription data.

Active (Check box)


This flag advises the server to send data continuously (throttled by the update rate) using the IAdviseSink. Without the advise flag set, the active state is useless, as it will ask the server 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 where asynchronous IO would be implemented.

Page 8 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

Allow Timeout (Check box)


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

Connecting to an Item
An 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 server should take to get to the data requested. In the case of data servers upgraded from DDE using the RSServer OPC Toolkit, the access path is equivalent to the topic.

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

Active
This flag sets this item to an active state. This is similar to the active state on a group basis, 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 the server. This is not necessarily how the client will display it, as the client will just parse the 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 canonical datatype of VT_I2), the server will return an error and NOT add the item. There are also times 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 the requested format.

Array
This flag tells the server that the data is in an array format. The client does the some with this as the requested data type.

Add Item
You can add multiple items at once. Clicking on "Add Item" will add a logical item into your item list. If you find that you have to many, or didn't want to ad one of them, change the item name to a blank, and the client will not request that item to be added. Page 9 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

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

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

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

Disconnecting from a Server


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

Page 10 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

IN DEPTH LOOK AT FUNCTIONALITY


These tests assume that the tester has already connected with the server. For instructions on connecting with an OPC server, see section 0 above.

Server Object
The server object is the object that embodies the OPC servers attributes. From this object, one can create group objects that actually access the data for the client. Setting up and testing all of the features of the server object is critical to ensuring that your server is compatible.

IOPCServer Interface
The server object only has one required interface, IOPCServer. From this interface, one can add groups, get an OPC error string, inquire about an existing group, get the status of 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 or may not be part of the OPC specification, depending on how the developer implemented them. Other optional interfaces that are a part of the OPC specification will be addressed 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 the string that were obtained from the server. These were all queried before the dialog was displayed. Please make sure all of the strings are correct. These strings could be used for error reporting or systems alarming.

Get Group by Name


Select Server | Get Group by Name from the menu. This will display a dialog box that contains 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 is valid. By clicking on the Test button, the client will query the server with that string currently displayed in the combo box. More functionality should be added in the future to this feature, like the ability to ask for an invalid name, etc.

Get Status
Select Server | Get Status from the menu. This will display a dialog that will contain the information 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), the number of groups currently in use on the server, the bandwidth (-1 if unimplemented), the time the server started, the current time (on the server), and the time the last update was sent for any item on the server.

Page 11 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

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

Create Group Enumerator


The OPC specification includes a couple of different ways that an enumeration list can be generated. The Test Client implements this list in a top-down fashion. That is, the previous function is never called in this implementation of the test client, but this may change 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. This list 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 Object
The group object contains all of the functionality needed to manipulate the group object itself, all items that are associated with the group, as well as the ability to do a host of other functions.

Group State
The group state can be obtained in several ways, but the easiest is to double-click on the group name in the group view. All information if The state displays valuable information about 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 the values, and have the server adopt those values by clicking on OK, or Apply. The client will query the server again to get the updated values.

Subscription Updates
A subscription is basically having an active item on an active group with an advised data object. In other words, this means that and will constantly receive data on an item. The client will be updated every time the item changes. This includes state information, as well as the actual data itself.

Page 12 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

Synchronous Reads and Writes


Synchronous operations are functions that return with the data requested. These functions block other calls until the synchronous call returns. OPC's synchronous operations 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 lack of one tells you are reading from device. The returned values are displayed in the "Sync value" column. A write can be performed on a group of items by selecting them in the item view, and selecting the Sync Read operation from the Item menu of the item view right-mouse menu. 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 the status 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 a callback-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 to read the item. The check in the menu tells you that you are reading from cache, a lack of 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, and selecting the Async Read operation from the Item menu of the item view right-mouse menu. 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 will notify 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 will call the server with a cancel request. (The cancel function is not available from the user interface.)

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

Client Handles
The item handle is an identifier used by a client to identify a particular item. This is a number 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 more information 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 of item information from a server. (It just uses a type cast, really.) If we want to change the object or structure that the handle for an item points to, we can use the change client Page 13 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

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 calls will be made or received with the old item handle. The client wraps all of this functionality for you, so changing the client handle involves nothing more than selecting the 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. This allows 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 item should receive data every time the value changes (outside of the deadband, and outside the

Advising / De-Advising the group


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

EnumOPCItemAttributes Object
The 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 Attributes


When initialized, the "Enumerate Item Attributes" dialog will query the server for all available items. This will be done using repeated calls of increasing size using the Fibonacci sequence, as with other enumerations in this application. (This enumeration will not pass a negative number to the server.) This is done only to get the item names to 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 by requesting 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 are displayed next to the item list. The "Clone" button will clone the item attributes interface and present an identical dialog that the user can use to query attributes. These dialogs must be exited successively (or recursively, if you will) as they are all "modal".

Page 14 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

ADVANCED MECHANISMS
The RSOPC Test Client has many extra "goodies" that aid in the testing of an OPC server beyond the functional testing we discussed above. These goodies are tools that allow 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 Mode


The 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 application changing screens, using groups to activate and deactivate several items in one shot.

How it works
The user can set up an emulation based on a couple parameters. First, the user can elect 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 by selecting "MMI Emulation Mode". A dialog will appear on the screen presenting a set of options. As described above, these options include: only the displayed group is active, enable the MMI emulation (automatically change screens) and the interval between screen changes.

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

Problems
Although there have not actually been reported problems, there may be difficulty removing groups while the MMI emulation is running. Use with caution.

Page 15 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

Group Events
Group events are timed operations that can happen on a group and the items contained in that group. These include read and write operations, as well as setting the active state 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 that the operation can be performed on, the operation type, a name (which does not have to be unique), and a timer value in milliseconds. When an event is initiated on a group, the event triggers after the first timed event has completed. Then at every interval it will perform the operation again and again until the user removes the event, or removes the group.

The reads work as follows in all situations: whenever a read event happens, the server requests 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 subscription notifications. That is, if an item is updated via subscription, and an asynchronous read is performed, and the item does not change before the next scheduled subscription notification, 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 Page 16 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

applied to all DataTypes, including strings and arrays. Each item in the array will be given the next increment in the sequence. The sequencer built into the program is disrespectful of datatype limitations, so there will be negative numbers written to the item after several iterations of the event. This ensures a nice mix of numbers sent to data items. (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 the list will be set active or inactive. The state of the items will always change on each event that occurs, hence the toggling effect.

Configuration
Event configuration can be set up by selecting the "Configure Events" item on the group menu. The resulting dialog will show a list of events on the group. Initially there will be none, so we will add one. Select Add Event to add a new event to the group. The shown dialog will appear in which we can set our event parameters. The first thing we can set is the name. This can 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's start. It does not relate in any way to the event's completion time. This is why it is important to configure your events carefully so as not to loose control of the user interface. (See problems.) You can also select the type of event desired, discussed in the previous section. This determines what action will be performed on the items selected below. The user can also elect to only have the operation performed when the group is active. This is an extension of the MMI emulation, so that only items in the active group will be operations performed on them. If this is not selected, the items will have the operations performed regardless of the active state of the group. Finally, in order for an item to have an operation performed on it, it must be highlighted in the 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 that operation 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 possible to 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 to device. Rockwell Software does not recommend using these except in cases where the data must be guaranteed to get to the device.

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

Page 17 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

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

How it works
When 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 checks against a log filter. If the filter passes, the event is logged to the screen. The log on the screen will be updated at the same rate as the item view, which by default is set at 250ms. Log file support is not available at the time of writing.

Configuration
Logger 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 the events 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 the filter 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 something like that. These are typically error codes or handles so one can keep track of events and results as they happen. Because the logger logs the events to the screen, and that view is continuous it is possible to eat up memory with the logger. Using the "clear" function as the log view fills can avoid problems with running out of memory over long tests. (In long tests, the user may want to only enable errors that will show the specific problem.)

Page 18 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

Item View Columns


By default, the user only sees a small subset of the number of columns that can be displayed in the OPC Test Client. This is to simplify the task of getting users up and running, and greatly simplifies the user interface. There are 15 columns that can be displayed in the item view. They are: ItemID Access Path Subscription Value Subscription Quality Subscription Time The string identifier of the item. The access path associated with this particular item. The last value received via a subscription update. The quality of the last update received via a subscription update. The last time a subscription update was received. Set only if the data object on the group uses "timestamped" format. The number of updates received via subscription since the item was added to the group. The last value received via an asynchronous read. The quality of the last update received via an asynchronous read. The last time an asynchronous read was received. Set only if the data object on the group uses "timestamped" format. The number of updates received via asynchronous read since the item was added to the group. The last value received via an synchronous read. The quality of the last update received via an synchronous read. The last time an synchronous read was received. The number of updates received via synchronous read since the item was added to the group. The rate at which an item is receiving subscription updates. The handle (number) the server uses to identify the item when the client requests information. Useful for debugging.

Subscription Updates

Asynchronous Value Asynchronous Quality Asynchronous Time

Asynchronous Updates

Synchronous Value Synchronous Quality Synchronous Time Synchronous Updates

Update Rate Server Handle

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

Page 19 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

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

Adding and Removing Columns


Columns 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 and invisible columns. A visible column may be removed by double clicking on its name in the enabled list. An invisible column may be added by double clicking on its name in the disabled list. Although the columns may appear in any order in the dialog, they will always 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 default view configuration.

Expert Versus Non-Expert Mode


There are two autonomous ways to look at the data in the item view. These are called the Expert and Non-Expert modes. They are selectable under the "View" menu, using the menu item, "Expert Mode". If this item is check, then the view is in expert mode. If not, then the user is in Non-Expert mode. The differences in the views are that the Non-Expert mode (default) has wide columns and only displays five of the available fifteen columns. Expert mode displays all the columns, and constricts the width to fit the maximum number on the screen. Both modes can have columns added and removed, widths changed, and all will be retained between each mode. Other than that, there is no difference between these mode.

Page 20 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

FILE MANAGEMENT
The 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 File
As with most Windows programs, the OPC Test Client supports opening a file by using the OPEN:FILE menu command to display a common dialog for opening a file. The Test Client will support any file extension, provided that the contents of that file can be interpreted as a CSV with the appropriate fields filled in. See below for details about the file format.

Editing the CSV Format File


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

The File Format for the Test Client


The OPC Test Client operates on what is called a CSV format, or comma separated values format. Many other types of editors and programs are able to use this format, as well 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 OPC Test Client. This file contains an example of what a file would look like including field comments. It can be easily viewed with Microsoft Excel. The following details the rules for building your own CSV f iles. Creating ones own configurations files should never be done on a non-critical system and only by someone who fully understands the file format.
1 2 3 Server ProgID Group Ordinal Group Ordinal Node Name Access Path Num Groups Rate Name Active Display Bias Active MMI Enabled % Dead band Vartype MMI Time Time Stamp Log Filter Active LogFile Name Advise Timeout

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

Page 21 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

Server ProgID (String)


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

Node (String)
The node name is the name of the computer on a given network that is to be connected to by the OPC Test Client. Make sure that the client can connect to that external resource 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 this file, this one is critical to be accurate, as it predetermines memory allocation in the test client.

Display Active Group (Boolean)


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

MMI Emulation Enabled(Boolean)


If this field is set to "1", then only the selected group (displayed) will be active, and all others will be deactivated, as per above configuration. In addition, the selected group will 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 MMI Emulation 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. As the use of this field may change with revisions of the test client, this field should not be edited. Omitting this field results in all events being logged in the default format. This behavior 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 a server. The only restriction is that the declaration of a group must come before the items that use it.

Page 22 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

Group Ordinal (Integer)


This (for the OPC Test Client) the most critical field in the group line. This field contains a 0-based integer to the array that will be built of your groups. This number must be unique. It must start at 0 for the first group. Each successive group must have this ordinal incremented by 1. An item will use this field as a reference point for the group that the items will be added to.

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

Rate (Integer)
This is the requested update rate. This rate will be truncated to the nearest quarter second 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 the server 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 to the client.

Timestamp (BOOL)
OPC offers a timestamp option for items that use an advise (a mechanism for being called back). This timestamp is put on an item the last time the item was updated. The client 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 group will 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 the group configuration, with the timeout enabled, the client will call the server with a cancel on outstanding transactions after at least 10 seconds after the calls have been made.

Page 23 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

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 they must each have a unique group. This is why it is a good idea to edit CSV files in an advanced 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. Items need not be in any particular, as long as they follow the group they belong to. This ordinal 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 legacy packages, this may be the same as a DDE topic. In other systems, it is often a hint as to 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 to the server. At this point (loading the configuration file), the access permissions to that data (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 is active and has an advise available to receive data. If all these conditions are met, then the item should be updated with data.

Variant Type (VARTYPE)


This is the decimal representation of a variant type. For example, an I4 (four byte integer), which is 0x0004, would be simply 4. An array of four byte integers would be 0x2004, or 8196. Examples of these data types can be easily generated by saving configurations from the Test Client.

Page 24 of 25 Wednesday, July 10, 2013

Rockwell Software OPC Test Client Application

INDEX
DDE ................................................................... 6 EnumOPCItemArrtibutes Interfaces IOPCEnumItemAttributes Clone .....................................................14 Next .......................................................14 Reset .....................................................14 Skip .......................................................14 Events ...............................................................16 Configuration .................................................17 Problems .......................................................17 Types ............................................................16 Files ..................................................................21 Editing ...........................................................21 Format...........................................................21 Open .............................................................21 Group .......... 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18 Active ............................................................. 8 Deadband ...................................................... 8 Enumerating ..................................................12 IAdvise ........................................................... 8 Interfaces IDataObject Dadvise .................................................14 IOPCAsyncIO Cancel ...................................................13 Read......................................................13 Refresh..................................................13 Write ......................................................13 IOPCGroupStateMgt GetState ................................................12 SetName ...............................................12 SetState ................................................12 IOPCItemManagement AddItem .................................................10 RemoveItem ..........................................10 Validate .................................................10 IOPCItemMgt ............................................13 ChangeClientHandles ...........................13 SetActiveState.......................................14 SetDataTypes .......................................14 IOPCSyncIO Read......................................................13 Write ......................................................13 Name ............................................................. 8 Removing ................................................10, 12 State..............................................................15 Time Bias ....................................................... 8 Timeout .......................................................... 9 Update Rate ................................................... 8 Group View ........................................................ 7 Item ....................................... 9, 10, 13, 14, 17, 18 Access Path ................................................... 9 Active ............................................................. 9 Add................................................................13 Array .............................................................. 9 Asynchronous ...............................................14 Data type ........................................................ 9 DataType ......................................................14 Enumeration ..................................................14 Item ID ........................................................... 9 Read .............................................................13 Remove .........................................................13 State..............................................................14 Subscription ............................................12, 14 Write..............................................................13 Item View Columns ..................................................19, 20 Expert Mode ..............................................20 Types ........................................................19 Item View ........................................................... 7 Logging .............................................................18 Configuration .................................................18 Messages ......................................................18 Logging .........................................................7, 18 MMI Emulation ..................................................15 Configuration .................................................15 OPC DCOM ............................................................ 6 Group ............................................................. 7 Item ................................................................ 9 Proxy .............................................................. 6 Server ............................................................ 6 Specification ................................................3, 6 Rockwell Software RSServer OPC Toolkit ................................... 3 Screen Timer...................................................... 7 Server ......................................... 6, 10, 11, 12, 18 Connecting to ................................................. 6 Disconnecting................................................10 Interfaces IOPCServer ...............................................11 CreateGroupEnumerator .......................12 GetErrorString .......................................11 GetGroupByName .................................11 GetStatus ..............................................11 GroupAdd ............................................... 7 RemoveGroup .......................................12 Node .............................................................. 6 Object............................................................11 ProgID ............................................................ 6 Registering ..................................................... 6 View ............................................................... 7 Status ................................................................12

Page 25 of 25 Wednesday, July 10, 2013

Potrebbero piacerti anche