Discussion:
Analog and digital output DAQ Syncronization
(too old to reply)
Walia
2008-07-15 22:40:08 UTC
Permalink
Hi, I want to create my analog (Square or sine) signals from the analog output of DAQ USB 6008/6259. I also need a digital signal for activating the analog switches in order to route the labview generated waveform to my load. So I am facing problem in the synchronization of my signal and the digital control signal. Suggestions if any are welcome.
Corby_B
2008-07-16 17:10:15 UTC
Permalink
Hello Walia, Thanks for your post.I see that you are wanting to synchronize signals using DAQmx with the USB 6009/6259. So if you want to send out waveforms on multiple channels the easiest way is to put them in the same task. Will the AO signals be different for your different channels? Take a look at the following Developer Zone that talks about how to synchronize using DAQmx functions.<a href="http://zone.ni.com/devzone/cda/tut/p/id/4322" target="_blank">Timing and Synchronization Features of NI-DAQmx</a> It also looks like you are wanting to use digital lines that activate switches for your signals to power your load. So will you most likely need to do this before you output the analog signals? A way to do this would be to enable to digital line and then output the waveform in the same program loop. That way you will know that you digital line is active before you output your AO waveform. Let me know if any of this information helps you and please post back if you have any questions!Cheers!Corby_Bhttp://www.ni.com/support
Walia
2008-07-17 20:10:08 UTC
Permalink
Thanks Corby_b, I will be using only one analog output signal only. I like the idea of enabling digital control signal before sending my analog signal.Do you have sample code for the same as I am new to Labview and some related stuff will be of great help. Also my analog signal will be a variable duty cycle 1 hetrz square wave. Do you know how to generate a variable duty cycle square wave.Thanks
Corby_B
2008-07-18 18:10:09 UTC
Permalink
Hello Walia, Thanks for your post back!One way that I would perform you DO before the AO is to use some kind of sequence structure. This way you are assured that the task are happening in the order that you want them to. You can do this continuously or if you are only doing one test you can have this run just once. Let me also point you to a document that talks about DAQ and the DAQmx functions that can handle almost any task you want to do. Take a look at the following link. <a href="http://zone.ni.com/devzone/cda/tut/p/id/2835" target="_blank"> Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications</a> Also if you want to output a variable duty cycle signal I would recommend using the counters as they are designed for doing such a task. Take a look at the link below that talks about how to change the duty cycle programmatically. <a href="http://digital.ni.com/public.nsf/allkb/82C9F3C15F62974E86256EBA0058CAF5?OpenDocument" target="_blank"> How Can I Change the Duty Cycle on My Continuous Pulse Train?</a> Also I would also recommend taking a look at the shipping examples that come with LabVIEW. In LabVIEW if you go to Help &gt;&gt; Find Examples, there are examples programs for many many applications.The picture attached shows how I would use DAQmx to output a DO before and AO. Let me know if any of this helps you and good luck on your applications!Cheers!Corby_Bhttp://www.ni.com/support


digital before analog.JPG:
http://forums.ni.com/attachments/ni/250/41660/1/digital before analog.JPG
Walia
2008-07-23 19:10:09 UTC
Permalink
Hi Corby, Thanks for the post. I like the idea of using a sequence structure. Could you please tell me how I can feed a boolean values say "' true,true,false,true false, false,false,true" value in a 8 element array and generate the corresponding value at the digital output in each loop cycle at daq 6008 output.Thanks
Corby_B
2008-07-24 15:40:13 UTC
Permalink
Hello Walia, Thanks for your post back!What you want to do can be done with the Digital DAQmx write.vi. If you set the VI to "Digital 1D Bool 1 Chan 1Samp" this will allow you to put in an array of boolean values that will output each loop iteration. Let me know if this helps you and good luck with your applications!Cheers!Corby_Bhttp://www.ni.com/support


digital.JPG:
Loading Image...

Loading...