03-28-2008 11:09 AM
03-28-2008 12:32 PM
03-28-2008 12:42 PM
Ouch...I didn't know that about the waveform chart. I just assumed...
Anyway, I'll give it a try and post the results.
03-29-2008 04:32 AM
The way this looks I feel a bit itchy. A callback getting passed a memory pointer has to get the information from that memory pointer during its call duration. The caller of that callback is free to do with that pointer whatever it wants including deallocationg it, once the callback has returned. The way your diagram looks you have a DLL function that returns you the pointer that your callback function received. But at the time that DLL function returns the pointer, the callback function has most probably already returned control to its caller and the memory pointer is most likely reused for the next data or maybe just deallocated.
@Wiredup wrote:
I've become way too familiar with the subtlties of callbacks in LabVIEW
with this project.
The callbacks are occuring from 1 to 10 times/second. There's 10 or so callback functions registered. The callback functions reside in an App-builder-generated DLL structured to match the C prototype of the caller's expectations. In some of these callback functions, there's a pointer passed to the callback. This pointer is used, along with length information, with the LV Runtime Engine function "MoveBlock" to copy the data at the pointer to LabVIEW-controlled memory space. The function is then closed, and the data is used from the copied location (now just a 'wire').
In the above, the pointer and known length are used to copy an array from the callback to a 'wire'. This array is flattened, tagged with the event type that generated the array, and flattened again to include in a LabVIEW User Event. The LVRT MoveBlock is marked as re-entrant (as is the callback DLL).
I'm guessing there's many ways this process could mess with Windows memory management...I just don't see how it could be made better to prevent the perpetual increase in Page Faults. Even though the PF's are not bad unto themselves, The quantity of PF's generated every second may be an indication of a bigger problem?
03-29-2008 11:15 AM
03-31-2008 01:06 PM