Distributed Control & Automation Framework (DCAF)

Showing results for 
Search instead for 
Did you mean: 

DCAF Polynomial Scaling and Scaling Framework Documentation



The DCAF Scaling Framework provides all hooks needed for custom scaling modules within DCAF.  This is the abstract component that all concrete scaling implementations inherit from.  The DCAF Polynomial Scaling module is one such implementation to both handle the most common use case and serve as a model for how to extend the DCAF Scaling Framework with your own custom scale type.



 Frequently there is a need for users to convert data acquired from a measurement system into engineering units suitable for use in modelling, processing, logging, or display.  This framework provides all of the necessary infrastructure to support creation of custom scaling modules, including a common configuration interface and runtime code to perform the scaling.  Child classes need implement only a subpanel in the configuration editor where the specific scaling parameters are entered and override a dynamic dispatch runtime method to perform the actual scaling calculation.


Configuration of Scales

All Scaling modules share a common interface, shown below.scaling parent.PNG

 The Scales control on the left permits creation, deletion, and renaming of scales.  Each scale will have its own configuration, consisting of two parts, Mappings and Scaling Configuration, each of which has a separate tab.  


The Mappings tab is common for all scales, and defines the data type and mapped tag of the input as well as the output.  Each scale can be reused many times with different mappings.  For example, to apply the same scaling factors to eight channels of an input module, create one scale and define eight mappings (one for each channel).  


The Scaling Configuration tab contains the specific configuration for the type of scale module you're working with.  In the case of a Polynomial Scale module, it allows input of an array of polynomial scale factors.  If you create your own custom scaling module, you'll need to implement the small editor page contained within the subpanel on this tab.  See the Polynomial Scale module source code as an example of what to do.  If you'd like detailed instructions, please contact the DCAF developers by posting on this page.  We'll be happy to write up a document if there is interest.


The Scaling Configuration tab for the Polynomial Scaling module is as shown below.  The module accepts polynomial coefficients that will be applied to a polynomial evaluation of the input signal.  The page displays the polynomial formula and a quick graph to visualize the scale.


poly scale.PNG


Each scale defined in the Scales column on the left side of the editor page has one Scaling Configuration and potentially many Mappings.  If you are using the same scale factors on multiple channels, don't create multiple Scales, create one Scale and create multiple mappings using the same Scaling Configuration.  This optimizes performance by limiting the number of calls necessary.  Further performance enhancement is possible if all mappings have the same data type. 


Only have one instance of a particular scaling module in a particular engine.  Having multiple Polynomial Scaling modules defined in a single engine will function identically to, but run slower than, having one Polynomial Scaling module with multiple scales defined inside of it.



  • Tested on cRIO 9033 and 9068.  Polynomial scaling calculations use a standard LabVIEW polynomial evaluation function which is known to work well.
  • No known issues.

Software Requirements

  • LabVIEW 2014 or higher

Hardware Requirements

  • Supported on Windows and Real-Time controllers


  • Does not include a notion of units that follows the tag, this module acts as a value transform only.
  • Currently use of this module requires that for every scale operates on an input tag and writes to a different output tag.  This means that users of this module end up needing to have twice as many tags to manage (for example: TC0 and TC0_scaled).  Since DCAF enforces a single-writer paradigm to eliminate race conditions, the scaling module can't write to the same tag as the input.

Additional Uses

  • This module can also be used for data type conversion.  For example, an input tag of type I32 can be converted to a DBL by applying a unity scale (i.e., scale by a factor of 1).  This can act as a shim between two modules that have mismatched data type needs (a module that outputs an I32 value cannot normally map this to a module that expects a DBL input).



Install the DCAF Polynomial Scaling module directly from VI Package Manager.  This will include the DCAF Scaling Framework as a dependency.




Please post issues on this module's Github repository.


Visit Collaborating on the Development of DCAF to learn how to contribute your own improvements to this module directly.



Matt Pollock
National Instruments
Message 1 of 1