PCIS-OPC OPC Server for NuDAQ PCI DAQ Cards Windows NT/98/2000 User’s Guide Recycled Paper
©Copyright 2001 ADLINK Technology Inc. All Rights Reserved. Manual Rev. 2.00: March 20, 2001 Part No : 50-10020-100 The information in this document is subject to change without prior notice in order to improve reliability, design and function and does not represent a commitment on the part of the manufacturer.
Getting service from ADLINK Tech. Inc. Customer Satisfaction is always the most important thing for ADLINK Tech Inc. If you need any help or service, please contact us and get it. ADLINK Technology Inc. Web Site Sales & Service Technical Support TEL Address http://www.adlink.com.tw service@adlink.com.tw NuDAQ nudaq@adlink.com.tw NuDAM nudam@adlink.com.tw NuIPC nuipc@adlink.com.tw NuPRO nupro@adlink.com.tw Software sw@adlink.com.tw AMB amb@adlink.com.tw +886-2-82265877 FAX +886-2-82265717 9F, No.
Table of Contents How to Use This Guide .......................................................iii Chapter 1 Introduction to PCIS-OPC .............................. 1 Chapter 2 Installation .......................................................... 2 2.1 System Requirements...................................................... 2 2.2 Software Component Installation ...................................... 3 2.3 Directories and Files ........................................................ 4 2.
4.1.5 Modifying an Existing Item ......................................................... 21 4.1.6 Saving Configuration................................................................... 21 4.1.7 Loading Configuration File......................................................... 21 4.2 Diagnostic..................................................................... 22 4.2.1 Start Diagnostic........................................................................... 22 4.2.2 Reading Item ..........
How to Use This Guide This manual is designed to help you use the PCIS-OPC software. It is organized as follows: l Chapter 1, "Introduction to PCIS-OPC" describes the PCIS-OPC software. l Chapter 2, "Installation" describes the system requirements and the step of installing PCIS-OPC software and NuDAQ PCI devices. l Chapter 3, “OPC Interface of PCIS-OPC” lists the interface the NuDAQ PCI card OPC server provides.
1 Introduction to PCIS-OPC The PCIS-OPC software is an OPC compliant server that enables data exchange between OPC clients and NuDAQ PCI data acquisition cards. The OPC server is fully compliant with OPC Data Access Specification 2.0. It follows the requirements of the OPC specification to provide access to data to an OPC client. This server implements version 2.04 of the OPC custom interface that is typically used by C++ and Delphi programs.
2 Installation 2.1 System Requirements The software requires the following minimum configuration: l An IBM PC/AT or compatibles l Windows NT version 4.0 SP4 (or greater), Windows 2000, or Windows 98. Note: PCIS-OPC can not be used in Windows 95. l At least 64 MB RAM l 5 MB free hard drive space l A CD-ROM drive for installing the software.
2.2 Software Component Installation The Setup program provided by PCIS-OPC performs all tasks necessary for installing the software components. Step 1. Place the “ADLINK All-in-one CD” in your CD-ROM drive. Step 2. If autorun setup program is not loaded, choose Run from the taskbar, then type x:\setup in the Run dialog box. (where x indicates the CD-ROM drive) Step 3. Choose Software Package item, then you can find PCISOPC installation. Step4. Setup first displays a Welcome dialog box.
[Windows NT only] Because Windows NT is not a Plug and Play system, you have to register the device driver manually. When the software component installation process is completed, Setup will launch the NuDAQ PCI Configuration Utility, PciUtil, for you to register the driver. For the details of the driver registry in Windows NT, please refer to section 2.4.2. 2.
2.4 Device Installation 2.4.1 Windows 98 Windows 98 and NuDAQ PCI data acquisition cards work very well together because Windows 98 includes Plug and Play capabilities. Once Windows 98 has started, the Plug and Play function of Windows 98 system will find the new NuDAQ PCI cards. If this is the first time to install NuDAQ PCI cards in your Windows 98 system and you haven’t installed any ADLINK NuDAQ PCI card software, you will be informed to install the device driver.
After installing PCIS-OPC software component then re-entering Windows 98, to ensure the success of hardware device installation, you can open the Device Manager in Start>>Settings>>Control Panel>>System, and then select the Device Manager tab. In Device Manager, you should find the device in NuDAQ. You can double-click the device, select the Resources tab to check if I/O port and IRQ resources for the device are allocated successfully. 2.4.
To register one of NuDAQ PCI card drivers, click N e w … button and a Driver Configuration window appears. In this window, users can select the driver you want to register and input the parameters in the box corresponding to AI, AO, DI, or DO buffer size for the requirement of your applications. As described above, you can set buffer size to 0. After the device configurations of the driver you select is finished, click OK button to register the driver and return to the PciUtil main window.
Then you can select Exit! command in the menu bar or Done button to exit the driver registry utility. To make the registered drivers work, you have to restart Windows NT system. After re-entering Windows NT and the NuDAQ PCI devices you wish to operate have been plugged in your computer, make sure the device drivers corresponding to those NuDAQ PCI cards are already started.
Note: The AdlDask driver must have been started as you set the card’s own device driver status as started.
2.4.3 Windows 2000 Windows 2000 and NuDAQ PCI data acquisition cards work very well together because Windows 2000 includes Plug and Play capabilities. Once Windows 2000 has started, the Plug and Play function of Windows 2000 system will find the new NuDAQ PCI cards. If this is the first time to install NuDAQ PCI cards in your Windows 2000 system and you haven’t installed any ADLINK NuDAQ PCI card software, you will be informed to install the device driver.
In Device Manager, you should find the device in NuDAQ Boards. You can double-click the device, select the Resources tab to check if I/O port and IRQ resources for the device are allocated successfully.
3 OPC Interface of NuDAQ PCI card OPC Server OPC Specification defined the standard OPC interface. Users can use the OPC interface to communicate with OPC server. Following description is the interface of NuDAQ PCI card OPC server. 3.
HRESULT GetStatus (ppServerStatus); HRESULT RemoveGroup (hServerGroup, bForce); HRESULT CreateGroupEnumerator (dwScope, riid, ppUnk); IConnectionPointContainer HRESULT EnumConnectionPoints (IEnumConnectionPoints ppEnum); HRESULT FindConnectionPoint (REFIID riid, IConnectionPoint ppCP); IOPCItemProperties HRESULT QueryAvailableProperties (szItemID, pdwCount, ppPropertyIDs, ppDescriptions, ppvtDataTypes); HRESULT GetItemProperties (szItemID, dwCount, pdwPropertyIDs, ppvData, ppErrors); HRESULT
3.
IOPCItemMgt HRESULT AddItems (dwCount, pItemArray, ppAddResults, ppErrors); HRESULT ValidateItems(dwCount, pItemArray, bBlobUpdate, ppValidationResults, ppErrors); HRESULT RemoveItems (dwCount, phServer, ppErrors); HRESULT SetActiveState (dwCount, phServer, bActive, ppErrors); HRESULT SetClientHandles (dwCount, phServer, phClient, ppErrors); HRESULT SetDatatypes (dwCount, phServer, pRequestedDatatypes, ppErrors); HRESULT CreateEnumerator (riid, ppUnk); IConnectionPointContainer HRESULT EnumCo
3.
4 Configuration and Diagnostic 4.1 Configuration The graphical configuration and diagnostic functions are bundled in NuDAQ PCI card OPC server (NQOPCSvr.exe). That is, the user interface of the NuDAQ PCI card OPC server is the configuration/ diagnostic window. You can use it to set up and maintain the OPC server. It provides fields for specifying the properties of devices (NuDAQ PCI data acquisition cards ), and items (channel or port on the device). You can save the configuration to a file.
4.1.1 Adding a New Device From the Tree Browser: In Configuration view, click the right button on the root (NuDAQ OPC Server), then select the Add Device command in the popup menu. The Add Device dialog box will appear. From the menu bar: In Configuration view, select Add Device from the Server menu to bring up the Add Device dialog box. 1. In the Add Device dialog box, select the NuDAQ PCI card type and the card index you want to add in your configuration.
Card Type Series Device Types PCI-6208 Series PCI-6208V, PCI-6216V, PCI-6208A PCI-6308 Series PCI-6308V, PCI-6308A PCI-7200 PCI-7200 PCI-7230 PCI-7230 PCI-7233 PCI-7233 PCI-7234 PCI-7234 PCI-7248 PCI-7248, PCI-7224 PCI-7249 PCI-7249 PCI-7250 PCI-7250 PCI-7252 PCI-7252 PCI-7296 PCI-7296 PCI-7396 PCI-7396, PCI-7348 PCI-7432 PCI-7432 PCI-7433 PCI-7433 PCI-7434 PCI-7434 PCI-9111 Series PCI-9111DG, PCI-9111HR PCI-9112 PCI-9112 PCI-9113 PCI-9113 PCI-9114 Series PCI-9114DG, P
4.1.2 Search Devices In addition to adding the device manually, you can utilize the Search Devices command to list all of the NuDAQ PCI cards currently plugged on the computer. From the menu bar: Select Search Devices from the Server menu to bring up the Search Devices dialog box. From the Tree Browser: Click the right button on the root (NuDAQ OPC Server) then select the Search Devices command in the popup menu. The Search Devices dialog box will appear. 1.
From the menu bar: In Configuration view, select Add Items from the Device menu to bring up the Add Items dialog box. 1. In the Add Items dialog box, you will see all the valid items in this device. You can click on the item name column to modify the item name, and right click on the range/port/mode column of the item to change the property(if this property is writeable). You can select the items you want to add, and click the Add button, or click Add All button to add all items. 2.
4.2 Diagnostic 4.2.1 Start Diagnostic You can diagnose the NuDAQ PCI card OPC server eas ily with the Diagnostic view. From the menu bar: Select Start Diagnostic from the Diagnostic menu to bring up the Diagnostic view. 4.2.2 Reading Item The values of the readable items are updated periodically. 4.2.3 Writing Item If you want to output a value to a writable item, please click the right button on the item then select the Write command in the popup menu.
5 OPC Client Sample Program This section describes how to run the ALINK OPC Client sample program. Before we continue, please make sure that PCIS-OPC software and the NuDAQ PCI devices are installed correctly. Also, you should have run NuDAQ PCI card OPC server (NQOPCSvr.exe) to configure the devices and items existed on the server, and place the generated file NuDAQ.cfg in the directory where NuDAQ PCI card OPC server locates. Step 1.
Step 2. The Browse Items button is now enabled, and the NuDAQ PCI card OPC server icon appears on the task bar. Step 3. Click the Browse Items button to query IOPCBrowseServerAddressSpace interface and acquire all items defined in the NuDAQ PCI card OPC server. All items are listed in the Server Item List. There are two columns in the list. The first column is the name of each item, which is presented in device.item format. The second column is the access right of each item. “R” represents readable.
Step 4. Click the Add Group button to add a new group to the NuDAQ PCI card OPC server. You should enter Group Name, Requested Update Rate, Client Handle, and select if this group is active. A new group will appear in the Group List. There are three columns in the Group List list. The first column is the name of a group. The second column indicates the active/inactive status of the group. The third column represents the server-revised update rate (in mini-seconds) for that group. Step 5.
Step 6. After groups have been added, you can select some items and click Add Item button to add these items to a selected group. Or you can click Add All Items button to add all items on the server to a selected group. Now we should take a look at the Items in Current Group list. There are eight columns in the list, which are described as follows: l Item Name: It is presented in the device.item format.
Step 8. To perform asynchronous read, click Read button. The server will read value from corresponding hardware for each item. The value and other parameters returned will be presented in the Items in Current Group list. Step 9. To perform synchronous write, you should first set a value to a writable item. To do this, you can right-click on an item with “W” or “R/W” access right. And a dialog box will appear for you to enter the item value.
Step 10.If you want to build a connection between server and client, click the Advise button. It advises the NuDAQ PCI card OPC server of client’s IOPCDataCallback interface. After that, once item values change, the NuDAQ PCI card OPC server will invoke OnDataChange() to notify the client. The changed values will be presented in the Items in Current Group list.
Appendix - Notes of Using OPC/DCOM 1. 2. 3. 4. 5. When the Installation of PCIS-OPC is successful, the NuDAQ PCI OPC server has been registered in system registry. Or you can register it manually by executing the command “NQOPCSvr -RegServer” in DOS Prompt. Because the OPC server is based on the COM/DOCM of Microsoft, your Windows system must support DCOM capability. DCOM is a standard part of the Windows NT 4.0 distribution. You preferably have applied the latest Service Pack for Windows NT 4.
Product Warranty/Service ADLINK warrants that equipment furnished will be free from defects in material and workmanship for a period of two years from the date of shipment. During the warranty period, we shall, at our option, either repair or replace any product that proves to be defective under normal operation. This warranty shall not apply to equipment that has been previously repaired or altered outside our plant in any way as to, in the judgment of the manufacturer, affect its reliability.