spaghetti_developer Posted March 11, 2010 Report Share Posted March 11, 2010 Hi to All I want to generate a composed waveform using the DAQmx. The waveform that I need to generate is composed from many "normal" waves (sine wave + square wave + ramp) and it can be very long. I tryed to generate it using the tecnique explained into online help but it doesn't work good. How I can generate waveform comosed as mine? Quote Link to comment
crelf Posted March 11, 2010 Report Share Posted March 11, 2010 I want to generate a composed waveform using the DAQmx. The waveform that I need to generate is composed from many "normal" waves (sine wave + square wave + ramp) and it can be very long. I tryed to generate it using the tecnique explained into online help but it doesn't work good. Show us what you've already tried and we'll try to help. Also tell us what the problem is. Quote Link to comment
spaghetti_developer Posted March 12, 2010 Author Report Share Posted March 12, 2010 Than you for your prompt reply. Ok, you are right. I attached an immage with my waveform and with its details. After I built the component of my waveform with LV waveform functions generation, I merge them with WDT Append Waveforms DBL function. Therefore I give the new waveform to my DAQmx driver but it generate only the first part of total waveform (the sine waveform). I have configured my DAQmx Timing with <Finite samples>, with 1M as rate and with 100k as samples per channel. I use only one channel of the daq-board. What is the best technique for generate one waveform such as the waveform shown in the attachment? Quote Link to comment
Ton Plomp Posted March 12, 2010 Report Share Posted March 12, 2010 Than you for your prompt reply. Ok, you are right. I attached an immage with my waveform and with its details. After I built the component of my waveform with LV waveform functions generation, I merge them with WDT Append Waveforms DBL function. Therefore I give the new waveform to my DAQmx driver but it generate only the first part of total waveform (the sine waveform). I have configured my DAQmx Timing with <Finite samples>, with 1M as rate and with 100k as samples per channel. I use only one channel of the daq-board. What is the best technique for generate one waveform such as the waveform shown in the attachment? if you set your timing to finite samples it will only output the first 100k samples, better use infinite samples. Another question have you verified that the correct waveform is outputted? With an FP control for instance Ton Quote Link to comment
spaghetti_developer Posted March 12, 2010 Author Report Share Posted March 12, 2010 if you set your timing to finite samples it will only output the first 100k samples, better use infinite samples. Another question have you verified that the correct waveform is outputted? With an FP control for instance Ton Ok, I have changed the <Finite Samples> settig with <Continous Samples> but it still doesn't work. I also tryed with connecting the waveform to DAQmx Timing function setted in "Use Waveform", but the result was the same before. For your question, I showing the waveform in FP waveform chart control and it appears as I'm expecting. Quote Link to comment
Ton Plomp Posted March 12, 2010 Report Share Posted March 12, 2010 Ok, I have changed the <Finite Samples> settig with <Continous Samples> but it still doesn't work. I also tryed with connecting the waveform to DAQmx Timing function setted in "Use Waveform", but the result was the same before. For your question, I showing the waveform in FP waveform chart control and it appears as I'm expecting. What kind of code are you using? Is an error generated? Ton Quote Link to comment
Mark Smith Posted March 12, 2010 Report Share Posted March 12, 2010 Than you for your prompt reply. Ok, you are right. I attached an immage with my waveform and with its details. After I built the component of my waveform with LV waveform functions generation, I merge them with WDT Append Waveforms DBL function. Therefore I give the new waveform to my DAQmx driver but it generate only the first part of total waveform (the sine waveform). I have configured my DAQmx Timing with <Finite samples>, with 1M as rate and with 100k as samples per channel. I use only one channel of the daq-board. What is the best technique for generate one waveform such as the waveform shown in the attachment? The problem here may be that you're trying to generate 11E6 points of data (11 seconds total waveform at 1E6 update rate) but you're only loading the first 100K points into the DAQ DMA (the samples per channel parameter) - so I would expect you won't see the entire waveform generated and only the first 100k points. Also, does your source waveform have 11E6 points? Was it built with dt = 1/1E6? I don't know if you can load all 11 seconds into the DAQ's DMA at once. You can try - just change the samples per channel to 11E6 and see if it works. Also, which polymorphic DaqMx Write VI are you using (which data type as input?). The best solution for large arbitrary waveforms (analog outputs) is to write the waveform generator to accept a streaming input - here, read your input waveform in 100k chunks and enqueue it onto a finite queue (length of 4 should be fine - I find greater than one to be necessary so the consumer never has to wait (if the data's not there on time this will fail)- letting it enqueue the entire waveform just eats up memory). This is your producer loop. Set up a finite generation task with the 1E6 rate and 100k samples. Now, put the Dequeue, Write VI and the Start Task VI in the loop - put the Start Task in a case structure so it executes first time only (once you start the task in the loop, you can't restart it until you call Stop Task). The Dequeue gets the first chunk of data (100k) , sends it to the Write VI, on i=0 calls the Start Task, writes the first 100k points, loops, gets the next 100k data from the queue, sends it to the write VI, on i>0 doesn't call Start Task, and so on until the producer loop sends all the data and this loop (the consumer) writes all of it. Good Luck, Mark Quote Link to comment
spaghetti_developer Posted March 12, 2010 Author Report Share Posted March 12, 2010 Thank you All for your support, The first problem that I found was that I was trying to generate the arbitrary waveform with DAQmx, unfortunately I'm using ADLINK PXI so the driver wasn't correct. I have downloaded the correct driver (DAQPilot) and now I can generate the waveform but I found a new problem. Before generating the whole long waveform I'm try to generate test waveform more short than the long one. The shorter waveform is composed from a sine and triangle waveforms and it's long only 400msec. I don't know why but my PXI generate only one shoot of the whole waveform and if I try again it doesn't genrete it again, this is random problem. I warned ADLINK support and I'm waiting their reply. Meanwhile I want to tell thank you everybody. I'll write you their reply. Thank you. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.