06-04-2010 06:54 AM
Hello,
I am using a DAQ-mx (NI USB-6211) and would like to use it to generate a digital modulated pulse
which is triggered by an analog input signal. The input signal is an analog modulated square pulse
which is nearly periodic. This is due to my set up and I can do nothing with it. I would like to use the
front edge of this signal to trigger the generation of a modulated pulse digital signal (0-5 V). My
problem is summarized on the figure given in attachment. I would like to also have the possibility to
configure The "delay" and "TAU_LED" duration while the VI is working.
I have been looking at several NI instrument examples of counter generation, AI/AO generation but did
not manage to solve my problem. Does anybody have an idea of how to start with my problem? are there
any example VI that I could start modifying?
Thanks in advance,
Grégory
Solved! Go to Solution.
06-06-2010 12:20 PM
Hello again,
No ideas, or is my message unclear?
Greg
06-07-2010 07:27 AM
06-08-2010 03:33 AM
Hello,
This sounds very interesting. Thank you very much, I will look at it.
Grégory
06-14-2010 06:10 AM
Hello,
I have been looking at this VI and this exactly what I would like to do but I can not trigger on an analog signal with my DAQ-mx. I was wondering if there are any ways to acquire the analog signal as it is done in the VI and then transform it into a di
gital signal, and then use the digital signal as a trigger?
Grégory
06-14-2010 10:19 PM
Hi Grégory,
Unfortunately, the 6211 does not support analog triggering.
Is the analog input a pulse that goes from 0 to V, where V is between 2 and 5 Volts? From the graph you drew it looks that might be the case. If this is so, you may be able to use this as a Digital Trigger for a Counter Output task. Technically the pulse should be above 2.2V to be guaranteed to be registered as a digital high. You would need to route the signal to one of the PFI lines to do this.
The Counter Output task has the benefit of being able to set the "Initial Delay" property so you could have a very accurate Tau_LED (50 ppm timebase accuracy). You can set the task to Retriggerable so you will not miss any pulses (assuming the signal is capable of setting off the trigger reliably).
Best Regards,
06-15-2010 04:48 AM
06-15-2010 11:35 AM
Hi Gregory,
DAQmx actually converts all 3 methods (Frequency, Time, and Ticks) into Ticks. Frequency and Time are just options to make it easier for the user to configure the task and not have to think about ticks of the internal timebase.
For your case Time probably makes the most sense, since you just want to generate a single pulse with a specified delay from the trigger signal. I noticed the default values in the VI for your Initial Delay and High Time is 130. This is in terms of seconds, so you'll probably want to change this to something like .000001 (e.g. for 1 us). You do need to have the retriggerable property set to true if you want to generate more than a single pulse. Calling the DAQmx Timing with Implicit of 1 sample vs. not calling DAQmx Timing should give the same result in *most* cases.
I notice you're calling DAQmx Read as part of the Counter Output Task. This isn't supported and will result in error -200460: Read failed, because there are no channels in this task from which data can be read. You should take out the DAQmx Read which is only applicable for Input tasks.
Best Regards,
06-16-2010 06:26 AM
06-16-2010 12:16 PM
Hi Gregory,
Sorry I forgot to mention: the Initial Delay is only applicable on the first pulse of a retriggerable generation. Every subsequent pulse will use the Low Time as the Initial Delay. I'll agree the behavior is not very intuitive (our more recent X Series boards actually support an Enable Initial Delay on Retrigger Property), but it is described in this KnowledgeBase, and should also be mentioned in the DAQmx Help.
Since you're just generating a single pulse, I would recommend simply connecting the Initial Delay and the Low Time inputs to the same value so every pulse will be delayed by the same amount.
Continuous Counter Output tasks currently support DAQmx Write. However, finite or single pulse generations do not. However, you should still be able to get the behavior you need with a DAQmx Property Node. The current workaround on E/M series is the following:
Again this isn't the most intuitive, but I have verified that it works on my 6210. After writing a new value in software the pulse will be updated on the 2nd trigger. Attached is the code saved in LV8.2.
Best Regards,