Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

ni6509 unable to read correct digital signal

i am using a PCI NI6509 in my tester to write/read from a handler. But i am unable to read the correct digital signal that i set. Below are the functions that i used for write/read a single data line:

private void WriteLine(string line, bool data)

{

using (Task digitalWriteTask = new Task())

{

DOChannels.CreateChannel(line, "", ChannelLineGrouping.OneChannelForAllLines);

DigitalSingleChannelWriter writer = new DigitalSingleChannelWriter(digitalWriteTask.Stream); writer.WriteSingleSampleSingleLine(true, data)

 }

}

 

private bool ReadSingleLine(string line)

{

bool readData;

Task myTask;

DigitalSingleChannelReader myDigitalReader;

 

myTask = new Task();

myTask.DIChannels.CreateChannel( line, "", ChannelLineGrouping.OneChannelForAllLines);

myDigitalReader = new DigitalSingleChannelReader(myTask.Stream);

readData = myDigitalReader.ReadSingleSampleSingleLine();

return readData;

}

 

when i tried to perform a write line and read back. The read signal is always high.

For example:

WriteLine("Dev1/Port5/line2", false);

bool data = ReadSingleLine("Dev1/Port5/line2")

 

when i tried to probe on "Dev1/Port5/line2" after i perform the write line, i can see the signal on port5:line2 is low. But immediately after i execute the ReadSingleline function, i found out that the result return a high instead of low.

 

May i know isn't any problem with my function? May anyone advise me on this? Thanks a lot.

0 Kudos
Message 1 of 1
(4,262 Views)