Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Phasor Diagram with .NET Graph Controls

Solved!
Go to solution

I would like to have something similar to the phasor diagram shipped with Electrical Power Controls and I wonder if anyone was able to do the phasor diagram with .NET graph controls? NI has not shipped a built-in phasor diagram control but I guess someone with strong knowledge of measurement studio may be able to create have something with .NET graph controls.

 

vector_diagram.gif

0 Kudos
Message 1 of 5
(6,069 Views)
Solution
Accepted by topic author rle2

Measurement Studio does not have a control specifically targeted to this scenario, but the PolarGraph can be adapted to act as a phasor diagram using a custom renderer. I have attached a small example project that shows one way to accomplish this.

 

PhasorDiagram.png

~ Paul H
Message 2 of 5
(6,033 Views)

Thanks, phansen.  I am a Winform guy so I did not pay attention to WPF controls and I missed this.

0 Kudos
Message 3 of 5
(6,013 Views)

A qui


@phansen wrote:

Measurement Studio does not have a control specifically targeted to this scenario, but the PolarGraph can be adapted to act as a phasor diagram using a custom renderer. I have attached a small example project that shows one way to accomplish this.

 

PhasorDiagram.png


A very quick question - if I want to have the 

ScaleKind="Degrees" 

 How should I create the data range for Plot 1, Plot 2, and Plot 3? 

 

 

0 Kudos
Message 4 of 5
(5,999 Views)
Solution
Accepted by topic author rle2

Unfortunately, the PolarGraph does not yet support automatic conversion of radian data to degrees (there is an existing task to implement this in the next release of Measurement Studio).

 

As a workaround, you can convert the data to degrees before sending it to the graph. In the example project, updating the main window constructor with the following conversion logic (in addition to the ScaleKind="Degrees" change you mentioned) will show the original data against a degree scale:

 

var converted = new Point[data.Length];
for( int i = 0; i < data.Length; ++i ) {
    ComplexDouble value = data[i];
    converted[i] = new Point( value.Phase * 180.0 / Math.PI, value.Magnitude );
}

graph.Data.AddRange( converted.Cast<object>( ) );

 

~ Paul H
0 Kudos
Message 5 of 5
(5,995 Views)