From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Still having trouble with arrays

Hi,
I'm using an array to store data from a voltmeter, which will then
be stored into an excel spreadsheet. The VI for the voltmeter has 2
outputs an array output and a normal floating-point output.When i try to
add the numbers from either output to the array on the main VI, it just
keeps replacing the first element/data point. What is the proper way of
adding data to an array?


Regards,
Rob
0 Kudos
Message 1 of 3
(2,436 Views)
Robert,

There are two ways to add things to an array, and they depend on
whether or not you are adding an array to the array or an element to
the array. Either way, it's very similar:

On the diagram, place the Build Array VI. Right click on the input and
Add Array Input. Wire the element to add to the beginning of the array
to the top left node, and the array to add it to on the bottom left.
The output will be what you want.

If you want to add an array to the array, use the same technique, but
right click on the upper left input and select Change To Array.

Hope this helps.

Mark
In article <39788A1F.D9655C07@home.com>,
Robert Wieczorkiewicz wrote:
> Hi,
> I'm using an array to store data from a voltmeter, whic
h will then
> be stored into an excel spreadsheet. The VI for the voltmeter has 2
> outputs an array output and a normal floating-point output.When i try
to
> add the numbers from either output to the array on the main VI, it
just
> keeps replacing the first element/data point. What is the proper way
of
> adding data to an array?
>
> Regards,
> Rob
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 2 of 3
(2,436 Views)
In article <39788A1F.D9655C07@home.com> Robert Wieczorkiewicz writes:
>Hi,
> I'm using an array to store data from a voltmeter, which will then
>be stored into an excel spreadsheet. The VI for the voltmeter has 2
>outputs an array output and a normal floating-point output.When i try to
>add the numbers from either output to the array on the main VI, it just
>keeps replacing the first element/data point. What is the proper way of
>adding data to an array?

Not sure exactly how your VI is setup but here are a couple of things that have
worked for me in similar circumstances:

1) Building arrays within a for or while loop: Wire the build array function
outside the loop and use the auto-indexing feature available by popping up
o
n the tunnel at the loop boundary.

2) Use a shift register within a loop: Pass the output of the array as it is being
built to the output and wire the input register to the build-array function. You will
need to pop up on the terminal containing the array input and select "Change to
array." The element(s) you are adding get wired to the other input(s) of the Build
Array function.

The sample programs in the online help show a number of ways to build arrays
if the above are not appropriate to your situation.

>
>Regards,
>Rob

--- Ravi

--
Ravi Narasimhan
Dept. of Physics and Astronomy, UCLA
http://www.physics.ucla.edu/~oski
oski@physics.ucla.edu
0 Kudos
Message 3 of 3
(2,436 Views)