Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulated 6509 returns all zeros if channel contains more than 16 lines

Solved!
Go to solution

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

 

0 Kudos
Message 1 of 5
(3,176 Views)

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.

0 Kudos
Message 2 of 5
(3,162 Views)

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

 

0 Kudos
Message 3 of 5
(3,159 Views)
Solution
Accepted by topic author LionelJJ

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.

0 Kudos
Message 4 of 5
(3,150 Views)

Joe:

 

Thanks for looking into this. We'll be getting a real USB-6509 soon.

 

Lionel

0 Kudos
Message 5 of 5
(3,148 Views)