LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delay within loop, only want to apply it once

Express VI's got put in around LV 7 or 7.1 to be able to get people started in LabVIEW programming faster.  While many of them let you do quite a bit of customization, there are still inherent limits as to what they can do.  And for simple tasks like the boolean, the extra code is just overkill.

You should be able to easily control the delay.  You can programmatically determine how much of a waveform to append to the front.  You can initialize an array or build a waveform of 100 zero's, or 1000 zero's, or whatever you calculate is necessary in your code.  Browse through the Array and Waveform palletes and you'll discover a lot of functions that I think will be useful to you.

Feel free to post in this thread if you have related questions, or start a new thread for a different question if you become stuck.

Good luck on your project.Smiley Happy

0 Kudos
Message 11 of 16
(685 Views)
Hello again.  This is what I came up with to delay my signal.  The case structure is wired to the case that the big while loop surrrounding the entire VI is on its first iteration, and the false case has nothing wired through it.  The error says that the tunnel is not wired (the tunnel leading to the initial condition for the feedback node just below the case structure). I only want the delay to apply once so I think that this is the way to do it....? What must I wire to the tunnel in the false case?  I think this is where it is going awry.
 
Similar ideas have led to the problem that I am having the most trouble with, which is that the final output waaveform (switch output) should only read one point per iteration of the big loop.  This is problematic because the delay is creating an array and it knows the values and just plots them all in one iteration.  I am not sure how to  'index' (right word??) the values being output at the NOT AND feedback section and start running the big loop with zeros and eventually (at some iteration down the road) catch up with the processed signal, thus creating the delay.
 
I am sorry to bother you again, but this is really starting to frustrate me.
 
pmn
0 Kudos
Message 12 of 16
(662 Views)

BMEstudent wrote:
Hello again.  This is what I came up with to delay my signal.  The case structure is wired to the case that the big while loop surrrounding the entire VI is on its first iteration, and the false case has nothing wired through it.  The error says that the tunnel is not wired (the tunnel leading to the initial condition for the feedback node just below the case structure). I only want the delay to apply once so I think that this is the way to do it....? What must I wire to the tunnel in the false case?  I think this is where it is going awry.
 
Go into the false case, right click on the tunnel and select create constant.  What you would want is an array of doubles that is empty.
 
Similar ideas have led to the problem that I am having the most trouble with, which is that the final output waaveform (switch output) should only read one point per iteration of the big loop.  This is problematic because the delay is creating an array and it knows the values and just plots them all in one iteration.  I am not sure how to  'index' (right word??) the values being output at the NOT AND feedback section and start running the big loop with zeros and eventually (at some iteration down the road) catch up with the processed signal, thus creating the delay.
 
I'm not clear on what you are trying to do here.  The screenshot of a partial block diagram isn't enough to figure this out.  Please post the entire VI.
 



Message Edited by Ravens Fan on 07-15-2008 12:22 PM
0 Kudos
Message 13 of 16
(652 Views)

here are some screen shots of the FP with the working switch and the erroneous,  with the constant wired in the false case, along with the VI.  I commented out some parts of the program that are superfluous, so it probably won't work without them back in, but just so you know where the important data is flowing.  in any case I have a partner VI that runs at the same time opening the data files and then the DAQ assistant here reads the data that is output.  see what you think.   Thank you so much for all of this help.

pmn

0 Kudos
Message 14 of 16
(638 Views)
Just one more example/explanation.  This is what I would like the switch to do.  Keep duration of 'on' same, but move to become between the stimulus.  The EMG is on the bottum, and is read now in 40 samples at 10kHz.  Thus givng 10 kHz single samples for the integrated and the switch samples. Problematic is that the duration of the switch is already known but must be read at the same rate that the new EMG is coming in and being integrated, ie not letting the switch jump ahead of the other signals (one data point plotted per iteration).  I would appreciate greatly any more help, as the last few hours and perhaps days have seemingly not been productive.
 
PMN
 
0 Kudos
Message 15 of 16
(622 Views)
never mind.  I figured it out.  what needed happening was merely to index the array (after adding the beginning delay size to the data being collected) to the iteration the loop was on.  simple, i know, but it has been eluding me for a long time.
 
pmn
0 Kudos
Message 16 of 16
(601 Views)