LabVIEW

cancel
Showing results forΒ 
Search instead forΒ 
Did you mean:Β 

how to add values of every while loop using shift registers into an array outside the loop and siplay the array.i am a little new to labview.help from you guys will be appreciated.thanks in advance! :)

how to add values of every while loop using shift registers into an array outside the loop and siplay the array.i am a little new to labview.help from you guys will be appreciated.thanks in advance! πŸ™‚

0 Kudos
Message 1 of 8
(2,969 Views)

(It is sufficient to keep a short subject line and place the bulk of the question in the body of the message.)

 

Your question is also not clear at all:

  • How many while loops are there?
  • What is the purpose of the shift registers?
  • What is the meaning of "outside the loop"? Where exactly is that?
  • What is "siplay". I am not familiar with that term.
  • ...

Please attach your code and tell us in detail what parts are giving you problems and how you want it to function.

0 Kudos
Message 2 of 8
(2,964 Views)

sorry for not writing the question properly.i am a first time user.i need to start the vi and save the time used in every iteration an another array.every time i press the STOP button the ELAPSED TIME need to be saved in an array.thank u πŸ™‚

0 Kudos
Message 3 of 8
(2,905 Views)

I would recommend that you start with a few basic LabVIEW tutorial. Your code makes very little sense.

 

  • What is the purpose of the FOR loop that simply repeats the same operations 10x in a row as fast as the computer allows. That won't change the outcome. Isn't once enough? If you delete the FOR loop, nothing will change!
  • You have a tpye mismatch in the FOR loop, correct it!
  • Why do you use a local variable instead of placing the terminal in the right place?
  • When the while loop stops, the VI completes and returns to the caller. How are you calling this?
  • You have shift registers where you never even look at the shifted value, so what's their purpose?
  • Do you want to save the elapsed time in this subVI or in the calling VI? How are you planning to read out the array of elapsed times later?
  • Why is there no small wait in the while loop? Right now it consumes all CPU spinning as fast as the computer allows.
  • You have a connector for the "stop function". How is this supposed to work?  If you call if with a TRUE, the subVI will return immediately. If you call it with a FLASE, the subVI can never return (unless you show the front panel when called, which is currently not configured).
  • What's wrong with the "elapsed time express VI"? Why not use it to get you 90% there?

 

0 Kudos
Message 4 of 8
(2,895 Views)

thanks for the help sir.i have deleted the FOR loop.i will restate my target-i need to make a function such that when i start it,the timer starts recording the time elapsed.as soon as i press the stop button the value recorded should be saved in an array outside the while loop.subsequently the next timer value should start recording the time elapsed till i press the stop timer again.all these consequent time elapsed values should be saved in an array oustide the loop for dispplay.thanks πŸ™‚

0 Kudos
Message 5 of 8
(2,882 Views)

 

thanks for the help sir,i am really stuck.i will explain the problem.i have to get the time elapsed after pressing the start button.after stoping the loop,i should get the time elapsed.this time needs to be saved in an array.i should provide a start button again to reset the timer and to once again start the timer and then record the next timer value in the same array below the pevious value.simultaeouslyi have to input some value(millivolts) through an array and concatenate both the arrays in a final array.the problems i am facing is-

1-i am not able to find a loop with START STOP BUTTON.

2-I am just able to get one timer value and that gets loaded to the full array.

3-i am not able to concatenate both the arrays somehow.only the second array is shown in the FINAL ARRAY 3.

i have tried to use shift registers and many array functions,but i am somehow stuck in the looping.please help me.i am really getting too much abusing from my office boss..please help.thanks you πŸ™‚

0 Kudos
Message 6 of 8
(2,836 Views)

You can't just thow functions together, it actually needs to make sense! I strongly recommend you look at some tutorials and example programs, because it seems to me that you have some very basic misunderstanding about dataflow. To add data conditionallly to an array, there is no need to stop the while loop, simply use a case structure to conditionally do that. Where does the millivolt array come from? Is it somehow matched to the final array size of times? Why do you create 2D and 3D arrays??? Why do you think you need to start/stop the loop?

 

Here is a very simple example that might point you in the right direction. Whenever [reset] is pressed, it resets the timer and adds a [elapsed time/millivolt] pair as a new row to the output array. See it you can modify it for your needs. The [stop] button ends the program run.

 

 

0 Kudos
Message 7 of 8
(2,808 Views)

THANKS A LOT ! i actually want to insert an array named as MILLIVOLT.every elemnt of that array corresponds to one timer value.so,when i start the timer and get the first TIME ELAPSED,the first elemnt of the MILLIVOLT array should get saved to the final array with the corresponding FIRST TIME ELAPSED . suppose if i have imput  an  1d millivolt array-(100,200,300,400.)then when i start the timer and stop it,the time elapsed should get saved to the final array along with the input MILLIVOLT ARRAY as a 2D output array having elemnts-{100,2.3s  ;200,3.4s  ;300,4.5s ;400,2 s} considering the timer values which i am getting is [2.3,3.4,4.5s]

                  .thanks πŸ™‚

0 Kudos
Message 8 of 8
(2,772 Views)