02-06-2006 01:00 PM
02-06-2006 01:14 PM
02-07-2006 01:21 PM
Hello Munir,
The screenshots that you attached show that you are trying to use the counter output functionality of your device with your analog output terminals, which are not compatible. The counter outputs can be used to generate a TTL pulse train, so you will not be able to use this to get an output of 1.5V. If you wanted to measure the counter output of your device, the easiest way to find the correct terminal, is to right-click on the entry for the device in MAX and choose "Device Pinouts". You will then see that terminal 2 is the ctr0out terminal. You may have to scroll down in the window to see this.
To make the output waveform you have described, you will need to use the analog output. There are two options you have. One is to use the internal hardware clock and to create an array of values to output. Each channel will need to have a different array because the outputs need to be offset from one another. The other way would be to use software-timing and use the determinism of your RT controller to write 1.5 or 0 V to each line at a set interval to form the pulse train that you need. I think that this second method would be slightly easier to implement. To find examples of both of these methods, look at the Example Finder examples Cont Gen Voltage Wfm-Int Clk.vi and Gen Mult Volt Updates-SW Timed.vi.
Regards,
Laura
02-09-2006 07:45 AM
02-10-2006 11:26 AM
Hello Munir,
You said that you have a real-time system, so you can expect your loop to execute reliably. You may want to use the timed-loop to control execution speed. What is nice about using the software-timed architecture, is that once you write a value, it will hold until you change it. You will only need to write 1.5V at the beginning of a pulse and then 0V when the pulse goes back to low. You will have to choose your loop timing so that you can write data for each pulse. You will have to write 0V multiple times between pulses this way. The other thing you can do with the software timing is to write the whole sequence of pulses in each loop iteration, that way the timing is much easier to setup. I would recommend setting this up and trying it to see if the timing is reliable enough for you before trying to build an array.
Let us know if you are having trouble.
Regards,
Laura
02-15-2006 12:05 PM
02-16-2006 12:21 PM
Hello Munir,
I have modified the example that you are using so that it inserts 2 seconds worth of 0 data points to the end of the waveform in the buffer. I am attaching it to this post.
Hope this helps,
Laura
02-17-2006 12:00 PM
02-20-2006 11:47 AM
Hello Munir,
It seems that there are a number of changes that you would like to make. I would recommend changing one thing at a time and then testing the results to make sure that everything functions the way that you want it to. For example, to change the pulse to be monopolar, you could add the appropriate value to each affected array element using the array functions.
After doing this simple task, I would work on changing the program to output to multiple channels instead of just one. To do this, you could use the original waveform from the Waveform Buffer Generation VI and change the polymorphic instance of the DAQmx Write VI to multiple channels instead of single channel. You then use the the Build Array function to combine your four separate waveforms into a 1D array of waveforms. I am attaching a simplified picture of what I am describing.
Once you have multiple waveforms, one for each channel, you can modify each to meet your needs.
Once again, make each of these changes one at a time and then test the VI afterwards to ensure everything works correctly.
Regards,
Laura
02-22-2006 12:47 PM