Hi
I am using VC++ to develop my application
and I am using PXI 6713 DAQ.
I am trying to generate a 100 KHz waveform running out continously from one of the Analog Output Channels of PXI 6713.
Then I want to generate another waveform from other DAC channel, which has to get triggered, whenever the output of my DUT goes from LOW_TO_HIGH
For this, I've connected the PFI-5 line to my device output and configured the PFI 5 line so as to trigger waveform generation, whenever the PFI-5 detects a LOW_TO_HIGH.
I've used the command
Select_Signal (deviceNumber, ND_OUT_START_TRIGGER, ND_PFI_5, ND_LOW_TO_HIGH);
But when I do this, the first waveform from a DAC channel goes to a dc level and only when the PFI-5 gets triggered, the first channel resumes its waveform generation.
The second channel gets triggered and generates a waveform without any problem. But the problem is at the first channel.
My requirement is : I want a generate an independantly running waveform from one DAC channel. I want another DAC channel to generate a waveform, whenever it gets hardware triggered through PFI_5. It should not disturb the first channel.
(I have avoided Counter Ouput to generate waveform, since I am specific about Amplitude).
FYI, I am using FIFO mode operation.
Can any one help me in this regard.
Thanx in advance.
****** My code *******
void WaveGen1()
{
// Generate 100 KHz waveform from DAC 4
i16 deviceNumber = 6; // PXI 6713 Device Id as per NI-MAX
i16 deviceNumberCode; // to be returned by Init_DA_Brds function
i16 chan = 4; // DAC channel 4
i16 numChans = 1; // only one channel is used for
i16 chanVect[1] = {4}; // DAC Channel 4
f64 gain = 1.0;
i16 binArray[10] = {0};
i16 group = 1; // default for most of the devices
u32 count = 10; // 10 data points
f64 voltArray[10] = {0};
double voh = 2.0;
double vol = 0.0;
for(int i = 0; i < 9; i++)
voltArray[i] = voh;
voltArray[9] = vol;
u32 iterations = 0; // Repeat waveform for indefinite period
i16 mode = 0; // disable delay mode
f64 rate = 1000000; // 1,000,000 points / sec
i16 units = 0; // points / sec
i16 timebase;
u32 updateInterval;
i16 whichclock = 0; // update clock
i16 operation = 1; // Start waveform initiation
Init_DA_Brds (deviceNumber, &deviceNumberCode);
WFM_Scale (deviceNumber, chan, count, gain, voltArray, binArray);
WFM_Group_Setup (deviceNumber, numChans, chanVect, group);
WFM_Load (deviceNumber, numChans, chanVect, binArray, count, iterations, 1); // use FIFO mode
WFM_Rate (rate, units, &timebase, &updateInterval);
WFM_ClockRate (deviceNumber, group, whichclock, timebase, updateInterval, mode);
WFM_Group_Control (deviceNumber, group, operation);
} // End of the function
void WaveGen2()
{
i16 deviceNumber = 6; // PXI 6713 Device Id as per NI-MAX
i16 deviceNumberCode; // to be returned by Init_DA_Brds function
i16 chan = 6; // DAC channel 2
i16 numChans = 1; // only one channel is used for
i16 chanVect[1] = {6}; // DAC Channel 2
f64 gain = 1.0;
i16 binArray[10] = {0};
i16 group = 1; // default for most of the devices
u32 count = 10; // 10 data points
f64 voltArray[10] = {0};
double voh = 2.0;
double vol = 0.0;
for(int i = 0; i < 9; i++)
voltArray[i] = voh;
voltArray[9] = vol;
u32 iterations = 0; // Repeat waveform indefinitely
i16 mode = 0; // Disable delay mode
f64 rate = 1000000; // 100,000 points / sec
i16 units = 0; // points / sec
i16 timebase;
u32 updateInterval;
i16 whichclock = 0; // update clock
i16 operation = 1; // Start waveform initiation
WFM_Scale (deviceNumber, chan, count, gain, voltArray, binArray);
WFM_Group_Setup (deviceNumber, numChans, chanVect, group);
WFM_Load (deviceNumber, numChans, chanVect, binArray, count, iterations, 1);
WFM_Rate (rate, units, &timebase, &updateInterval);
WFM_ClockRate (deviceNumber, group, whichclock, timebase, updateInterval, mode);
// configure PFI_5 to accept low_to_high trigger
Select_Signal (deviceNumber, ND_OUT_START_TRIGGER, ND_PFI_5, ND_LOW_TO_HIGH);
WFM_Group_Control (deviceNumber, group, operation);
}