DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

ValueRangeGet not working in 10.1 anymore

Hi!
 
I have been using ValueRangeGet (COM-call) in an export-routine of mine (with the GPI still not being updated), and it has never failed me till I installed DIAdem 10.1. Actually, I currently have 10.0 and 10.1 installed, so I can see that the problem is with 10.1 only (and I have been using DIAdem sind 9.something if I remember correctly, which also worked properly).
 
When I invoke the function (from VC++), the variant which used to contain the resulting variant which should contain an array now is of type VT_EMPTY and.. rather empty.
 
I call the function with I32/variant/I32/variant/pointer to variant as parameters.
 
Any clues?
 
Best regards..
0 Kudos
Message 1 of 5
(3,379 Views)
So.. I have found out the problem:
 
I request a rather excessive 10000 points as a default-step-width in a loop iterating over the channel length.
 
That is too much for DIAdem 10.1.
 
Decreasing the default step-width to 2000 points I had no problem anymore.
 
I am rather surprised, I deliberately used a loop, knowing that my channels can have more than 100M points, and I thought that 10000 points ia a rather reasonable compromise between data size and number of times the loop runs.
 
Is there any official comment on this matter?
0 Kudos
Message 2 of 5
(3,365 Views)

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

0 Kudos
Message 3 of 5
(3,342 Views)
Hi!
 
Thx for your reply.
 
In my last version, I had a channel with 10000 values. I requested value 1 to 10001 into an empty VARIANT which DIAdem creates, from what I know.
 
In the new version, I request several times 2000 values, with the last request being 8001 to 10001 (the first being 1 to 2001). Looks like the same to me.. I cannot see any difference with respect to what you were saying.
 
In both versions I am requesting all the values of the channel, but no more (I get the length of the channel first).
 
Best regards!
0 Kudos
Message 4 of 5
(3,334 Views)

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!

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