LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array self-adding

Solved!
Go to solution

Hello everyone :

Smiley Surprised

Can you help me to creat "array self-adding" in a single array ? (the 3 rows belong to a single array)

like this:

             2  3  5  6

             2  2  1  3   

         +) 1  2  5  9

             5  7 11 18

                    

This function is suppose to binning the raw data form CCD (1024*256 pixels).         

0 Kudos
Message 1 of 15
(3,126 Views)
Solution
Accepted by topic author Fanerer

You can index your 2D array to output a single array by column, auto-index into a For loop and add all your elements together, with the use of shift registers.  You could use two For loops to break your array into rows and columns and do it that way.  Once you've collected your final tally's write them back to a 1D array.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 2 of 15
(3,124 Views)

Is this homework?

 

Let me give you some phrases to look up that can help.

 

For Loop

Auto-indexing

Add Array Elements

Shift Register

 

A combination of those concepts should lead you to an answer.

Message 3 of 15
(3,122 Views)

Two guys:

Thanks for your help; 

here is the block diagram of vi. I tried to give the solution.

 

here remains two problem:

1.It seem theat I don't need the Shift Register, how can I use it ?

2.Can I change row-major order auto-indexing to column-major ?

 

 

Array adding.png

 

 

0 Kudos
Message 4 of 15
(3,087 Views)

Fanerer wrote:

here is the block diagram of vi. I tried to give the solution.


This is just a picture of part of the block diagram. It is usually better to attach the actual VI.

 


Fanerer wrote:

here remains two problem:

1.It seem theat I don't need the Shift Register, how can I use it ?

2.Can I change row-major order auto-indexing to column-major ?


If you don't have to, you don't need to use a shift register. It would be a good exercise to write an alterative version of the code that uses a shift register. Try it!


You can transpose the array before autoindexing.

 

Also, don't wire N if you are autoindexing on an array (except for rare cases).

Also try to eliminate coercion dots. Some of your indicators have incorrect representation.

0 Kudos
Message 5 of 15
(3,082 Views)

@Fanerer wrote:

 

here remains two problem:

1.It seem theat I don't need the Shift Register, how can I use it ?

2.Can I change row-major order auto-indexing to column-major ?

 

 

I second what Christian said.  If you have found a solution that does not use shift registers, there is no need to use them.  This was merley an example, a suggestion of one possible solution; however, if you are unfamiliar with shift registers, or their use, it would be a good idea to become accustomed to them.  They're used everywhere, and are very useful.

 

 


 

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 6 of 15
(3,036 Views)

hi how can i inser the new array value into array cluster

 

 

Thanks in advance

 

0 Kudos
Message 7 of 15
(2,935 Views)

Why did you add your message to an old thread rather than starting a new one?

 

I have no idea what you are trying to do.  I don't see a cluster in your VI at all.  Just a bunch of broken wires.  And the wires are broken because you have two controls tied to each other.  A wire cannot have two sources of data.

0 Kudos
Message 8 of 15
(2,926 Views)

hi thak you,

please find the my attached file.. i need to append the datas which is seletive by ring button

 

eg: if i select 0---> data5 has to display in element3 o/p

                   1-->  data4 has to display in element3 o/p      whchi is shows in  string output

 

 

is it possible ?

 

Thanks in advance

Download All
0 Kudos
Message 9 of 15
(2,911 Views)

Replace Array Subset.

 

See attached.  Also, I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 10 of 15
(2,908 Views)