Tag values can now be collected from external data sources. This eliminates the need to manually re-enter tag values that have been captured and stored in other systems or files, including serial devices, text files, DDE servers, OLE automation servers, OPC servers and ODBC data sources.
Following is an exercise that steps you through the process for collecting tag values from external data sources.
Part A: Collecting Values for a Standalone Tag
(A standalone tag is a tag for which values are collected without any dependency on the collection of data values.)
- Create a folder on your desktop named My First External Data Source.
- Create a text file with a tag value. To do this:
- Open Notepad. (Usually, this is found in Start>All Programs>Accessories.)
- On the first line of the blank Notepad document, enter MyFirstTagValue,. (Ensure you include a comma after the e in Value.)
 - Save the file to the My First External Data Source folder, naming it My First Tag Value.txt.
- Within WinSPC, create the following:
- a. A device named My First Device.
- b. A part named My First Penny.
- c. A variable within My First Penny named Diameter.
- d. A tag within My First Penny named My Tag.
- e. A collection plan named My First Collection Plan.
- Set up My First Device. To do this, double-click My First Device and in the Device Setup dialog box that appears:
- At Device Type, select Text File.
- On the Connection tab, under File to read, leave the This file option selected, click its corresponding Browse button and, in the Open dialog box that is displayed, navigate to and double-click My First Tag Value.txt in the My First External Data Source folder.
 - Click the Reading tab and, on this tab, click the Get Reading button.
 - Click the Mask tab and on this tab.
- Under Locations, in the Type column's second cell, click Data and, from the dropdown list that appears, select Tag.
- In the Location column's second cell, overwrite Data with Tag Value.
- Click the Test button. This causes MyFirstTagValue to be populated into the Value column's second cell.

- Click OK.
- Set up My First Collection Plan. To do this, double-click My First Collection Plan and, in the Collection Plan dialog box:
- Click the Add Characteristics button.
 - In the Characteristic Selector dialog box that appears, expand the Parts/Processes branch, single-click My First Penny, double click Diameter and click OK.
- Click the Tag Options tab and, with My Tag highlighted, click the Browse button to the right of Collect With and double-click My First Device.
 - Click the Collection Plan Options tab and under Tag Prompting Options, check the Prompt for all tag on collection plan load check box.
- Click OK.
- Right-click My First Collection Plan and, from the shortcut menu, select Data Collection.
- In the lower left corner of the Tags dialog box that is displayed, click the Prompt Devices button. This causes MyFirstTagValue to be populated into the Tag Value text box.

- Although normally you would click the Tags dialog box's OK button at this point, since the purpose of this exercise-which is to illustrate the collection of tag value from a device-is accomplished, click Cancel and in the Confirm message box that appears, click Yes.
- Delete My First Device, My First Collection Plan and My First Penny from WinSPC.
- Delete the My First External Data Source folder from your desktop. (You may first need to exit and restart WinSPC in order for this folder to be deleted.)
Part B: Collecting Values for a Linked Tag
(A linked tag is a tag for which values are collected only when a corresponding external data source-one used for the collection of data values-is prompted.)
- Create two folders on your desktop: My Second External Data Source and My Third External Data Source.
- Create three text files, each with a reading. To do this:
- aOpen Notepad, if it isn't already open.
- On the first line of the blank Notepad document, enter .7497,. (Ensure the first digit is preceded by a decimal and the last digit is followed by a comma. Ensure also that no spaces are entered before or after any of the characters.)
- Save the file to my My Second External Data Source folder, naming it my My First Reading.txt.
- From Notepad's File menu, click New.
- Repeat substep b using the value 7501,.
- Save this file to My Second External Data Source folder, naming it My Second Reading.txt.
- Repeat substep d.
- Repeat substep b using the value .7493,.
- Save the file to my My Second External Data Source folder, naming it my MyThird Reading.txt.
- Create another text file, this one with just a tag value. To do this:
- From Notepad's File menu, click New.
- On the first line of the blank Notepad document, enter MySecondTagValue,. (Ensure you include a comma following e in Value.)
- Save the file to my My Third External Data Source folder, naming it my My Second Tag Value.txt.
- Close Notepad.
- Within WinSPC, create the following:
- Two devices: My Second Device and My Third Device.
- A part named My Second Penny.
- A variable within My Second Penny named Diameter.
- A tag within My Second Penny named My Linked Tag.
- A collection plan named My Second Collection Plan.
- Set up My Second Device. To do this, double-click My Second Device and, in the Device Setup dialog box that appears:
- At Device Type, select Text File.
- On the Connection tab, under File to read, select the Any file in this directory option, click its corresponding Browse button and, in the Open dialog box that is displayed, navigate to and select the My Second External Data Source folder and click OK.
- Click the Reading tab and, on this tab, click the Get Reading button.
- Click the Mask tab and on this tab:
- Under Locations, in the second row, overwrite the second occurrence of Data with Diameter.
- Click the Test button. This causes .7497 to be populated into the Value cell to the right of the Diameter cell.
- Click OK.
- Set up My Third Device. To do this, double-click My Third Device and, in the Device Setup dialog box that appears:
- At Device Type, select Text File.
- On the Connection tab, under File to read, leave the This file option selected, click its corresponding Browse button and, in the Open dialog box that is displayed, navigate to and double-click My Second Tag Value.txt in the My Third External Data Source folder.
- Click the Reading tab and, on this tab, click the Get Reading button.
- Click the Mask tab and on this tab:
- Under Locations, in the Type column's second cell, click Data and, from the dropdown list that appears, select Tag.
- In the location column's second cell, overwrite Data with Tag Value.
- Click the Test button. This causes MySecondTagValue to be populated into the Value column's second cell.
- Click OK.
- Set up My Second Collection Plan. To do this, double-click My Second Collection Plan and, in the Collection Plan dialog box:
- Click the Add Characteristics button.
 - In the Characteristic Selector dialog box that appears, expand the Parts/Processes branch, double-click My Second Penny, double-click Diameter and click OK.
- On the Step Options tab, single-click Diameter, if it isn't already highlighted, and on the General sub-tab, at Collect With, select My Second Device.
- Disable the default tests for the collection plan steps. This is being done solely to keep this preparatory setup to a minimum. To do this:
- Click the Characteristic Tests button.
 - In the Test Selection dialog box that appears, under the Subgroup Level Tests, single-click 1pt beyond control limits and then click the Enable Test button.

This removes the green checkmark from beside the 1 pt beyond control limits test, indicating the test is disabled.
 - Repeat the preceding substep for the Out of reasonable limits test under Sample Level Tests and click OK.
- Click the Tag Options tab and on this tab, with My Linked Tag highlighted:
- At Collect With, select My Third Device.
- At Link To, select My Second Device.
- Click the Collection Plan Options tab and, under Device Options, from the Prompt current device on dropdown list, select F12.
- Click OK.
- Right-click My Second Collection Plan and, from the shortcut menu, select Data Collection.
- Once Data Collection loads, press the key. This causes three readings to be collected and the ribbon to scroll.
- Once the scrolling of the ribbon completes, click the data point that is plotted on the chart.
- In the Data Viewer that is displayed, notice the value for My Linked Tag is My Second Tag Value.
- Exit Data Collection and delete My Second Device, My Third Device, My Second Penny and My Second Collection Plan.
- Delete the My Second External Data Source and My Third External Data Source Folders from your desktop. (You may first need to exit and restart WinSPC in order for these folders to be deleted.)
|