Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

[debutant on Labview 8.5] Generation of a digital modulated square pulse triggered by an almost periodic analog modulated square pulse

Solved!
Go to solution

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 

0 Kudos
Message 1 of 11
(4,257 Views)

Hello again,

 

No ideas, or is my message unclear? 

 

Greg

0 Kudos
Message 2 of 11
(4,239 Views)

Hi

 

Have you looked at this KB? If I understand your question right this will be a good example. 

Message 3 of 11
(4,222 Views)

Hello,

 

This sounds very interesting. Thank you very much, I will look at it.

 

Grégory

0 Kudos
Message 4 of 11
(4,205 Views)

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 

0 Kudos
Message 5 of 11
(4,148 Views)

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,

John Passiak
0 Kudos
Message 6 of 11
(4,125 Views)
Hello John,
 
Thank you very much for your answer, my analog signal is a 0-5 V signal and as you suggested, I tried to use it as a digital trigger for the generation of my digital output (The VI is given in attachment). I do manage to trigger the counter output generation, but it seems there is a conflict between the parameters of the output pulse (high time, low time and delay) and the frequency of my analog input (which is not constant). I do not get a counter output pulse each time there is a rising edge on my analog input. The VI seems not to bother that I have ask for a start.retriggerable option. I have tried both with a DAQmx timing VI and without and it did not help. 

Should I use instead a CO pulse frequency, but then again, how to choose correctly the ferquency and the duty cycle (I need to have the possibility to output very short pulse 1-100 us)?

Gregory

0 Kudos
Message 7 of 11
(4,114 Views)

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,

John Passiak
0 Kudos
Message 8 of 11
(4,094 Views)

Hello John,
 
Sorry to bother on the same questions again but I would like to understand better the way the triggering is working in this VI.

I have set the retriggerable option on true and a high time of 5 us, a low time of respectively 5 and 10 us and a delay of 10 us. I use an oscilloscope to look at both my trigger signal, the one that I input on the PFI0 (the yellow one) and my counter signal (the blue one), coming out from the CTRL0. The figures in attachement shows the oscilloscope screen. 

By setting a delay of 10 us, I would have expected to see a shift of 10 us between the rising edge of my trigging signal (the yellow one) and the rising edge of my counter output (the blue one). But what can be seen on the pictures, is that the delay value has no apparent influence on the counter output waveform, while only the value of the low time and high time do affect it. 
 
In my case, the low time is the time between the rising edge of my yellow signal and the rising edge of the blue signal. 

I change the idle state of CO-pulse Generation-time VI from low to high (internally in the CO-pulse Generation-time VI because I did not manage to find the right string control to do it from the front panel of my LED_driver VI) and it did not help.

Am I missing something in the functionnement of the way the counter output pulse trigging is done?
 
Another question concerns the use of a DAQmx read and write vi. You said that the use of the DAQmx read vi is not supported as part of the counter output pulse task. Is it also the case with the DAQmx write VI? If yes, does it mean that it is not possible to update dynamically the value of the parameter of my counter output pulse? 
 
best regards,
 
Gregory 
Download All
0 Kudos
Message 9 of 11
(4,079 Views)
Solution
Accepted by topic author Grégory

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:

 

2010-06-16_121038.png

 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,

 

John Passiak
0 Kudos
Message 10 of 11
(4,061 Views)