05-08-2013 04:31 AM
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
05-08-2013 04:48 AM
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
05-08-2013 06:24 AM
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
05-08-2013 11:24 AM
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