Create a plugin. To create a plugin, you need to use either one of our Visual Studio templates or create a new project using
the .NET language of your choice. To create a C# plugin from scratch, you first need to create a new, empty C# project. Once
you create your project, add references to ScopeSupportBase, TekScriptingEngine, System.Data, System.Data.DataSequence,
System.XML and System.Xml.Linq. In your code, use System, System.Collections.Generic, System.Linq, System.Text, and
Tek.Scope.Support.
There are no requirements for the name of the class or namespace the plugins use. In this example the namespace is
MyMathPlugins and the class name is MyMath. The plugin function is a public, static function inside the class with the math
attribute. We call our plugin Add, and it takes two INormalizedVectors as input and produces an INormalizedVector.
namespace MyMathPlugins
{
class MyMath
{
// Add(<wfm>, <wfm>):
// This plugin adds two INormalizedVector inputs
[Math]
public static void Add(ISettings settings, IRange gate, INormalizedVector output, INormalizedVector input1,
INormalizedVector input2)
{
// We only want to add up to the shorter input length
if (input1.Count < input2.Count)
{
output.Count = input1.Count;
output.Horizontal.Spacing = input1.Horizontal.Spacing;
output.Horizontal.ZeroIndex = input1.Horizontal.ZeroIndex;
}
else
{
output.Count = input2.Count;
output.Horizontal.Spacing = input2.Horizontal.Spacing;
output.Horizontal.ZeroIndex = input2.Horizontal.ZeroIndex;
}
// Add two inputs together
for (long i = 0; i < output.Count; i++)
output[i] = input1[i] + input2[i];
}
}
}
Oscilloscope reference
DPO70000SX, MSO/DPO70000DX, MSO/DPO70000C, DPO7000C, and MSO/DPO5000B Series 713