LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Quick Graph Question

Hi There,

 

This is hopefully just a quick question, but I am having trouble sorting the data representaion on a vi I have put together.  The VI works fine, it loops every 6 seconds or so and takes a distance measurement via some capacitive sensors, but, as you can see from the attached .jpeg, the data is represented as a 'spike' and then returns to zero inbetween data readouts.

 

Is there some way of setting up the graph to simply join the data points together without altering the coding too much?

 

Many thanks in advance for your help.

 

Regards,

Keiran 

Download All
0 Kudos
Message 1 of 4
(2,099 Views)

I cant open your VI right now, but I think you're appending data to your graph array with every read.

what you can do is put your last value in a shift register.  COmpare the new value to the last stored value.

if the new value and the old value are the same and equal to 0, don't add it to your array.

 

This way you will see the spikes after one another.  Do remember your losing the timing, but maybe that does not matter to you

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 2 of 4
(2,092 Views)

Hi kezmondo,

 

do you need the zero-entries?

 

At the moment you use the FOR loop to indicates the 1d Array  Waveform Chart

 

Alternatively you could use "insert into array.vi" in the second case-structure in combination with a shift register to pass through the false cases: see attached .png

 

 

 

Unfortunately I can't test this vi

 

Notice: I moved the "build arry.vi" from the first to the second case structure

 

 

 

 

Alex

0 Kudos
Message 3 of 4
(2,076 Views)

Hi Guys,

 

Thankyou both for you prompt replies, this was indeed the route I was thinking I needed to take.  However after implementing your suggestions Alex I still had the same results.

 

I have managed to sort it by 'capturing' each read value as a variable before passing them all at the same time to the graph, as before the vi was reading just one value and feeding zero to all of the rest.  Hope that makes sense

 

Thanks again for all your help guys!

 

Keiran

Download All
0 Kudos
Message 4 of 4
(2,044 Views)