10-15-2013 11:33 AM
@Nghtcrwlr wrote:
Ok.. sorry for the complications. Array A is actually the replacement elements. If Array A has three elements, then last three elements of the Input Array have to be replaced by these. If 4, then last 4 lements. and so on...
So why are you autoindexing on array A. Simply calculate the size difference and find the index where the replacement should start. No loops needed.
10-15-2013 01:20 PM
OK, let's start over.
We have two arrays:
A=[66,77]
B=[5,0,1,1,5651,77,5797]
How should the output array look like every time it is written to the database:
First write...
Second write....
...
Last write ...
10-16-2013 01:19 AM
Lets say we have two arrays:
A=[66,77,88,99]
B=[5,0,1,1,5651,14,5797]
Output should be
First write : [5,0,1,1,5651,14,66]
Second write: [5,0,1,1,5651,77,66]
Third write: [5,0,1,1,88,77,66]
Fourth write: [5,0,1,99,88,77,66]
Cameron wrote:
You're making it unnecessarily complicated (and, as altenbach says, it won't work). Just take your replacement array and use Replace Array Subset to stick it into your original array with an offset of 1 element. All done.
I just donot want to use replace array subset because i need to write it to database for each time the outer Loop runs.
10-16-2013 01:49 AM
Maybe this is what you need
BR
Vincent
10-16-2013 02:50 AM
Hi everyone
Using Shift Register (as suggested altenbach) is required if you want to upgrade your output table each time you execute your For Loop.
In the For Loop you also can add a SubVI which save your output table in your MySQL Database. I suggest you to use error handling as well.
Have a good day.
10-16-2013 08:16 AM
@Nghtcrwlr wrote:
Lets say we have two arrays:
A=[66,77,88,99]
B=[5,0,1,1,5651,14,5797]
Output should be
First write : [5,0,1,1,5651,14,66]
Second write: [5,0,1,1,5651,77,66]
Third write: [5,0,1,1,88,77,66]
Fourth write: [5,0,1,99,88,77,66]
See, now you are making more sense. Until now the problem description was pure gibberish and you kepy everybody guessing. 😉
@Nghtcrwlr wrote:
I just donot want to use replace array subset because i need to write it to database for each time the outer Loop runs.
What does using a certain primitive have to do with how you are using the output later. I don't understand your argument at all. You need to use the function that gives the correct desired output. Period. 😮