06-21-2019 03:44 AM
Hi All,
I am developing a C# program which can communicate the device through Digital I/O.
In my PC I have a Digital I/O card.
After I made the write code base on the DAQmx example, the code doesn't give back error, but I can't see anything in the NI IO Trace. (I've started capturing...)
The example program does the same issue.
I don't know what the problem is. Nevertheless, If I push the start button on the test panel I can see the captured communication lines. 😞
Please help me whether the example code wrong or the NI IO Trace.
The example source code as below or in the attachement:
private void writeButton_Click(object sender, System.EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
try
{
using (Task digitalWriteTask = new Task())
{
// Create an Digital Output channel and name it.
digitalWriteTask.DOChannels.CreateChannel(physicalChannelComboBox.Text, "port2",
ChannelLineGrouping.OneChannelForAllLines);
// Write digital port data. WriteDigitalSingChanSingSampPort writes a single sample
// of digital data on demand, so no timeout is necessary.
DigitalSingleChannelWriter writer = new DigitalSingleChannelWriter(digitalWriteTask.Stream);
writer.WriteSingleSamplePort(true, (UInt32)dataToWriteNumericUpDown.Value);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
Cursor.Current = Cursors.Default;
}
}
06-25-2019 04:02 AM
Please somebody help me...
08-06-2019 08:49 AM
Hi BarnabasKiss,
I hope this reply is not too late for you.
Did the code worked as expected? On the first view I don't see a problem with the code and would expect it to run properly. So I guess the IO-Trace is the problem. Why are you using IO-Trace, have you had any driver issues during development?
Is it possible that you changed the Filter-Settings (Tools->Recording...) to not log DAQmx-Messages?
I hope this helps out and my reply is not too late!
Jan Göbel
Staff TSE
National Instruments