06-09-2011 02:03 AM - edited 06-09-2011 02:13 AM
Is this the way necomers to Labview get treated on the forum, getting accused of asking silly questions and then get talked about in 3rd person.
SO Dennis why did you even respond to my questions if you thought it was silly.
Maybe there's a labview forum somewhere where people of all abilities and expereience get treated with respect.
The main reason for asking the question was that the filter produces zeros momentarily after the case structure switched and the DC level was applied to the filter. I was trying to find out a way of ensuring the case switched exactly at the completion of the wave form to ensure there were no gaps in the data causing a the filter timing issues. Hence "How can I detect when a sub vi finishes"
06-09-2011 04:34 AM
Hello Andy
I hope you are well.
How are you getting on with the development of your code? Have the resources I sent to you proved useful or are you still facing issues?
I have just a few more resources for you here, if you are still having problems please feel free to ask any questions you have about your sub vi on this thread, if you feel the point is being missed on these boards then please feel free to call in to National Instruments where we can give you direct support.
If you do have any queries, please do not hesitate to get in touch so that myself or a colleague can support you with any issues.
Regards
06-09-2011 10:16 AM
It actually sounds like a race condition. You cannot be certain when the Boolean is read compared to the rest of the loop, thus you can easily get a False loop in between, causing the 1,25 offset DC here and there. Sounds about right?
If so, the question isn't about "how to know when the sub-vi stops" but "How to know when controls/indicators are read". The answer is dataflow, the wires decide. If you want the program to react to the Start waveform without disturbance i recommend an Event structure.
/Y
06-10-2011 02:23 AM
Hi Yamaeda,
I agee with you on your points including your one regarding the question. With my limited experience I don't fully understand the correct terminology.
Perhaps Dennis was partly right in that the question was not correct but still the problerm remains.
I always suspected a race problem with delays in switching the case stament, thats why I was after a better way of detecting the competion of the vi but from your comments it may not help.
I will now lookup events and redesign the vi.
Many thanks
Andy
06-10-2011 11:15 AM
I don't see any race conditions in your sample VI. Dataflow looks continuous through the loop and there are no Global or local variables lurking about. The switch is set to Switch Until Released so it will stay on as long as the mouse is clicked on it. Completing the Since each iteration of the loop creates a new waveform and writes it to the hardware regardless of the switch, the clue to your problem lies in how the gaps get into in the data. I think there are two contributors to this. If the gap is a constant 0.1 seconds in length, then try removing the Wait(ms).vi since you have to wait for the AO to complete anyway.
If the gap remains or is greater in length, it could be because the two signals you produce are not the same length. If you run the DC only case, the sample has a duration of 0.1 seconds and contains 100 points. The appended waveform 's length varies depending on which waveform you select. For example, when Waveform 2 is selected with G=0 , the mixed case puts out a sample of 860 points spanning 0.860 of a second. This is the sum of the 100 samples generated in your original DC signal appended to 250 samples from Simulate Signal 2 and for each pass thru your Half Wave Blocker vi which add 102 more samples each. Try generating another 760 DC samples and appending to the original signal in the DC (False) case. Now your samples will be the same length.
If gaps remain, data production from your AO might run smoother if you move the AO Channel creation, timing and clearing outside the while loop. Take a look at the example Cont Gen Voltage Wfm-Int Clk- Non-Regeneration.vi for some clues as to how to do this. If you don't need to create a different reference array on each iteration, move that outside the loop as Yamaeda suggested.
JohnCS