10-28-2008 12:19 PM
I have updated the VI. Just need a confirmation from you. I am getting a 0.5 microsecond pulse although its actually 0.487us (at zero span with 1us sweep XD).
10-28-2008 11:25 PM
MrSafe,
This VI looks correct to me. The one thing I would watch out for is the fact that you have Sample Clock Rate set via a control on the front panel. Your data generation depends on it being set to a particular value (in your case 10 MHz). I would consider making this a constant on the block diagram. Leaving it as a control would invite a user to set it. If they set it to a value that is not 10 MHz, then the generated pulses will not match the pattern they specified.
My two cents,
Dan
10-29-2008 10:27 AM
Mcdan wrote:MrSafe,
This VI looks correct to me. The one thing I would watch out for is the fact that you have Sample Clock Rate set via a control on the front panel. Your data generation depends on it being set to a particular value (in your case 10 MHz). I would consider making this a constant on the block diagram. Leaving it as a control would invite a user to set it. If they set it to a value that is not 10 MHz, then the generated pulses will not match the pattern they specified.
My two cents,
Dan
I agree =).
Is there any method you would suggest if I wanted the pulses to be shuffled after the user specifies how many pulses he/she wants? For example the user wants a total of 10 pulses where 5 pulses have a high time of .5 microseconds and a low time of 10 microseconds, and the other 5 pulses have a high time of 5 microseconds and a low time of 20 microseconds. Is there anyway to shuffle these pulses? I think I would have to store them then shuffle them then feed them into the loop.
10-29-2008 12:11 PM
MrSafe,
I gave the pulse shuffle problem a try. For this, I assumed when you said shuffle, you mean a random shuffle so that's what I've done. There may be more efficient ways to do this (I'm more of a DAQmx expert than I am a LabVIEW expert). Basically I generated an array of size(totalNumberOfPulses). Each element of this array corresponded to the index into the 'Pulse Array' which defines the high and low time for that pulse. I then shuffled this array. This should give me an array of pulse specs indexes in random order. I then loop through the shuffled array, and create a pulse according to 'Pulse Array' indexed at the value read from the shuffled array. Hopefully that description made at least bit of sense... I've attached my attempt. I haven't had much of a chance to test this, but it seemed to be working OK.
Hope this helps,
Dan
10-29-2008 12:13 PM
10-29-2008 12:37 PM
MrSafe,
Sure no problem... I usually try to save back to an earlier version, but I forgot. I fixed one issue I found with my shuffling loop (accidently indexing past the end of the array).
Here's the VI saved for LV 8.2.
Dan
10-29-2008 01:30 PM
Thank You. It will take awhile for me to fully grasp what you did there but I can fallow it sort of =).
I don't have other questions that I can think of I will give you a kudos and check the solution box under it. I want to thank everyone again for helping me I will post any other questions here when I think of them.