LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reduced time duration problem in arbitrary signal generation

Hello,

I am trying to generate a trapezoidal signa using labview(Analog output,NI 9263).I am able to get the desired amplitude but the time duration of the particular signal(when viewed on Oscilloscope) is not as specified.I tried playing with the timing sextion 'dx' in signal definition window.What I found is that timing dx =.005 reduces the time duration of signal by 5 times.Same is the case with dx=.003,it reduces the time duration by 3 times and dx=.01 by 10 times.

Can anyone please help me with it?

I am attaching the Vi herewith.

Regards,

Pieterson 

0 Kudos
Message 1 of 7
(2,720 Views)

When you convert your signal to a datatype of 1D array of DBL, it contains no timing information. The DAQ device will write the data as quickly as you have configured it to using the sample clock. It looks like when you change dX in your express VI, it changes the sampling of the signal to give you arrays of different sizes. You can adjust the "Rate" of your sample clock to change how quickly your analog output array is sampled. 

0 Kudos
Message 2 of 7
(2,700 Views)

Thanks Gregory for such a quick reply.

I tried doing so.I decreased the sample rate to 200 for timing dx=.005,the result is such that flat time of my signal improves by some extent but not exactly.But,the problem still persists for the rising time

(5 ms in my case).On oscilloscope,it sows less than 1ms. I still could not figure it out.

Any further help will be appreciated.

Thanks.

Dipendra

0 Kudos
Message 3 of 7
(2,689 Views)

Try Generating a signal (a real signal, a Waveform that includes Sampling Frequency, number of points, etc) rather than simulating a signal.  Waveforms include the timing information that you appear to be missing ...  These functions occupy most of the space on the Generate Waveform sub-Palette.

 

Bob Schor

0 Kudos
Message 4 of 7
(2,685 Views)

I could do that but the requirement of time is arbitrary signal generation which is in iteslf a real signal too. I still don't understand why the signal time is reducing.

Any help will be greatly appreciated.

Thank you.

Pieterson

 

0 Kudos
Message 5 of 7
(2,666 Views)

The reason the "signal time is reducing" is that you are persisting in using the Evil Twin of the Dreaded DAQ Assistant, namely the Dynamic Data Wire!  You strip it of its timing information before you wire it into the DAQmx Write.  Several replies ago, I told you that if you used the Waveform Generation function to generate an arbitrary signal, your code would "do what you want" (it currently is "doing what you told it to do", which is wrong).

 

There are a number of other problems in your design (possibly because you are not familiar enough with DAQmx and signal generation).  Did you want a 1-second signal, or a signal that runs until you push Stop?  [Why bother with a Stop button?  Once you've output all the signals you generated (once), your DAQmx Write will stop by itself.]

 

I cobbled together an improved version of your code that involves (a) using one of the Waveform Generators, (b) setting up the DAQ AO function such that the signal is continuously generated and continuously displayed and output until the Stop button is pushed, and (c) made sure that the same Sampling Frequency used in Signal Generation was also used by the DAQ Clock.  Works like a champ.  Try to do this yourself -- if you get stuck, show us what you've done and you'll get help.

 

Bob Schor

 

P.S. -- there is, of course, no "Trapezoid Waveform Generator", but you should be able to synthesize it using waveforms -- you may well need a different waveform for every loop, but that's conceptually easy to do.  For example, assume your Trapezoid is 0 for 3 seconds, ramps to 1 over 1 second, stays at 1 for 10 seconds, and decreases to 0 over 0.5 seconds and remains there for another 0.5 second, and does this over and over.  Note that I deliberately set this up so that over a 1 second interval, something "predictable" happens, i.e. there is a fixed Waveform you need.

 

Do you see the solution?  Start by generating the Waveform for the first (3) seconds, namely a Waveform that's always 0.  Before playing Segment 4, generate the rising edge of the Trapezoid (I think there's a Ramp function that will do this for you).  The next 10 waveforms are constant 1, and the last one is a decreasing ramp of 0.5 sec followed by 0 for the rest of the 1 second period.  Then repeat as needed.

 

BS

0 Kudos
Message 6 of 7
(2,657 Views)

@Bob_Schor wrote:

The reason the "signal time is reducing" is that you are persisting in using the Evil Twin of the Dreaded DAQ Assistant, namely the Dynamic Data Wire!  You strip it of its timing information before you wire it into the DAQmx Write.  Several replies ago, I told you that if you used the Waveform Generation function to generate an arbitrary signal, your code would "do what you want" (it currently is "doing what you told it to do", which is wrong).

 

There are a number of other problems in your design (possibly because you are not familiar enough with DAQmx and signal generation).  Did you want a 1-second signal, or a signal that runs until you push Stop?  [Why bother with a Stop button?  Once you've output all the signals you generated (once), your DAQmx Write will stop by itself.]

 

I cobbled together an improved version of your code that involves (a) using one of the Waveform Generators, (b) setting up the DAQ AO function such that the signal is continuously generated and continuously displayed and output until the Stop button is pushed, and (c) made sure that the same Sampling Frequency used in Signal Generation was also used by the DAQ Clock.  Works like a champ.  Try to do this yourself -- if you get stuck, show us what you've done and you'll get help.

 

Bob Schor

 

P.S. -- there is, of course, no "Trapezoid Waveform Generator", but you should be able to synthesize it using waveforms -- you may well need a different waveform for every loop, but that's conceptually easy to do.  For example, assume your Trapezoid is 0 for 3 seconds, ramps to 1 over 1 second, stays at 1 for 10 seconds, and decreases to 0 over 0.5 seconds and remains there for another 0.5 second, and does this over and over.  Note that I deliberately set this up so that over a 1 second interval, something "predictable" happens, i.e. there is a fixed Waveform you need.

 

Do you see the solution?  Start by generating the Waveform for the first (3) seconds, namely a Waveform that's always 0.  Before playing Segment 4, generate the rising edge of the Trapezoid (I think there's a Ramp function that will do this for you).  The next 10 waveforms are constant 1, and the last one is a decreasing ramp of 0.5 sec followed by 0 for the rest of the 1 second period.  Then repeat as needed.

 

BS


I would say it's more of a "Devil's Spawn" of the DAQ Assistant.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 7
(2,650 Views)