Acquire Data from Agilent Technologies Gas Chromatographs using the LabVIEW DSC Module
Table of Contents
Overview
Agilent Technologies Life Science and Chemical Analysis group recently released a new OPC instrument driver, OPC Communications for Cerity NDS for Chemical QA/QC, that makes it possible to use the NI LabVIEW Datalogging and Supervisory Control (DSC) Module to communicate with and acquire data from Agilent gas chromatographs. With this driver software, you can quickly integrate Agilent Cerity Chemical software into LabVIEW to control your gas chromatographs for natural gas, petroleum refining, petrochemical or chemical QA/QC analyses that integrate with larger systems to solve applications including data logging, analysis, reporting, and supervisory control.

[+] Enlarge Image
Figure 1: System Configuration Flowchart
The OPC Communications for Cerity NDS for Chemical QA/QC software communicates with the LabVIEW DSC module Tag Engine to exchange data from the Agilent gas chromatograph with LabVIEW. Cerity Chemical acts as the OPC Client and the LabVIEW DSC module acts as the OPC Server.
Installation
First, install the Agilent Cerity software (available for purchase from Agilent Technologies). Consider the following when installing the Agilent Cerity software:
- You must use Cerity version 4 or later to work with the OPC Communication software.
- Cerity uses a LAN connection to interface to most of the gas chromatographs. This enables the acquisition computer to be located away from the gas chromatograph.
- Follow the installation instructions in the online help readme file.
Next, install the Cerity Chemical OPC Communication software, an additional software package also available from Agilent Technologies. Follow the installation instructions on the CD.
Finally, install LabVIEW and the DSC module. If you are installing the LabVIEW DSC module version 6.02, follow the installation instructions in the Steps to Install the LabVIEW DSC 6.02 Module KnowledgeBase document. If you are installing the LabVIEW DSC module version 6.1, put the CD into your acquisition computer and follow the installation instructions.
LabVIEW DSC Module Tags
The LabVIEW DSC module Tag Engine keeps a list of I/O points, and these are referred to as tags. A tag is used to create and maintain a connection to a real-world I/O point. A memory tag is used for data held by your application that you need to use or track. A network tag is a tag remotely connected to any type of tag on another Tag Engine. This application uses a memory tag.
Follow these steps to set up the tags you need:
1. Open LabVIEW. Tags are configured through the National Instruments Tag Engine. Select Tools»Datalogging & Supervisory Control»Configure Tags to start the Tag Configuration Editor.
2. You will need to add two tags to collect a timestamp and data from your gas chromatograph. For the timestamp tag, select Edit»Create»String Tag.
- On the General tab, set the tag name to OPCTest.CurrentDateTime.
- Create a tag group called OPCTest by clicking on the down arrow in the Tag Group listbox and selecting Enter New.
- On the Connection tab, set tag access to Memory. Since the LabVIEW DSC module is acting as the OPC Server, you must create a memory tag so that you can write to the tag.
- Click OK to create the tag.
- On the General tab, set the tag name to OPCTest.BenzeneAmount.
- Set the tag group to OPCTest.
- On the Connection tab, set the access to Memory.
- Click OK to create the tag, and you can see both tags in the Tag Configuration Editor.

Figure 2: Tag Configuration Examples
5. Close the Tag Configuration Editor.
Note: The tag configuration sets your deadband to 1% by default. This indicates that only a 1% change in value will be logged. You can change this deadband to reflect the level of precision that you need. The deadband setting is accessed through the Operations tab. However, you must also set the range of data that you expect to receive. This can be set in the Scaling tab. The smaller you set the deadband, the more data you will generate and your need for historical database space will increase. After the tags have been defined, the next step is to verify these tags using the Server Explorer. This step is not necessary, but it verifies that everything has been set up correctly. You may follow these instructions any time you need to make sure that the tags are correctly verified or want to view the current value of the tag.
1. Open Server Explorer by selecting Start»Programs»National Instruments»ServerExplorer. Right-click on the OPCLabVIEW server.
2. Select Wizard.
3. Click Next to connect to the server. The Tag Engine starts and loads the default tag configuration, which is the last configuration you edited in the Tag Configuration Editor.
4. Choose a Group Name and leave the default Update Rate for this test.
5. Move the tags to verify to the Selected OPC Items column. Move other tags to the Available OPC Items column. Click Finish.
At this point, the Quality of your tag is Value bad. This changes to Value good once communication with the instrument has begun.
LabVIEW User Interface
A LabVIEW user interface allows you to view the data as it is collected. Follow these steps to create the user interface:
1. Place a string indicator for the timestamp.
- Right-click on the front panel to open the Controls palette. Select the String & Path subpalette and select a String Indicator. Place this indicator on the front panel.
3. Place a numeric indicator for the data.
- Right-click on the front panel to open the Controls palette. Select the Numeric subpalette and select a Numeric Indicator. Place this indicator on the front panel.
5. Save your LabVIEW user interface.
Note: This interface can be edited to include any processing or analysis of the data that you may require. You can also add a stop button to the while loop; as currently written, the program stops only when the Tag Engine stops or when the program is aborted.

Figure 5: Example of the Front Panel of the LabVIEW User Interface

Figure 6: Example of the Block Diagram of the LabVIEW User Interface
Configuring the Cerity Chemical OPC Software
Open the OPC Configuration Utility and set it up for communication between Cerity Networked Data System for Chemical QA/QC and the LabVIEW DSC module:
1. Choose the gas chromatograph that you are using from the GC pull-down list. In this case, use the benzene chromatograph labeled "benzene."
2. Choose your server from the OPC Server pull-down list. This will be the National Instruments.OPC LabVIEW Server.
- If you are running the DSC module on a separate computer, you need to find a remote OPC Server. To do so, go to the Find OPC Servers menu and choose Find Remote OPC Servers. Select the computer on which the DSC module is installed, then click OK. All OPC Servers found on the selected computer are shown on the OPC Server pull-down list. If you are unable to find the remote server, your computer may be incorrectly configured. The following links offer assistance in configuring your computer:
Remote OPC Server on Windows 95/98/ME - If you are running the DSC module on your acquisition computer, the local OPC Servers are already listed in the OPC Server pull-down list.
4. Enter the method name CerityTest.
5. Enter * for the Sample Name.
6. Choose which data will be transferred to the tags:
7. Select the Peak radio button and enter the peak data name Benzene in the text box. Drag the text "Peak Amount" to the Cerity Information column and type the name of the corresponding tag in the OPC Tag column.
8. Select the Miscellaneous radio button to find the Current Date/Time information. Drag this text from the Cerity Information window to the OPC Information window in the Cerity Information column. Type the name of the corresponding tag in the OPC Tag column.
9. Save the configuration by going to the OPC Configuration Storage menu and selecting Save OPC Configuration. The finished configuration is shown in Figure 7.
For detailed information on selecting the data to be transferred, refer to the OPC online help.

Figure 7: Example of OPC Configuration Setup
Using Cerity Chemical Software
1. Open the Cerity Networked Data System program. Go to the Method panel and set up the Cerity method CerityTest as shown in Figure 8. Use the same method name that was used in the Cerity Chemical OPC Configuration.Note: You may need to increase the virtual memory on your computer to be able to use this program. 2. From the Method panel, select the General tab to set up the Post-Run Program.
3. Check the Post-Run Program checkbox.
4. Check the Wait For Completion checkbox.
5. Enter the path of the OPC Configuration Utility. Select the Browse box, and browse to the location of the utility to accomplish this. After you have browsed to the location, edit the path to include quotation marks before and after the path, as well as the following statement (exactly as shown):
[%INST_TYPE%] [%INST_SN%]
This statement must include a space before the first parameter and in between the parameters. The following is an example of the full path:
C:\Program Files\Agilent\Cerity QA-QC\OPC\CerityChemicalOPCCommunications.exe [%INST_TYPE%] [%INST_SN%]
6. Switch to the Acquisition tab. Set up the parameters for the acquisition to follow.
7. Click the Injector Parameters button, and make sure that it gives the injector type as Current Injector Source: ***Injector Tower*** as shown in Figure 9.
8. Click the Oven Parameters button. If necessary, change your oven ramp times on this panel. The purpose of this tutorial is to demonstrate the connectivity between Cerity and the LabVIEW DSC module, therefore we have set the initial ramp to 5 minutes and set the other ramps to 0 minutes to decrease the time spent waiting for a sample. In normal circumstances, you would set these times based on the data you are acquiring.
9. Save your changes to the method. Go to the Sample panel and give your sample a name. Choose the Method and Instrument that you have previously set up in the OPC Configuration Utility. Check the Increment Sample Name box, and click the Log Sample button. An example of this setup is shown in Figure 10. Go to the Work List tab on the Instrument panel, select your current instrument, and see a list of the samples that have been logged. Click Start to run the logged sample. In Figure 11, the logged sample Test 3 has already been run. Samples that are waiting to run are shown below the Current position. Once the logged sample has been run, the Post-Run program is called to send the configured data to LabVIEW via OPC. Figure 12 shows the data that LabVIEW has received via OPC from the Sample Test 3. The LabVIEW program can be modified to process and analyze the data it receives; as it is currently set up, it displays only the data.

Figure 12: Sample Received by the LabVIEW DSC Module
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).






