Jump to content

Meaningful Use of a 3D Array


Recommended Posts

In my 14 years of LabVIEW programming, I think I've only twice needed to use a 3D Array.

I wanted to brag about the latest one, and see how others have used them.

In this case, I was working on a LabVIEW driver for a company which makes custom DAQ equipment. This particular device has an oversample mode, so that their DLL spits out data in a 1-D stream as follows:

1a 1b 1c 2a 2b 2c 1a 1b 1c 2a 2b 2c ...

where in this case: Xa, Xb, Xc are oversamples of channel X.

After fighting with some very complicated preinitialization and insert/replace ideas, I realized that this was a 3D array of data.

M = # repeats

N = # of channels

O = # of oversamples

I reshaped the 1D array to a 3D with inputs: M, N, O, then did a double nested indexing for loop with a Mean function at the centre.

Worked like a charm!

Anyone else regularly using 3+ dimension arrays?

Ben

Link to comment

QUOTE (Ben Zimmer @ Aug 18 2008, 07:49 AM)

Anyone else regularly using 3+ dimension arrays?

Ben

Not recently, but in years past I quite commonly used four and five dimensional arrays as the test case matrices for automatic storage triggering for data acquisition in wind turbine test projects. (For each bin of wind speed, For each bin of wind direction, For each bin of windspeed turbulence, For each bin of wind direction turbulence, For each of a number of possible turbine controller states, store up to so many ten minute samples of high bandwidth structural loading data.-- One five dimensional array for the number of samples desired, another for the number of samples obtained.)

But recently, I've been able to handle everything with two or less dimensions.

Best Regards, Louis.

Link to comment

QUOTE (Ben Zimmer @ Aug 18 2008, 01:49 PM)

...

Anyone else regularly using 3+ dimension arrays?

Ben

In one of my DAQ systems I transfer data packages

from the DAQ loop to a TCP-server loop

via a functional global used as FIFO buffer.

Each data package is a 2D array, AI channels x samples,

therefore the buffer uses a 3D array where the

third dimension is the position of the 2D package

in the buffer.

Simple and efficient.

G

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.