LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert single scalar value into an array for plotting graph

Solved!
Go to solution

I am trying to plot a graph of power factor vs output power. But my power factor shows single scalar value (DBL) and output power is 1d array of scalars. suggest me some way to plot 'output power(Pout) vs power factor(pf)'

Download All
0 Kudos
Message 1 of 7
(4,753 Views)

Your issue is more likely why you have a scaler for the power factor and not an array.  The indicator states that it is an average.  Could you not perform the average and therefore give you an array?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(4,740 Views)

all 3 pf values are single scalar because I have used electrical power module to find the value and it is a result of a single waveform of current and a single waveform of voltage. I will be getting continuous value of this average. Please suggest me some way to plot it, or to convert this into an array

0 Kudos
Message 3 of 7
(4,730 Views)

Please do not attach pictures of code, but attach code (this means the VI itself).  We cannot "execute" pictures to see what your code does, the pictures (like the one you showed) may be incomplete, we can't see all the cases of a Case statement, etc.

 

Crossrulz suggests one way is to not create a scalar.  Of course, we can't "see" the code to understand why you created the scalar in the first place.

 

What do you know about Arrays in LabVIEW?  Do you know about any functions that create arrays?  I can think, right off the bat, of two very common Array functions that are supposed to create an Array from a scalar.  If you don't know about these, then you really need to learn LabVIEW.  Take the tutorials that are mentioned in the upper right part of the LabVIEW Forum's first page.  You cannot program in any language if you don't know the first thing about the Language and its Functions ...

 

Bob Schor

 

 

0 Kudos
Message 4 of 7
(4,714 Views)

My question is crystal clear. 

1. My VI is of data acquisition.

2. The electrical and power pallet provides scalar value of power factor

3. Output power is 1D array of scalars

4. I want to plot Pout vs pf

5. Meaning, I was asking help in the formation of an array using single scalar value which I will get continuously through data acquisition.

6. Sorry for the inconvenience but my question was just "How can I plot my values of power factor (single scalar) with respect to 1D array of scalars.

7. Pout is a calculated value is has no issue while plotting graph.

 

0 Kudos
Message 5 of 7
(4,699 Views)
Solution
Accepted by topic author kunal1261

It will be a really boring plot (a single line at whatever power factor you have), but you could use Initialize Array with the size of the power array.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 7
(4,691 Views)

Hi Kunal,

 

you should mention the addons you use in your VIs…

 

How can I plot my values of power factor (single scalar) with respect to 1D array of scalars.

Both X and Y values have to be provided as array. Point.

 

One way is this:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 7
(4,682 Views)