About DSOFilter

In addition to the seven popular filter types provided with DFP, custom designed filters can be also created and used. The DSOFilter which is an Active x control was designed to help to load these filter coefficients into LeCroy DSOs.

DSOFilter can be employed in two ways:

1.	Using a filter design and math program such as MathCad® or MATLAB®. First, filters are designed with the math program. Then, the coefficients can be loaded directly into the oscilloscope with DSOFilter utility.

2.	Specify the filter coefficients on an Excel spreadsheet and load them directly into oscilloscope with DSOFilter utility.

The coefficients can be sent to the oscilloscope via a GPIB, RS232 or a 10/100 Base- T Ethernet connection, if available. (Check the Excel example for details)

It is also possible to copy the coefficients to a diskette and then move the diskette to the oscilloscope.


System Requirements

Personal Computer running Windows 95, Windows 98, Windows 2000, or Windows NT (Intel, v3.51 or later).

·	GPIB interface card (National Instruments ‘TNT’ card is recommended) running 32-bit drivers. (see note 3)

Or

·	Standard RS232 port (see diagram below for wiring details)

Or

LeCroy DSOs including the LC, LT oscilloscopes and the DDA

(With the Ethernet 10/100 Mb/s LAN option - when available)

DB-9 to DB-9 Null-Modem cable wiring (see note 4)

A cable constructed using the following wiring diagram may be used to control a LC/LT DSO from a standard PC using the RS232 port.

Description	DB-9 MalePin #	DB-9 MalePin #	Description

DCD+DSR	1 and 6	<->	4	DTR

RxD	2	<->	3	TxD

TxD	3	<->	2	RxD

DTR	4	<->	1 and 6	DCD+DSR

Gnd	5	<->	5	Gnd

RTS	7	<->	8	CTS

CTS	8	<->	7	RTS

Notes:

•	When using DSOFilter and the PC communicates with a LeCroy oscilloscope via the RS232 serial port, It is recommended to close all other running programs, which use the same serial connection.

•	In order to communicate with LeCroy oscilloscopes via a serial connection such as GPIB, RS-232 or Ethernet LAN, the ActiveDSO utility is also required. ActiveDSO can be downloaded free of charge from LeCroy web site at: http://www.lecroy.com

•	Drivers for National Instruments GPIB cards are available for download from www.natinst.com.

•	ScopeExplorer uses the scope in Hardware Handshake mode and therefore requires a full Null-Modem cable. A cable that just connects TxD/RxD and Gnd will not function correctly.


Methods

long Connect(BSTR Address);

- Connect to scope;    Address = "GPIB: 5"(most frequently used).

long Beep();

- Make scope beep;

long SetFilter(BSTR destTrace, long numPoints, VARIANT waveformData);

 - destTrace - (M1, M2, M3, M4 or "file: filename")

- numPoints - number of points in filter;

- waveformData - array of single or double variables.


Visal Basic for Applications (Excel)

Here is an example of sending filter coefficients to an oscilloscope from Excel.

(When opening the Excel example, Macros have to be enabled).

On the spreadsheet, a low pass filter with 200 coefficients is specified. In this example, the PC is connected to the oscilloscope via a GPIB connection. Press the "Make Scope Beep" button to check this connection. The beep will be heard after a few seconds.

Now, after assuring that the connection works properly, the coefficients may be send. First, a destination must be specified (such as memories M1-M4 in the DSO). It is also possible to send the coefficients to a file. In this case a filename must be specified.

Note: If other then GPIB serial connection between the PC and the oscilloscope are used, (such as RS-232 or Ethernet 10/100 Mb/s), GPIB: 5 should be modified to the correct connection type.

In case of RS232

•	COM1: 19200,8,N,1   (COMn: baud, bits, parity, stop)

In case of LAN (Ethernet 10/100)

•	IP: 128.211.87.234    (IP: a,b,c,d)

Press the "Put Filter" button to send the list of coefficients. Upon completion, the beep is activated again.

Number of Points: If Manual number of points is set to 0, the Automatic number is determined by the number of coefficients. However, if the Manual amount of coefficients is set to other then 0, it overrides the Automatic setting, making it possible to examine the results with only a limited amount of coefficients before employing the full filter.

Notes: 	The chart is used only as a display tool. It shows the filter in time domain but it has no influence on the operation.

You may simply replace the coefficients in the example with your filter's coefficients.


Visual Basic Script (Mathcad)

Example of sending FIR Coefficients to a LeCroy DSO Using the LeCroy DSOFilter Control

(The following example uses Mathcad 2000)

i := 0..200

sinx(x) := sin(x)/x

200 point sin(x)/x, a low pass filter

Note: real filters would either be windowed, or made by the Remez exchange algorithm.  The point of this

example is not to make a good filter, but to show how to transfer a filter to the scope.

check

 = 0.987    This is the DC gain of the filter

To send it, we need to include the LeCroy DSOFilter Control, which is an Active X control,

as a Scriptable object.  Remember the Name you specify for this instance of the

ActiveX control.  Mathcad acts as an ActiveX Scripting Host. It makes the methods of

the object available using the Name you specified.  It invokes a VBScript interpreter

(because this example uses VBScript as the scripting language) and calls three routines:

ScriptObj_Event.Start(), ScriptObj_Event.Exec( Inputs, Outputs), and SciptObjec_Event.Stop()

Mathcad calls these three in order when calculating.  Mathconnex can Start followed by 0, 1 or many invocations of Exec, followed by Stop.

Details follow.

To make the connection to the ActiveX control choose Insert , Component, Scriptable Object; click Next.

Check "New" and select "LeCroy DSOFilter Control" from the list.  (If you don't see it,

the control has not been installed).  Click Next.

Select "VB Script Language".  This tells Mathcad, the scripting host, which interpreter

to load.  Click Next.

Give this object a Name.  For this example, accept the default name "ScriptObj".

The VBScript uses this name to access the object's methods.  For example: SciptObj.Beep().  Set that this object needs 2 inputs from Mathcad and returns no output values.

In this example the two inputs to the script are the coefficient array, and a value specifying the number of points in the array.  The destination is assumed to be M1.  The connection is assumed to be at GPIB address 5.  We could pass in more arguments to relax these assumptions, but that would complicate the script.  The script uses the inputs from Mathcad to invoke the SetFilter method of the object.

DSOFilter

(coefs  201)

The script that is run to connect Mathcad to the DSOFilter Active X control for this example is:

Sub ScriptObjEvent_Start()

  REM Set up - tell the DSOFilter how to talk to the scope

  ScriptObj.Connect("GPIB: 5")

End Sub

Sub ScriptObjEvent_Exec(Inputs,Outputs)

  REM Get the inputs

  numcoefs = Inputs(1).Value

  REM Need numcoefs as Long

  numcoefs = CLng(numcoefs)

  REM Send the coefficients to M1 - have to put them in an array

  Dim coefs(999)

  Dim foo

  foo = inputs(0).value	 ' assign inputs(0).value to a local variable

  For i = 0 to numcoefs-1

    dtmp = foo(i)

    coefs(i) = CSng(dtmp)  ' they can be double, too; but single is enough

  Next

  retval = ScriptObj.SetFilter( "M1", numcoefs, coefs)

  If (retval = False) Then

    MsgBox( "SetFilter returned False - problem")

  End If

  REM Make the scope beep to make sure we got here

  ScriptObj.Beep()

End Sub

Sub ScriptObjEvent_Stop()

  REM Nothing to do for clean-up

End Sub