LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

question about array/ construct array

Solved!
Go to solution

Dear LabView lovers :),

 

I have a very simple question. I want to construct some 1D array or in another words to fill it with numbers. For example to specific places I want to put specific numbers. (to place 1 I want to put 12, to place 4 23 and ext.. ) More than that, sometimes I want to overwrite some place twice. Actually I want to do following; I have array 1 3 5 2 7 8 9 4 -----.> 0 0 5 0 0 0 9 0 (find maximums of the arrays) and after that to draw it. Any ideas?

0 Kudos
Message 1 of 13
(3,214 Views)

Array constants.  Replace Array Subset function.

 

Doing things in Loops.  Using a shift register to store the array between loop iterations.

 

They are all basic but important programming and LabVIEW concepts.  Have you looked at the online LabVIEW tutorials?
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

0 Kudos
Message 2 of 13
(3,212 Views)

Take a look. I did something and it doesn't work as I want.

0 Kudos
Message 3 of 13
(3,210 Views)

What is it doing or not doing?

 

You posted a VI with no initial data saved in any arrays or controls as default.  We need something to play with and something that tells what  the output should look like.

 

You are using Insert into array, but from your original description, it sounded like you wanted to replace array elements.

 

Your use of local variables scares me as well.  You may have a race condition.

 

Also, it seems to me like the heart of your code (the For Loop) isn't doing much.  Most of the work done in earlier iterations is getting lost.  You are starting with "Array 2" and doing something with "output array" on every iteration, but you never update Array 2, and anything that happens to "output array" gets lost once the next iteration starts.

 

It seems to me that something like your output array should be what is stored in the shift register since that seems like what you want to continually update on every iteration of the For loop.

0 Kudos
Message 4 of 13
(3,205 Views)

Hi,

 

Is this what you are trying to do? (Check Attachment)..

 

Regards,


Nitzz

(Give Kudos to good answers, Mark as a solution if problem is Solved;))

0 Kudos
Message 5 of 13
(3,190 Views)

I have a 8.5 version of labview. could you plz convert it? thanks.

0 Kudos
Message 6 of 13
(3,187 Views)
Solution
Accepted by topic author dimani4

Hi,

 

This is in 8.5.


Regards,

Nitzz

(Give Kudos to good answers, Mark as a solution if problem is Solved:smileywink:)

Message 7 of 13
(3,184 Views)

 

thanks for the respond. yeah you're right.. I did some changes but it doesn't work as I expect. This time I added sequences and I guess there is no problem with race conditions. All I want is not to replace the numbers but find a local maximums to the function. I have some function; I run it; afterwards I took the Y-values-and get an array of it;in this array of numbers I want to find local maximums.. as I described earlier; after that I want to draw it again with the earlier function (something like in attached pdf file). That's all I want. Thank you.

 

p.s. I guess my problem with the array; I want to create exactly the same dimension array (as first array) but it doesn't give me.

Download All
0 Kudos
Message 8 of 13
(3,182 Views)

 

well done 🙂 thanks you a million!!!!

0 Kudos
Message 9 of 13
(3,180 Views)

Hi,

 

I am glad that its solved.


Regards,


Nitzz;)

Message 10 of 13
(3,177 Views)