LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview to matlab

Hi all,

 

I am very new to LabVIEW and I was wondering if someone could take a look at my block diagram and explain my problem. The problem I'm getting is that the ASCII file only contains one number: the last number taken by the multimeter. I tried to rectify this by placing the "Save as spreadsheet file" VI in the loop, but then the prompt to enter a file name keeps popping up.

 

[IMG]http://i119.photobucket.com/albums/o126/anandonaqui/agilentblockdiagram.jpg[/IMG]

 

any and all help is appreciated.

0 Kudos
Message 1 of 6
(2,881 Views)
  1. Delete the "built array" node (it will simply convert the single scalar to an array with a single element, as you noticed. It has non memory!).
  2. Right-click the output tunnel and "enable indexing".

 Now the output tunnel will built an array of elements, one element per iteration and then output the final array once the loop has finished executing. It seems that's what you want. Try it! 🙂

Message 2 of 6
(2,870 Views)

Hi anan...,

 

first: please attach your pics here directly in the forum using the "add attachments" '(under the tags line) or by clicking that tree image...

 

Your vi is doing what you have programmed: it saves the last value from the multimeter as you didn't switch on auto-indexing for the while loop output tunnel (right-click the tunnel). You may either

- turn on auto-indexing (this may get inefficient for long-term run of the vi)

- save one value per iteration (very inefficient)

- get more than one value per iteration and save blockwise

- probably several more options... 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 6
(2,869 Views)
Thanks a lot! I'll try enabling indexing on Monday
0 Kudos
Message 4 of 6
(2,858 Views)

Okay, so enabling indexing worked perfectly, but now I have another problem. Because it's wired to the 1-dimensional data, it only takes the voltage values, but not time. How would I go about making the data 2-dimensional data with time?

 

thanks for all the help

0 Kudos
Message 5 of 6
(2,819 Views)

anandonaqui wrote:

How would I go about making the data 2-dimensional data with time?


 

 

Keep indexing enabled, but also add the old "Built array" node back. Resize it upwards to make two inputs total, and wire the current time to the upper input.

 

Now built array will make a 1D array with two elements and autoindexing will make it into a 2D array, one pair/row. 🙂

0 Kudos
Message 6 of 6
(2,817 Views)