10-02-2017 02:31 AM
Hi,
I have a problem with read implementation. I explain you.
I need to read EEprom and so: 3 pin (chipselect, DI, clock) set output mode and 1 set input (DO).
I initialize read port-pin:
private struct PortPinSettingRead { public DigitalSingleChannelReader reader; public Task digitalInputReadTask; public UInt32 pin; } PortPinSettingRead portPinSettingRead; portPinSettingRead.digitalInputReadTask = new Task(); portPinSettingRead.digitalInputReadTask.DIChannels.CreateChannel("dev1/port11/line3", "", ChannelLineGrouping.OneChannelForEachLine); portPinSettingRead.digitalInputReadTask.Control(TaskAction.Verify); portPinSettingRead.reader = new DigitalSingleChannelReader(portPinSettingRead.digitalInputReadTask.Stream); //READING public int readDI(){ try { return portPinSettingRead.reader.ReadSingleSamplePortInt32(); } catch (Exception ex) { System.Console.WriteLine(ex.Message); return -1; } }
I see by oscilloscope, that when I call readDI() function, the output pin go to 0.
Is it possible?
Thank you
10-16-2017 10:22 AM
Hello chino5,
it's actually a strange behavior, but i would suggest you to try the DAQmx C# examples that you can find into C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET4.5.1\Digital
Do you notice the same behavior?