01-28-2009 11:25 AM
Hi. Most of my test program is working well, but I seem to be having a problem with the niHSDIO_HWC_FetchSampleErrors prototype.
Here is the function prototype from the niHSDIO.h include file:
ViStatus _VI_FUNC niHSDIO_HWC_FetchSampleErrors(
ViSession vi,
ViInt32 numSampleErrorsToRead,
ViInt32 maxTimeMilliseconds,
ViInt32* numSampleErrorsRead,
ViReal64 sampleNumber[],
ViUInt32 errorBits[],
ViInt32 errorRepeatCount[],
ViUInt32* reserved1,
ViUInt32* reserved2);
Here is the exception detail that I captured:
Exception caught
Detail: [Error -1074135024] Windows Error 0xBFFA0010
DLL Description: Invalid value for parameter or property.
Parameter 8 out of range, or error occurred while setting Parameter 8.
I believe this is referring to either reserved1 or reserved2. I am passing pointers to a unsigned longs initialized to "0" in both cases. What should be here?
Also, the help file in LabView 8.5 has does not have a correct description for this function (it is missing a parameter):
ViStatus niHSDIO_HWC_FetchSampleErrors (
ViSession vi,
ViInt32* numSampleErrorsToRead,
ViInt32 maxTimeMilliseconds,
ViReal64[] sampleNumber,
ViUInt32[] errorBits,
ViInt32[] errorRepeatCount,
ViUInt32* reserved1,
ViUInt32* reserved2);
(when I tried to use the help file's definition, the system complained about missing 4 bytes of passing arguments so I assume the niHSDIO.h file's reference is more accurate.)
Solved! Go to Solution.
01-29-2009 04:29 PM
My colleague found that all of the example "C" code using this function passes NULL to the "reserved" parameters (instead of a pointer to ViUint32 variables). When NULL is passed to the 2 reserved parameters instead of a pointer, then the code runs without raising an exception. (And the 3 arrays "sampleNumber", "errorBits", and "errorRepeatCount" do return meaningful data...)
Perhaps I don't understand C as well as I should, but I would think there would be another way to declare the two reserved parameters in the include file so that it is more clear that NULL must be passed...
01-29-2009 05:46 PM - edited 01-29-2009 05:48 PM
I think that this is one of the cases where the function prototype was developed with extra inputs/outputs that were taken out at some point, or this function was created with scalable functionality. I think that if you pass in NULL for those two inputs to the function it should work properly. I have a feeling that you were getting an out of range error because it wasn't actually expecting a real value as an input. Give that a try and let us know the results.
Oops I guess I posted too late...