05-04-2007 08:31 AM
05-07-2007 03:25 AM
05-08-2007 09:24 AM
Hi diadev,
R&D specifically changed the behavior of the ValueRangeGet() method in DIAdem 10.1, causing the difference you observed. In previous versions, if you requested more values than were in the channel, the ValueRangeGet() method could return incorrect values for the requested values beyond the channel's length. Now in DIAdem 10.1, if you request more values than are in the channel, the method returns a null result to alert you to this fact.
All you really need to do is check the channel length first and make sure that the buffer size you choose is smaller than the channel length. Also, you may need to reduce the buffer size of the last buffer if the number of values in the channel divided by the buffer size is not integral.
Hope that helps,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
05-08-2007 11:19 AM
05-08-2007 01:35 PM
Actually, you are right.
I tested with 10000 points, and when I used 2000 as a step-width, I got some points back, but did not check the end of the loop. Actually, with 2000 points, the problem occurs at the last iteration, when I request points till 10001. So the problem is with my boundaries.
I am not used to arrays starting at 1 as a c-programmer. 🙂 And 1 + 10000 is 10001, but actually, I have to stop reading at 10000....
Thx!