LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading from an array

Solved!
Go to solution

Hi everyone,

i have read a .txt file (printed from matlab as table) into labview as array indicator.

i used array index to send the values from the array to their outputs, like some values connected to DAQ as voltage output, some sent to indicators to just show the value on the GUI some are sent to xy graph to be ploted.

however, the DAQ does not really read the value because the intensity of the LEDs dont really change with changing the value.

the second problem for the xy graph i used the buddle to connect two array indices as x and y and when i connected the buddle to the xy graph it shows diconnected line 😞

any solutions or what is that happening?

thanks in advance 🙂

0 Kudos
Message 1 of 17
(3,540 Views)

Then please show us your code. We cannot tell what's wrong from your description.

 

(Also, are you talking about "bundle" when you say "buddle"?)

When you bundle data for an xy grap, it wants e.g. bundle of two arrays or an array of xy points or a complex 1D array. If you only blndle two array indices, there is no array.

0 Kudos
Message 2 of 17
(3,535 Views)

here is my block diagram. and yeah i mean bundle sorry!

thanks for the reply 🙂

0 Kudos
Message 3 of 17
(3,527 Views)

No, we need to see the actual VI. pictures are useless.

 

As I said you are wiring what looks like a waveform graph to a cluster with two elements. Where's the xy graph you mentioned earlier. Maybe you want to use a chart?

What is the point of the sequence frame?

Index array is resizeable, all you need is a single instance, not eleven.

What's in the false case?

Why do your wires go in all directions?

0 Kudos
Message 4 of 17
(3,510 Views)

hi sorry for the late reply

here is the file

no im ploting points not waveform graph

for each time i change the row number another value of x and a value of y will appear of the color space picture, the points represent the CCT values. i didnt manage yet to make the color space diagram as background of xy graph ( maybe you could help me in that too.) but later these points will indicate to the user which CCT the light spectrum is he/she using.

i couldnt import more than 3 files, in my next reply i will put explaination on the block diagram and the GUI so you understand what im trying to do.

when you run the program please upload the text file you have. and the meaning of each column is shown in the picture attached bellow. please wait for my next reply

thanks

 

0 Kudos
Message 5 of 17
(3,491 Views)

here is the explaination

hope they are clear 

thanks alot!

0 Kudos
Message 6 of 17
(3,484 Views)
Solution
Accepted by arabic

You definitly currently use a waveform graph (even if you label the axes x and y 🐵 First you need to replace with an xy graph, which is very different in datatype.

Do you want to add one xy point whenever you look at a new spectrum or do you want to graph all points (one for each spectrum) at once? That would be easier. If you want to add one point at a time, the "build xy graph express VI" set to "not clear data between calls" is the easiest solution. Otherwise you need to append the new point to an existing array of points kept in a shift register.

 

Also note that sliders have a digital display (right-click...show digital display) so you only need one terminal.

 

Here's a quick rewrite that shows ...

  1. how to use index array more efficiently
  2. How to use an event structure to prevent constant spinning of the loop (Your false case definitely would need a small wait).
  3. how to display the digital display of sliders
  4. How to graph all xy data at once
  5. How to incrementally build the xy graph using a shift register
  6. How to incrementally build the xy graph using a express VI.
  7. I don't have DAQ, so I commented them out.

 

 

0 Kudos
Message 7 of 17
(3,474 Views)

im very new on labview so excuse my bad knowledge.

thank you so much this is what i wanted one point at the time and keep the point

one last question how can i change their colors and set a legend showing which set this point represent? ( the sent number is the same as the spectrum number).

by the way do you know how can i place that color space diagram as a background to the xy graph?

thanks so much!! 😄 

0 Kudos
Message 8 of 17
(3,467 Views)

A plot can only have one color, you would need to create N different plots and define their color. As a simpler alternative, I would recommend mapping the data into an intensity graph instead.

0 Kudos
Message 9 of 17
(3,465 Views)

i will work on that thanks alot!

what about the image? i saw examples online but i couldnt find the elements hahah thats why im lost 😞

0 Kudos
Message 10 of 17
(3,461 Views)