LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW:MoveBlock

Solved!
Go to solution

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?

0 Kudos
Message 1 of 9
(7,521 Views)

size_t is a U32.  theoretically thats all the addressable memory on a 32 bit system


"Should be" isn't "Is" -Jay
Message 2 of 9
(7,511 Views)

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.

0 Kudos
Message 3 of 9
(7,502 Views)

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 parameterSmiley Wink)

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.


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 9
(7,500 Views)

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.

0 Kudos
Message 5 of 9
(7,492 Views)

I would read through the following:

 

https://decibel.ni.com/content/docs/DOC-9091

0 Kudos
Message 6 of 9
(7,487 Views)
Solution
Accepted by j.masse

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 wellSmiley Happy

0 Kudos
Message 7 of 9
(7,481 Views)

@j.masse wrote:

Jeff - I am not sure where you are seeing the size_t type. In LV 2011, .




its pretty burried in the help

 

Here

Here


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 9
(7,470 Views)

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.

Message 9 of 9
(7,447 Views)