Hi! I'm using LabWindows 7.1 as well as a DAQ6036E. I'm trying to be able to generate amplitude as well as frequency and duty cycle. I looked at some of the examples like dig-train-cont. Anyway, my question is, can you still use the counter to generate frequency+duty cycle and then an analog for amplitude or is there a way while using analog out, to be able to generate frequeny, duty cycle and amplitude?
Hi! If I understood your problem, you'd like to generate a waveform as output. That's quite easy, you should see the examples of "Analog output", in which creating a task is shown, and how to perform an analog output of an arbitrary waveform: in fact the signal you can generate is (by a programming point of view...) a vector, so you are able to assign values to each sampled point.
In this way is easy to generate a waveform with a fixed duty-cycle and freq.
Hope it helps.
(the example: you open "ni example finder" from help tab, and DAQmx -> Analog out -> generate voltage -> ...choose one.)
Well I'm trying more to do a digital pulse train so I need to be able to change frequency and duty cycle on the fly as well as amplitude. So I wanted to instead of trying to output from a counter for freq/duty cycle and amplitude on analog channel, if there was a way for it all to just be outputted from the analog channel. Should I include my code for a better idea?
See the Labwindows help. Notice that for each board you can have different possibilities about terminals it is possible to connect!!! Fot this matter refer to board documentation.
You won't be able to change the amplitude of a digital pulse train. There are a bunch of great pulse train examples, including examples that allow the user to change the duty cycle or frequency on the fly. However, if you need the ability to change the amplitude, then it is no longer in the realm of digital, and you will have to use analog outputs. -Alan A.
Thank you. I guess I wasn't clear. I know that you can't use the digital pulse train for amplitude. What I'm basically saying is because I want to incorporate amplitude, how do I make it so that I can do frequency and duty cycle on the ao0 channel.
maybe you can route your digital signal to the analog out channel. If you can do this you have what you need, but not all the connections are allowed; for this you shoul refer to MAX and board docs; or you can simply try, using the function, and look if in debugging mode program works 😉
Remember: once you connect terminals, if you want to disconnect them you have to explicitly Disconnect them with the function
You won't be able to use the DAQmxConnectTerminals() function for routing a digital line to an analog output. You can do a continuous analog output and make multiple calls to DAQmxWrite functions while your task is running. So you can update the waveform output at any time. -Alan A.
Thank you for your reply. I spent most of yesterday and some of today trying to do as you said but after finally getting something to compile, I just could not actually get any output to occur that was seen. I've tried fiddeling around but to no avail. I was wondering if you knew of any examples for LabWindows that could be viewed to get a better idea of what to do. Thank you.
Here is a CVI shipping exmple that I modified. All it does is output a sine wave on an analog output, then after a certain period of time, it updates to a triangle wave. Disclaimer: it is not very elegant, nor are the changes to the example program well documented. I just wanted to demonstrate how to change the analog output waveform. -Alan A.