05-23-2012 10:15 PM
Hello everyone :
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).
Solved! Go to Solution.
05-23-2012 10:24 PM - edited 05-23-2012 10:32 PM
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.
05-23-2012 10:25 PM
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.
05-27-2012 12:29 AM
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 ?
05-27-2012 02:14 AM
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.
05-29-2012 07:24 AM
@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.
01-05-2013 05:40 AM
hi how can i inser the new array value into array cluster
Thanks in advance
01-05-2013 12:29 PM
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.
01-05-2013 10:37 PM
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
01-05-2013 10:57 PM
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