11-10-2005 01:49 PM
status = niHWS_GetWfmReference(*myHWSFile, "", "", myHWSRef);
status = niHWS_Seek (*myHWSRef, niHWS_Val_Start, startPt);
status = niHWS_ReadAnalogF64(*myHWSRef, numToRead, myBuff, totalSize);
The problem is that the numToRead has to be a long (as well as startPt). The minimum size of a long integer is 4 bytes (This minimum size gets bigger on 64-bit machines, I believe). That means I have 31 bits to represent numToRead and startPt (32 minus 1 bit for the sign). That means the largest number of samples and the largest sample offset I can have is 2,147,483,648. That's pretty big, right? I can get just under twelve hours of data that I can access if I sample of 50 kSamps/sec. (I find this somewhat ironic, as the foundation of the HWS format, HDF5 was set up for the express purpose, among others, to be able to hold really really big numbers. What does this have to do with addressing? Well, perhaps a data type could be created that pastes a couple of long ints together to allow for much larger numbers. Isn't this a technique used in HDF5?)
It's possible I have an old version of the library. It would make sense to have totalSize and startPt be unsigned, since files don't have negative indexes (am I mistaken?). (Even with this I wouldn't technically be able to parse 24 hours of data, but very nearly so).
Am I stuck? Is there a reason a long was used instead of an unsigned long? Does NI have any plans to update the library? Any ideas?
11-14-2005 04:29 PM