11-01-2011 10:47 AM
I am using the LabVIEW:MoveBlock Call Library Function to move data for a DLL call that returns a pointer to the data. When I use a smaller size (480K) for the 'size' input parameter, the LabVIEW:MoveBlock CLF works great but when I use the original larger size (17.5M) , the CLF returns an error code 1097. What is the largest amount of bytes the LabVIEW:MoveBlock CLF can move?
Solved! Go to Solution.
11-01-2011 11:07 AM
size_t is a U32. theoretically thats all the addressable memory on a 32 bit system
11-01-2011 12:20 PM
Are you suggesting that the LabVIEW:MoveBlock CLF should be able to move 4,294,967,296 bytes? Then that doesn't explain the error when requesting to move only 17.5Mb.
11-01-2011 12:40 PM - edited 11-01-2011 12:42 PM
It didn't say it was too big! (and certainly you cannot move everything in memory as you need 4 bytes for the size_t parameter
)
Your error resulted from moving something LabVIEW needed or thought it needed
"Error 1097 occurred at an unidentified location
Possible reason(s):
LabVIEW:  An exception occurred within the external code called by a Call Library Function Node. The exception might have corrupted the LabVIEW memory. Save any work to a new location and restart LabVIEW.
11-01-2011 01:07 PM
Jeff - I am not sure where you are seeing the size_t type. In LV 2011, the function prototype is defined as "int32_t MoveBlock(uint32_t ps, uint16_t *pd, uint32_t size);". However, if I am accidently stepping on already used space, how can this be avoided since I would like to move the complete 17,058,788 bytes. Thanks for the help.
11-01-2011 01:20 PM
11-01-2011 01:52 PM
Darin - thanks for the article. It however made the same mistake I made. When the size of the array is going to be determined programatically, it is possible that LabVIEW does not reserve enough space. What I was doing was programatically creating a subset of the larger array when I wanted just a smaller section of the array to analyze.This worked fine if the array size was small enough however when I wanted a full set of the data, that is when LabVIEW gave me the 1097 error. What I did to fix the problem was to define the largest possible array and take the subset after the MoveBlock.
Jeff thanks for your help as well![]()
11-01-2011 02:00 PM
11-01-2011 05:13 PM
There's a potential problem with your code. I don't know whether or not it explains the error, but I think it will cause problems eventually. You are not deallocating the pointer that you allocate with DSNewPClr. For that matter, you're not even using the pointer that DSNewPClr returns - why is it there? You are, however, deallocating the pointer that ArtemisImageBuffer() returns. This might be dangerous. DSDisposePtr may not know what to do with the pointer that you're passing to it, and your LabVIEW memory usage may grow each time you run this code since you obtain memory and never release it. I would remove both DSNewPClr and DSDisposePtr, leaving just the ArtemisImageBuffer and MoveBlock calls, and see if that fixes the problem you originally reported.