LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate an array

 

Hi!

I want to generate an array or matrix to process it later. I tried to generate it but not be successful. I am too late in my thesis. I must solve this problem. 

 

I attached two vis that I tried. But I cannot achieve it.

 

What I want to do is;

 

Across 0,0133;  I want to write always constant 5000 zero value in the first raw horizontally.

 

Then

 

Across 0.013; I want to write 5000 data of the first run in the second row. Then I want to write 5000 data of another run into the third row without exit of vi. And so on.

 

After 13 run I will obtain [14x5001] array. Then I will integrate 13 data of each column seperately with respect to radial positions in the first column.

 

I wait your helps. Please help me.

 

Thanks a lot.

Download All
0 Kudos
Message 1 of 4
(2,724 Views)

You have a few problems.

  • You are using an uninitialized shift register. This means that the shift register will remember its contents if you stop and rerun the VI. You should wire an empty array to the left shift register. Please review the LabVIEW Help on shift register.
  • The Simulate Signal Express VI will return to you 100 elements. You don't seem to be accounting for this. If you want to generate a sine wave that's 5000 points use the Sine Wave VI instead.
  • Do not use a while loop if you know the number of iterations. Use a for-loop.
  • LabVIEW works by rows first when dealing with 2D arrays. Transpose 2D Array is your friend when you want/need to deal with columns.

I'm not sure I completely understood what you're trying to do, but the attached should get you started.

Message 2 of 4
(2,706 Views)

Hi smercurio_fc,

 

Thank you for your solution. I do not want to write zero values in the second column. I want zero values only in the first row near/across the 0.0133 constant.

 

I will then run the vi in the state machine and want to write 5000 data into the second row just near the constant 0.013 and I will push the next button and then run the second iteration. The corrsponding 5000 data of the second iteration will be written into the third row horizontally near the constant 0.0127 and the next step and so on. After 13 runs/steps,  the [14x5001] array will be formed.

 

Lastly, I want to fit curve to the each column with respect to first column constants and want to integrate this equation of curve fit. So one mean value will be obtained for each column and array will turn into [1x5001].

 

Could you please help me with this respect? Thank you very much again. I am looking forward to hearing from you. After this part of programming, I will take my data in my thesis. I am too late in my thesis. Please help me.

 

 

0 Kudos
Message 3 of 4
(2,689 Views)

What I showed you was something to get you started, with the intention of helping you out with array manipulation since those can be a bit confusing for newbies. It is not my intention or my responsibility to do your software work for your thesis. While I sympathesize with the fact that you are late in your thesis (I had to write a thesis once also), I have no idea why you are late. After all, how do I know you weren't out partying for the last 2 months? You can easily change what I showed you to use a simple state machine that adds rows "on command" as you want. I would suggest reading the NI KB article on state machines: http://zone.ni.com/devzone/cda/tut/p/id/3024

Message 4 of 4
(2,680 Views)