Still having trouble with arrays 
Author Message
 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



Tue, 07 Jan 2003 03:00:00 GMT  
 Still having trouble with arrays
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


Quote:
> 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

Sent via Deja.com http://www.deja.com/
Before you buy.


Tue, 07 Jan 2003 03:00:00 GMT  
 Still having trouble with arrays

Quote:
>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
on 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.

Quote:

>Regards,
>Rob

                                --- Ravi

--
Ravi Narasimhan
Dept. of Physics and Astronomy, UCLA
http://www.physics.ucla.edu/~oski



Tue, 07 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Having trouble converting array to spreadsheet string,...

2. having trouble sorting an array

3. Bot-kit - having trouble using light sensors

4. Anyone else having trouble with GIFs?

5. Is Clarion Foundry Site Having Trouble?

6. Still having trouble with conversion of ascii file

7. If you are having trouble reaching ISE...

8. Having trouble with Lecroy 2373 Memory Lookup Unit

9. Having trouble printing front panel with consistent magins

10. I having trouble using a serial i/o port with LabVIEW

11. I am having trouble reading a time stamp on a video using OCR

12. Having trouble reading HPIB instrument consistently in a GPIB system

 

 
Powered by phpBB® Forum Software