LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using queues to write data in excel

I have a code and it writes data from a DAQ to an excel spreadsheet using queues. The matter is that I need it to display only the columns that need to read. (using slector booleans). I attach an snippet.

 

 

0 Kudos
Message 1 of 3
(2,860 Views)

Sorry this didn't get a response sooner. You can alter the way your consumer loop writes the data to file by altering the data that you send through the queue. I would suggest clustering your data (the array you currently send) with an array of booleans. Then you can unbundle this cluster in the consumer loop before you write to file and use it accordingly. This should allow you to do what you're trying to do.

 

Just to give you some feedback on your code, there are few things that you can improve upon. I'm sure this is a learning process so you probably know a lot more about LabVIEW now than you did when you started.

  • All of your array operations in there can be done much simpler. You have a whole Index Array node that inputs 8-21 in order. This can be done by simply having an 8 at the beginning and dragging the rest down since the indices always count from the previous by default. You are also doing a lot of indexing and re-building of arrays. You should look int o Array Subset VI  and Array To Cluster node to consolidate here.
  • You have a lot of indicators and controls that coudl be consolidated in to array and/or clusters. Your "element 1", "element 2", etc  indicators are all displayed on the front panel next to each other, so why not just display them as an array?
  • You use property nodes in a couple places to read the values. This can be better done by a local variable. Property nodes shouldn't usually be read from continuously.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 3
(2,705 Views)

I also overlooked this earlier post, sorry.  Do you know how difficult it is to look at and understand a VI that requires three monitors across and three monitors high?  And I only have one ...

 

You can save a lot of space by making good use of sub-VIs.  Once the code can be visualized, it can be understood ...

 

Bob Schor

0 Kudos
Message 3 of 3
(2,678 Views)