SWTB_Banner_Left_LogoOnly

OPC DataHub Examples
Scripting

clearpixel

HOME FEATURES FREE
DOWNLOADS PRICING &
ORDERING SUPPORT NEWS ABOUT
US

SWTB_7Button_BlueLine

Data Manipulation Using DataHub Scripting

Modifying data as it passes from one program to another

A consulting company needed a quick and easy way to modify data as it passed from one system to another. They were using the OPC DataHub to connect from an OPC server to a Java based Web display, but due to problems with some of the sensors reading data from the field devices, certain values needed to be cleaned up before they were displayed on the web. A simple DataHub script was written that watches for changes in point values and if any of them read a max off-scale value of say -524455, then the script replaces the value with a zero. This helped to clean up the web display of data and provided the company with a fast and effective way of conditioning the process data to meet their requirements.

070223_Example15

Logging data to a CSV file for off-line analysis

A company in Europe is using the OPC DataHub Scripting capability to collect data from an OPC server and store it as a comma separated value (csv) file. The DataHub script was developed to simply write a new line to the file every time a set of point values changed in the OPC server. The script also does some conditioning on the data before it is written to file, so that alarm event numbers are converted into plain text strings to make it easier to analyze later.

070223_Example16

Writing OPC data to an Access database

A manufacturing company is using the OPC DataHub to write end-of-day statistics into an MS-Access database. A DataHub script is used to write production values to various tables in the Access database. The script is scheduled to run in the middle of the night to avoid conflicts with other database users. Management personnel can now open the Access database and see up-to-date reports based on the previous nights totals.

070223_Example17

 

 | HOME | FEATURES | FREE DOWNLOADS | PRICING & ORDERING | SUPPORT | NEWS | ABOUT US

P: 1-888-665-3678 (US-Sales) or 704-849-2773 (Support & International),F:+1 704-849-6388
148A East Charles Street, Matthews, North Carolina, USA 28105
Copyright Software Toolbox, Inc., 1996-2006, All Rights Reserved Worldwide.
OPC DataHub name, trademarks, graphics, and references used with permission of Cogent Real-Time Systems.
Software Toolbox Inc is the Master Distributor for North America for the OPC DataHub product.