Jump to content


Photo
- - - - -

Remove a zero array


  • Please log in to reply
8 replies to this topic

#1 Ano Ano

Ano Ano

    Very Active

  • Members
  • PipPipPip
  • 97 posts
  • Version:LabVIEW 2010
  • Since:2009

Posted 09 May 2012 - 02:34 PM

Hello,

I am aquiring data from 8 channels (4 devices) so in order to plot them I added a build array (see attached picture) and created a 2d array. If one or more devices are switched off or disconnected this will create an array full of zeros (column H).

How can I avoid this?

Attached Thumbnails

  • Array.jpg


#2 Antoine Châlons

Antoine Châlons

    The 500 club

  • Members
  • PipPipPipPipPip
  • 589 posts
  • Location:France
  • Version:LabVIEW 2012
  • Since:1999

Posted 09 May 2012 - 03:08 PM

Quick answer could be something like this :

Example_VI.png

But maybe you could change your whole application to only acquire the data you're going to plot.
Can you show how you setup your data acquisition?

Hope this helps

____________________________
most boring end of the world ever!


#3 asbo

asbo

    I have no idea what you're talking about... so:

  • V I Engineering, Inc.
  • 1,273 posts
  • Version:LabVIEW 2011
  • Since:2008

Posted 09 May 2012 - 03:11 PM

Don't turn the device off? You should describe what your ideal outcome is. What you probably should do is conditionally disable plots on your graph.

#4 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Premium Member
  • 1,973 posts
  • Location:Netherlands
  • Version:LabVIEW 2012
  • Since:2000

Posted 09 May 2012 - 05:40 PM

I would use an array of waveforms instead of a 2D array, using an array of waveforms you can have an empty waveform.

Ton

#5 JamesMc86

JamesMc86

    Very Active

  • NI
  • 198 posts
  • Location:UK
  • Version:LabVIEW 2012
  • Since:2006

Posted 09 May 2012 - 09:21 PM

Ton's solution should work well. What this comes down to is needing an array of arrays. By luck Darren Natinger posted a nugget on this today (which is essentially the same as Ton's solution): http://forums.ni.com...012/m-p/1984521

James McNally

AE Specialist, NI UK & Ireland & CLA


#6 Stagg54

Stagg54

    Very Active

  • Members
  • PipPipPip
  • 60 posts
  • Version:LabVIEW 2009
  • Since:2007

Posted 09 May 2012 - 09:40 PM

My suggestion is similar to Tons. I just use an array of cluster, where each cluster contains just an array.

#7 Stagg54

Stagg54

    Very Active

  • Members
  • PipPipPip
  • 60 posts
  • Version:LabVIEW 2009
  • Since:2007

Posted 10 May 2012 - 12:01 AM

I should have read Darren's article first, because that is exactly what he suggested.

#8 Ano Ano

Ano Ano

    Very Active

  • Members
  • PipPipPip
  • 97 posts
  • Version:LabVIEW 2010
  • Since:2009

Posted 15 May 2012 - 08:56 AM

Thank you all for your replies,

Ton's idea works but I notice a "display delay" when the waveform array data appear on the chart. When the 2d array is connected to the chart the data appear to move faster.

Darren's article is very interesting, how do I plot an array of clasturs of arrays into a chart?

Antoine's idea creates zero columns like 1 & 2 where as I would like to create columns like 3 & 4:

#9 Prabhakant Patil

Prabhakant Patil

    More Active

  • Members
  • PipPip
  • 45 posts
  • Version:LabVIEW 2010
  • Since:2004

Posted 09 July 2012 - 05:58 AM

Check attached file.
I have generated data and also removed zero from the data.

Attached Files