01-12-2017 11:38 PM - edited 01-12-2017 11:58 PM
I have the following hardware setup and was hoping for some advice on how to approach pulse train generation with my DAQ (USB-6343).
I have a TTL input coming into my DAQ. When I see a rising edge, I would like to generate:
These pulse trains should all by synchronized to trigger when the TTL input sees a rising edge.
I have figured out how to do the first part, which is to generate a pulse train to a Digital Out by using a counter. However, I had a few questions about the 2nd part:
Solved! Go to Solution.
01-13-2017 01:34 AM - edited 01-13-2017 01:37 AM
So after doing some research, it looks like I can use a function generator to generate my square wave signal, and feed it into a MultiSample in an AnalogSingleChannelWriter. Is that heading in the right direction?
A few follow up questions.
01-13-2017 09:40 AM
1. Your X-series board supports AO retriggering directly so no need for the extra complexity of the linked example that comes from a time before X-series hardware was introduced.
2. Yes, both tasks can be triggered from the same TTL input
3. You'll need all your AO channels to be in a single AO task, but fortunately it sounds like you can write the same data to all channels. An array of waveforms will probably be the easiest format.
4. Yes, for square waves, you'd be fine generating a 50% duty cycle 1 kHz pulse train using a 2 kHz sample rate. AO values from multifunction boards don't decay, so there's nothing to be gained from a faster sample rate and more samples per cycle.
5. Are you talking about a Function Generator vi to calculate the AO data? I'd probably skip it and just create the data array manually for a simple case like yours. It'll just be an alternating series of 0 and 5 volts.
-Kevin P
01-13-2017 10:00 AM
Kevin,
Thanks for the helpful response.
01-13-2017 10:13 AM
1. Yes, use DAQmx Trigger property node, set Retriggerable==True
2. The AO subsystem can only support 1 hw-clocked task. Multiple channels of hw-clocked output must all be part of the same AO task. All channels are clocked simultaneously, but each channel *can* output different voltages. I'm not familiar with "AnalogMultiChannelWriter" and can't comment.
3. No, you can't use the Counter ouput which is at 1 kHz b/c you need to observe Nyquist for your AO and output at 2 kHz. You can just set a rate and leave the SampleClock source unwired, which will default to using an internal clock. Within the same board, the Counter and AO tasks will have no relative timing drift.
Also, no, don't use Continuous Sampling mode. That's at cross purposes with being Retriggerable. Use Finite Sampling, 2001 Samples at 2 kHz, voltage values similar to [0,5,0,5,0,5...0,5,0]. One extra sample at the end to bring the voltage back to 0.
-Kevin P