LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Any tool to create a 2D array from a curve ?

Creating a graph from a 2D array is easy - be it LV or Excel. 

 

Was just wondering if there is any tool that can create the  2D array given the graph … either in LabVIEW native or third party ? Or am i being very ambitious Smiley Very Happy

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 11
(2,810 Views)

Where are you getting the graph from?  Is it in LabVIEW?

 

Graphs contain the data, so just get the data from the source.

0 Kudos
Message 2 of 11
(2,808 Views)

 


@RavensFan wrote:

Where are you getting the graph from?  Is it in LabVIEW?

 

Graphs contain the data, so just get the data from the source.


Smiley Very Happy

 

Actually this is a profiling tool for an analog input to a V-I controller. ( A 0-5V input is converted to 0-3000mA output ) 

 

The first basic profile is created by manual entry of values to an array … something like 250 values.  And during fine tuning there is a situation where we know how the profile should be like but getting the exact numerics to get that profile is the issue. Takes lots of trial input. The profile has many different slope parts ,,, so the requirement. 


 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 3 of 11
(2,789 Views)

So you need a tool to edit a graph, and then use the values? Something like a profile editor?

 

Where does the 2D come from? Sounds like 1D to me...

0 Kudos
Message 4 of 11
(2,775 Views)

THe curve fitting VIs will return a "best fit" curve along with the polynomial coeef.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 11
(2,769 Views)

@MogaRaghu wrote:

Creating a graph from a 2D array is easy - be it LV or Excel. 

 

Was just wondering if there is any tool that can create the  2D array given the graph … either in LabVIEW native or third party ? Or am i being very ambitious Smiley Very Happy


The term "2D array" is way too generic to suggest anything helpful, because you did not tell us the meaning of the array elements and their arrangement.

 

  • Is it an array with two rows (or columns) and N columns (or rows, resp.)?
  • Is it a bitmap with nonzero elements where the mapped row/column indices describe the curve?
  • something else?

 

Similarly, if you say "graph" we have no idea what that means.

 

  • Could be an waveform graph with x spaced equally and defined with x0 and dx.
  • Could be an xy graph with the data being a (1) 1D complex array, (2) an array of point clusters, or (3) a cluster of an x and y array, or higher versions of same.
  • Could be an intensity graph as described above.
  • ...something else...

 

If you could show us the apparently "easy" part of how you "create a graph from a 2D array" (sic), we can probably figure out what you are actually trying to do and help you create code that does the reverse operation. Can you attach that easy VI? Thanks!

0 Kudos
Message 6 of 11
(2,761 Views)

Since it appears that the graph can mean so many things let me clarify:

1. The Y Axis varies from 0 to Ymax. Typical value for Ymax is about 3.0

2. The X Axis is in the pattern X0 and dX. Equally spaced time intervals. 

 

See the attached sample. This is the base. Now depending on need the user needs to have a flexibility to "pull " the curve at the points shown as an example. It is not ONLY these points but shown to show the idea.

 

So starting with this X-Y plot the user must be able to modify the profile and that value should reflect in the Array. 

 

SampleGraph.JPG

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 7 of 11
(2,732 Views)

 


wiebe@CARYA wrote:

So you need a tool to edit a graph, and then use the values? Something like a profile editor?

 

Where does the 2D come from? Sounds like 1D to me...


Sorry about that 2D stuff. My mistake. 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 8 of 11
(2,727 Views)

Hi Moga,

 

Now depending on need the user needs to have a flexibility to "pull " the curve at the points shown as an example. It is not ONLY these points but shown to show the idea. So starting with this X-Y plot the user must be able to modify the profile and that value should reflect in the Array.

So you want to create a profile editor, as written before!

Create a user interface containing a (waveform) graph. Use the cursor(s) in this graph to let the user move points in a plot. Use cursor/mouse events to handle user input and to change the underlying plot/array data as needed…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 11
(2,717 Views)

Hi GerdW,

Thanks. I think this is almost what I wanted,

Based on your hint I have created a VI and reached up to the point of getting the cursor location.  But got stuck here as I am not sure how to  get the new value into the original array. I have no Index to search and insert the new value … or maybe I am missing something here. Smiley Sad

 

Attaching the VI that I managed to do so far ( which is not much anyway !)  Will need some tips to close out.

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 10 of 11
(2,699 Views)