DFD Save to Text File VI

Digital Filter Design VIs and Functions

DFD Save to Text File VI

Owning Palette: Utilities VIs

Installed With: Digital Filter Design Toolkit

Saves a filter to a text file in XML format.

Use the DFD Load from Text File VI to load the filter from the text file.

Note  This VI uses periods for decimal points in the coefficients values.

Details  Examples

 Place on the block diagram  Find on the Functions palette
filter in specifies the input filter.
file path in specifies the path to the file in which you want to save the filter. The default file extension is .xml. You can use any other file extension for the file. If file path in is empty (default) or <Not A Path>, this VI displays a dialog box from which you can select a file. This VI returns an error if you specify a file path that does not exist or if you click the Cancel button on the dialog box. Use the DFD Load from Text File VI to load the filter from the text file.
comments specifies the comments that you want to add to the text file.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source specifies the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.
filter out returns the filter in unchanged.
file path out returns the path to the file to which this VI saved the filter.
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.

DFD Save to Text File Details

This VI saves a filter as an .xml file by default. The following table lists the tags that the .xml file might contain.

Tag Name Description
DFDTData Contains the entire information about a filter.
CustomerComments Contains the information you specified in the comments input of this VI.
Order Contains the filter order.
Structure Contains the filter structure.
Coefficients Contains the floating-point filter coefficients. If the filter is a fixed-point filter, this tag contains the coefficients of the reference floating-point filter. Depending on the type of filter you specified in the filter in input, this tag can contain the following sub-tags:
  • FIRCoefficients—Contains the coefficients of the filter if the filter has a finite impulse response (FIR) structure.
  • ForwardCoefficients—Contains the forward coefficients of the filter if the filter has an infinite impulse response (IIR) Direct Form structure.
  • ReverseCoefficients—Contains the reverse coefficients of the filter if the filter has an IIR Direct Form structure.
  • NumberOfSections—Contains the number of sections in the filter if the filter has an IIR Cascaded Second-Order Sections Form structure.
  • SecondOrderSectionsCoefficients—Contains the second-order section representation of the filter if the filter has an IIR Cascaded Second-Order Sections Form structure. This tag contains an L-by-6 matrix, where L is the number of rows of the matrix. Each row of the matrix contains the coefficients of one filter section in the form [b0 b1 b2 1 a1 a2].
  • ReflectionCoefficients—Contains the reflection coefficients of the filter if the filter has a lattice allpass, lattice auto-regressive (AR), lattice moving average (MA), or lattice ARMA structure.
  • LadderCoefficients—Contains the ladder coefficients of the filter if the filter has a lattice ARMA structure.
  • Gain—Contains the filter gain that corresponds to the filter coefficients.
ZeroPoleGain Contains the floating-point zeroes, poles, and filter gain. If the filter is a fixed-point filter, this tag contains the zeroes, poles, and filter gain of the reference floating-point filter. This tag contains the following sub-tags:
  • Zeroes—Contains the zeroes of the filter.
  • Poles—Contains the poles of the filter.
  • Gain—Contains the filter gain that corresponds to the zeroes and poles.
FXPInformation Contains the entire information about the fixed-point filter. If the filter is a floating-point filter, this XML file does not contain this tag. If the filter is a fixed-point filter, this tag can contain the following sub-tags:
  • FXPCoefficients—Contains the fixed-point filter coefficients. This tag contains the same sub-tags as the Coefficients tag.
  • IntegerCoefficients—Contains the integer filter coefficients. This tag contains the same sub-tags as the Coefficients tag.
  • FXPZeroPoleGain—Contains the fixed-point zeroes, poles, and filter gain. This tag contains the same sub-tags as the ZeroPoleGain tag.
  • Quantizers—Contains information about the filter coefficients quantizer and filter gain quantizer. Each quantizer corresponds to a sub-tag, except the NumberOfSections sub-tag, in the Coefficients tag. Each quantizer contains the following sub-tags:
    • WordLength—Contains the word length of the quantizer.
    • IntegerWordLength—Contains the integer word length of the quantizer.
    • OverflowMode—Contains the overflow mode setting of the quantizer.
    • RoundingMode—Contains the rounding mode setting of the quantizer.
    • Signed—Indicates the quantizer uses a signed fixed-point format. This tag is always empty.
    • Unsigned—Indicates the quantizer uses an unsigned fixed-point format. This tag is always empty.
    Note  If the gain processing occurs on a host machine, or if the gain processing occurs on a target but the filter gain is a power-of-2 value, the filter gain quantizer contains the following message only: No integer gain is processed on the target.

Examples

Refer to the following VIs for examples of using the DFD Save to Text File VI:

  • Export FIR Coef to Xilinx COE File VI: labview\examples\Digital Filter Design\Fixed-Point Filters\Single-Rate

     Open example  Browse related examples

  • Export SOS Coef to MathScript VI: labview\examples\Digital Filter Design\Getting Started\Apply Filters

     Open example  Browse related examples

  • Export SOS Zero-Pole-Gain to MathScript VI: labview\examples\Digital Filter Design\Getting Started\Apply Filters

     Open example  Browse related examples

  • Save and Load Filter to and from Text File VI: labview\examples\Digital Filter Design\Getting Started\Apply Filters

     Open example  Browse related examples