GETCOMPLEXSERIES

Purpose:

Retrieves complex data from a command, Window or variable as two SafeArrays from DADiSP’s ActiveX Automation Server.

Syntax:

[out] INT result = GetComplexSeries(

[in] BSTR "name", [in, out] SAFEARRAY(double) *real, [in, out] SAFEARRAY(double) *imag, [in] INT form)

"name"

-

A string, the name of the source Window or variable to retrieve.

real

-

A SafeArray, the destination array for the real or magnitude part.

imag

-

A SafeArray, the destination array for the imaginary or phase part.

form

-

An integer. The complex form of the returned data.

0:

Real / Imaginary

1:

Magintude / Phase

Returns:

An integer, 1 if successful.

Example:

Visual Basic Example:

 

Dim DADiSP as Object

Dim VBData(1000) as Double

Dim RealData() as Double

Dim ImagData() as Double

 

’’’ Create VB data array

For i = 0 To 1000

    VBData(i) = Rnd() 

Next i

 

’’’ Connect to DADiSP

Set DADiSP = CreateObject("dadisp.application")

 

’’’ Create a 2 Window Worksheet without prompting

Call DADiSP.Execute("newworksheet(2, 0)")

 

’’’ Put VB array in W1

Call DADiSP.PutSeries("W1", VBData)

 

’’’ Label W1

Call DADiSP.Execute("label(W1, 'Data from Visual Basic')")

 

’’’ get complex series in real /imag form

Call DADiSP.GetComplexSeries("sqrt(W1-mean(W1))", RealData, ImagData, 0)

 

’’’ show it

DADiSP.Visible = 1

 

 

Starts DADiSP as an ActiveX Automation server, creates a 2 Window Worksheet and places 1001 random samples from Visual Basic into W1. The Window is labeled. The mean of the data is removed and the square root of this series returned. Since some of the zero mean values are negative, the resulting square root series is complex. The real part of the array is returned in RealData and the imaginary part is returned in ImagData.

 

If form was set to 1, RealData would contain the magnitude part while ImagData would contain the phase part.

Remarks:

If the real SafeArray is empty, GetComplexSeries creates an array of the appropriate size. An empty array can be specified in Visual Basic with a declaration such as:

 

Dim MyArray() as Double

 

If the imaginary SafeArray is empty and the real array is not empty, the imaginary part is not returned.

 

If the SafeArray has been allocated, the array is filled only up to the number of allocated rows and columns.

 

GetComplexSeries explicitly retrieves the data as a SafeArray. See GETCOMPLEXDATA or GETDATA to return a variant data type.

See Also:

CALCULATE

EVALUATE

GETCOMPLEXDATA

GETDATA

GETFULLMATRIX

GETSERIES

PUTCHARARRAY

PUTDATA

PUTFULLMATRIX

PUTSERIES