LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

plot graph using two arrays

Solved!
Go to solution

I have two array with 50 elements. I tried to plot an xy graph using these two arrays. but graph is not coming... can anyone help me??

0 Kudos
Message 1 of 6
(8,080 Views)

I think you are winding up with 50 single point plots in your final graph which is why you aren't seeing anything.

 

You need to rework your VI.  I don't understand what you are trying to do with the array manipulations.  They are a mess.  You are Initializing empty arrays.  Then using Insert Array to put in new data.  (Note Insert Array is almost always the wrong function to use.  Build array is the correct function 99.9% of the time).

 

Then auto-indexing that to build a 2-D array.  Then using Build array to turn that into a 3-D array.  Then turning that huge array back into a scalar with Sum Array. (Which makes the 2-D to 3-D conversion completely pointless.) Then repeating that process all over again with another Initialize an Empty Array and Insert into Array contraption.  Then Concatenating those 3 arrays together, then auto-indexing that into another 2-D array.

 

It seems like you are trying to use as many functions in the array palette as you can without knowing what you are really trying to do or how those functions work.

 

I suggest deleting that VI. Take some online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

 

Then start over.

 

If you want some more help, you will need to give some idea of what you are expecting your data to look like in the end.

Message 2 of 6
(8,063 Views)

sir,

   First of all thank you for your reply....i just want to add some data into two array from for loop and plot them using XY graph.... I am new to labview . So I have problem with array...How to add data to array one by one and plot two array after adding values??  can u please reply. 

0 Kudos
Message 3 of 6
(8,040 Views)
Solution
Accepted by ef.manu

Use Build Array to put new values onto an existing array at the end.  Store the array between iterations of your For Loop using shift registers.

 

Message 4 of 6
(8,020 Views)

Total noob here. Please forgive my ignorance. I am trying to teach myself LabView by looking at sample .vi's. Many wonderful people seem to be so helpful. However, when I see a picture as above with icons and no description, it takes me hours to find the icon of each in a menu. Sometimes I cannot find it. As a result, I am left without an explanation. Am I going about this all wrong? Is there a secret way to translate such images? Thanks in advance.

0 Kudos
Message 5 of 6
(7,239 Views)

This image above is a snippe.  (You can tell by the header information being present at the top of the image.)  Drag the image from your browser to your desktop to create a .png file of that image.  Then drag that image file to a blank block diagram.  (I believe Internet Explorer lets you drag directly.)  Now the code in that image will be recreated in your VI. 

 

Now that you've got the code, turn on context help with Ctrl-H and hover over the functions you are not familiar with to learn what they are.

 

Also, be sure to spend free time that you have just browsing through the palletes to gain familiarity with how they are organized and what functions there are.

Message 6 of 6
(7,233 Views)