03-26-2009 08:41 AM
03-26-2009 10:22 AM
Hi Stephanie-
Your initialization looks correct, but you should interleave the data in the FIFO instead of concatenating two waveforms end-to-end. I would recommend calling Configure_Board() and then Configure_Board2(), then pushing voltArray[i], voltArray2[i] into the FIFO on each iteration of your loop.
Please let me know if this does not work.
03-26-2009 11:06 AM
Thanks but if I write this code in my loop :
board->DACFIFOData.writeRegister(voltArray[(data_index+1)]<<16 | (voltArray[data_index] & 0x0000FFFF));
board->DACFIFOData.writeRegister(voltArray2[(data_index+1)]<<16 | (voltArray2[data_index] & 0x0000FFFF));
I see the signal enclosed (on attachment PrintScreen.png) on my first channel and nothing on channel 2.
04-01-2009 01:26 PM
Hi Stephanie-
I found the settings that I overlooked previously. First, we need to tell the STC that we are using multiple channels, and how many channels will actually be used. I made this and other modifications to the Configure_Board() function. We also need to interleave data within the 32-bit boundaries imposed by the device FIFO. I have made modifications to support 2 channels in the attached example.
Most places where I made changes, I marked them with and // TW: 2chan some comments (where necessary).
Also, I did not test this on a 6711 or 6731 device, so I removed those devices from the example. Please give these modifications a try with your 6713 and let me know your results.
04-02-2009 04:10 AM
Hi Tom,
I have tested your aoex2.cpp for the 6713 card but it doesn't work. No
signal comes out. Have you tested it with a 6713 ?
On my card 6723 the aoex3 works well but not the aoex1. I don't have 5v
in channel 0 like in the other channels.
04-02-2009 12:05 PM
Hi Stephanie-
Yes, I tested my modified example with a 6713. Which output channels are you observing, and what exactly do you see when you run my example as posted? How do you have your signals connected, and how are you measuring the outputs?
The real purpose of aoex1 for 6723 is to verify the FPGA image was downloaded correctly. You may not see the exact 5V output because the calibration and scaling for the board is not taken into account. Do you see some change on the AO channel when you run aoex1? If so, what does the output voltage level come out to on ao0? How do you have your signals connected, and how are you measuring the outputs?
Thanks-
04-03-2009 09:37 AM
Hi Tom,
Your modified example for 6713 works well. In fact, my oscilloscope was not able to detect the signal because it was too short in time.
But I do have problems with the 6723 again. When I modifiy your code in order to generate 2 different signals in channel 0 and 1it generates a concatenation of my 2 signals in the 2 channels ( see printscreen in attachment ). I have just modified the part where you load the voltage array. You can see my code bellow :
//Load voltage array with values to be output.
//The waveform in this example ramps linearly from the minimum voltage
//to the maximum voltage, as determined by MaxReading.
//A ramp is generated for each channel that is used.
int j = 0;
for (int i=0; i < PointsPerBuffer; i+=numChans)
{
//ramp from smallest voltage to largest voltage
voltage = i * 2.0F * MaxReading / (PointsPerBuffer - 1.0F) - MaxReading;
voltage2 = 1024*(float)(sin((2*3.1415926 * i/PointsPerBuffer)));
j=0;
while((j<numChans) && ((j+i)<PointsPerBuffer))
{
if(j==0) voltArray[i+j] = (int)voltage;
if(j==1) voltArray[i+j] = (int)voltage2;
//voltArray[i+j] = (int)voltage;
j++;
}
}
Where is my error, please ?
My second problem is that I don't know how to write a value directly in a channel. And how can I do to use some channels with FIFO and other ones directly ?
Thanks
04-03-2009 10:01 AM
04-06-2009 09:32 AM
Hi Stephanie-
What modifications did you make to the example to make it multi-channel compatible? Please post your code example here.
04-06-2009 10:27 AM
Hi Tom,
I have changed some parts of the code that I have pasted above. You can see bellow the parts that have been modified (in bold).
numChans = 2; I change this value at the beginning of the code
//Load voltage array with values to be output.
//The waveform in this example ramps linearly from the minimum voltage
//to the maximum voltage, as determined by MaxReading.
//A ramp is generated for each channel that is used.
int j = 0;
for (int i=0; i < PointsPerBuffer; i+=numChans)
{
//ramp from smallest voltage to largest voltage
voltage = i * 2.0F * MaxReading / (PointsPerBuffer - 1.0F) - MaxReading;
voltage2 = 1024*(float)(sin((2*3.1415926 * i/PointsPerBuffer)));
j=0;
while((j<numChans) && ((j+i)<PointsPerBuffer))
{
if(j==0) voltArray[i+j] = (int)voltage;
if(j==1) voltArray[i+j] = (int)voltage2;
//voltArray[i+j] = (int)voltage;
j++;
}
}
I tried to write directly on the 6723 and it works well. But I noticed that it was not possible to write directly in some channels and to write a waveform in other ones at the same time.
Is it normal or is there an error in my code?