I can run the following code sucessfully if I select "Run in an external instance of CVI". If I run in process, the pop-up occurs. Debugging in the external instance of CVI shows the same memory is being requested (for the instrument to DMA into). This code started life as part of a stand alone CVI project and has been ported to a dll so it can be called from TestStand :-
void __declspec(dllexport) __stdcall TS_FireWire_Record (int icuNumber, double capturetime,
unsigned int filter_list [MAXIMUM_NUMBER_OF_SEQUENCER_FILTERS], char *dataFilename,
CAObjHandle seqContextCVI, char *reportText, short *errorOccurred, long *errorCode, char *errorMsg)
{
int status [FW_BRANCHES] = { SUCCESS, SUCCESS, SUCCESS };
int status_brn_A = SUCCESS;
int status_brn_B = SUCCESS;
int status_brn_C = SUCCESS;
int overall_status = SUCCESS;
unsigned int branch,filter_index,filter_count;
int seq_status;
SequencerStatus sequencer_status [FW_BRANCHES];
double timeout = 0.0;
unsigned int memory_size,maximum_no_elements;
// Get the recorder memory size. Convert Mb to bytes.
memory_size = FS_GetRecorderMemoryAllocation () * 1024 * 1024;
// Create recorder buffers if they do not yet exist
if (!recorder_data_branch_A) recorder_data_branch_A = malloc (memory_size);
if (!recorder_data_branch_B) recorder_data_branch_B = malloc (memory_size);
if (!recorder_data_branch_C) recorder_data_branch_C = malloc (memory_size);
// Set recorder buffer parameters
maximum_no_elements = memory_size / sizeof (SequencerData);
position_branch_A = 0;
position_branch_B = 0;
position_branch_C = 0;
// Create sort buffer if it does not exist
if (!recorder_sorted_index) recorder_sorted_index = malloc (sizeof (SequencerData*) * maximum_no_elements);
// Memory protection
if ((!recorder_data_branch_A) || (!recorder_data_branch_B) || (!recorder_data_branch_C) || (!recorder_sorted_index)) {
sprintf (errorMessage, "Unable to allocate 1394 recorder memory for %u bytes per channel and %u elements.\n", memory_size, maximum_no_elements);
MessagePopup ("Error", errorMessage);
overall_status = -1;
}
...
The CVI compile options are the same as the Stand alone project. I can not find anything in the CVI compile options or the TestStand options that allows me to tune my run time heap allocation. I have also looked at the documentation and searched using the keyword "heap". Can anybody tell me where the controls are ?