Jump to content
SteveSun

Timing output every elements of a array for loop

Recommended Posts

graph.png.f97c713183d90794c17b8350a25d3613.pngscap.png.42330209e1209298baecd3ad37fe83ee.png

I want to implement a function as follows: first set the Max and Min voltage values, then set the number of steps in the middle of the Max and Min steps and the dwell time of each step, and finally set the total number of cycles
The problem is: the value of each step must be output separately, there is a problem here, please help, thank you!

Share this post


Link to post
Share on other sites

There's a little bit of Rube Goldberg action going on here, but I think I follow what you are trying to do.  I'd suggest precalculating what all the values are and put that in a subVI.  Then call that subVI and index out the current step that you are on keeping track of it in something like a while loop and a shift register.  Attached is a simple example.  Have you taken any free LabVIEW training online?  Here is some on the LabVIEW Wiki.

Ramp Pattern.zip

  • Thanks 1

Share this post


Link to post
Share on other sites
16 hours ago, SteveSun said:

I want to implement a function as follows: first set the Max and Min voltage values, then set the number of steps in the middle of the Max and Min steps and the dwell time of each step, and finally set the total number of cycles
The problem is: the value of each step must be output separately, there is a problem here, please help, thank you!

I think you need to replace your rotate array with another for loop with your wait inside. The inner for loop will autoindex your array and output the values one by one. If you post a VI or a snippet, we might be able to better show you what we mean.

Edited by infinitenothing

Share this post


Link to post
Share on other sites
17 hours ago, SteveSun said:

I want to implement a function as follows: first set the Max and Min voltage values, then set the number of steps in the middle of the Max and Min steps and the dwell time of each step, and finally set the total number of cycles
The problem is: the value of each step must be output separately, there is a problem here, please help, thank you! 

What are you trying to output to? A graph? A daq card?

If its in one of the pictures, only 2 came through on my end, the rest show up as blank squares.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By bingbot
      1: How to get last index, not last element, but last index number of an 2d array?
       
      Also
       
      2: say 2d array has contents
       
      elephant  crow    dog      goat
      giraffe      eagle   cat       fly
      ant          pig        horse   bee
       
      How to get that the bee is the 12th or 11th index in the array? (11 if you count elephant as zero index, 12 if you count elephant as first index), meaning I want the index number 11 or 12, not "bee"
    • By krzych07
      I'm trying to make simple program for acquisition from camera. I'm using framegrabber and LabView wrapper delivered by its manufacturer.
       
      1. In first version (minimal_camera_code.vi) grabbing from camera time is very high and is not constant (camera is set to constant frame rate = 5ms, in framegrabber manufacturer software acquisition goes with 200 fps)
      After adding delay (fig. 2b) it is better but after some frames, acquisition time is not constant (fig. 2a)
       
      2. In second version (minimal_camera_code2.vi) grabbing time is constant and is exacly 1ms after adding "Wait until next multiple ms" = 25ms (adding shorter delay gives effects similar to described in point 1).
       
      I think that problems are connected with loops and are connected with misunderstanding of this code execution.
       
      What are your suggestions for implementing this piece of code? I want grabbing frames with constant frame rate.



      minimal_camera_code.vi
      minimal_camera_code2.vi
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.