05-20-2011 05:50 PM
Hi:
I'm using .NET 4.0 C# to attempt to read 40 lines from the *simulated* USB-6509 device, using DigitalSingleChannelReader.BeginReadSingleSampleMultiLine(). The 40 lines are spread across 6 ports on this device. The appropriate Async callback is invoked and the EndReadSingleSampleMultiLine() call returns a boolean array of length 40 but all elements of the array are always false across repeated samples.
However, if I restrict the number of lines in the channel definition to 16, the returned array progresses through incrementing values as is advertised for the simulated device.
I have also tried defining more than a single channel on the task as a way around this issue. However, although this works correctly if I have 1 or 2 channels of 16 lines, if I define more than 2 channels, the same effect occurs - i.e. the correct number of samples are returned but they are always false.
Finally, I tried using multiple tasks requesting asynchronous reads on this device, but this results in the reporting of a DaqException with an error code of -50103 (NI Platform Services: The specified resource is reserved. The operation could not be completed as specified.), implying that multiple simultaneous read tasks on this device are not supported.
Am I seeing an effect of using the *simulated* device that will go away when I get the real device or is there something that I am doing wrong.
Thanks
Solved! Go to Solution.
05-23-2011 11:38 AM
Hello LionelJJ,
Thanks for posting. I don't believe this is just an effect of using a simulated device. I have been able to read simulated digital data from a simulated USB-6509 in both LabVIEW and in C#, so there may just be a configuration issue in the code. Would you be able to post a copy of the code to see if I can replicate it on my own?
Regards,
Joe S.
05-23-2011 12:23 PM
Joe:
I've distilled the issue down to a Console app. That VS 2010 project is attached. The code contains examples of line definitions that work as expected and those that don't (i.e. always return all zeros):
// Either of the following specifications work correctly - received data from the simulated device progresses as expected
//string strLines = String.Format("{0}/port0,{0}/port1", deviceId);
//string strLines = String.Format("{0}/line0:15", deviceId);
// The following specification does NOT work correctly - 24 values are returned but all values are always 0
//string strLines = String.Format("{0}/port0,{0}/port1,{0}/port2", deviceId);
// The following specification does NOT work correctly - 17 booleans are returned but all values are always 0
string strLines = String.Format("{0}/line0:16", deviceId);
Thanks
Lionel
05-24-2011 05:54 PM
Lionel,
I took a look at the program you attached in your post and, after simulating a USB-6509, found the same result that you did. I got a hold of an actual USB-6509 and I was successfully able to read from more than 16 lines. I believe that this behavior might indeed be a result of a simulated device and that you will not see it on the real thing. Hope this helps!
Regards,
Joe S.
05-24-2011 06:27 PM
Joe:
Thanks for looking into this. We'll be getting a real USB-6509 soon.
Lionel