beautypg.com

Saving and compiling the project – Rockwell Automation FactoryTalk Historian Classic User Guide User Manual

Page 151

background image

Creating RSBizWare Custom Analysis Tools Chapter 7

// to caller

CreateVariantDoubleArray(xOut, xInSize, xOutArray);

CreateVariantDoubleArray(yOut, xInSize, yOutArray);

6. Having completed the data algorithm, the only thing left to do

is to clean up the temporary variables used during the
computations. Make sure that you use the array delete
operator (

delete[]

) when deleting the temporary arrays,

otherwise your custom analysis tool will leak memory each
time it is run.

delete [] xOut;

delete [] yOut;

delete [] xIn;

delete [] yMinIn;

delete [] yMaxIn;

delete [] countIn;

The full

Calculate()

function along with the entire sample project

is installed with RSBizWare in the \Program Files\Rockwell
Software\RSBizWare\RSBizWare Calculators\C++\NegativeC

directory. You should refer to this sample project to see the exact
form of the code in the

Calculate()

function.

There is one more piece of functionality you need to add to the
custom analysis tool DLL. Earlier, you saw how instances of
RSBizWare custom analysis tools belong to something called a
COM Category. To make sure the new custom analysis tool registers
as part of the category, do the following:

1. Copy the Register.h and Register.cp p files from the utility

directory (\Program Files\Rockwell

Software\RSBizWare\RSBizWare Calculators\C++\utility,
by default) to your project's source directory.

2. Add the Register.cpp file to your project's Source Files (by

right-clicking the Source Files folder, selecting Add Files to

Folder from the shortcut menu, and selecting the file).

Saving and Compiling the
Project

Rockwell Automation Publication HIST-UM001K-EN-E-June 2014

151