I have a waveform stored in a byte of data. I would like to send this out the PCI-6071E. I have everything set up to send out the data. I am trying to do this in Microsoft Visual C# .NET. Below is the code we use in LabWindows that I am trying to implement in C#. I think the problem I have is in the timebase and interval. Below I also have the C# code I am using to implement this. Would you have any suggestions for converting it over.
Thanks
LabWindows
status = WFM_Load(gpib_device, 1, ao_channels, a_d_readings, a_d_readings_size, 1, 1);
status = WFM_Rate(100000, 0, &timebase, &interval); //
status = WFM_ClockRate(gpib_device, 1, 0, timebase, interval, 0); //
status = WFM_Group_Control(gpib_device, 1, 1);
C#
try
{
// create the task and channel
myTask = new Task("AOTask");
myTask.AOChannels.CreateVoltageChannel("Dev1/ao0","",-8.2,
8.2,AOVoltageUnits.Volts);
// verify the task before doing the waveform calculations
myTask.Control(TaskAction.Verify);
// configure the sample clock with the calculated rate
myTask.Timing.ConfigureSampleClock("",
100000,
SampleClockActiveEdge.Rising,
SampleQuantityMode.ContinuousSamples);
AnalogSingleChannelWriter writer = new AnalogSingleChannelWriter(myTask.Stream);
//write data to buffer
writer.WriteMultiSample(false,a_d_readings);
//Start writing out data
myTask.Start();
}
catch(DaqException err)
{
MessageBox.Show(err.Message);
myTask.Dispose();
}