Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Edge counting buffer/array size problem (VC++)

Solved!
Go to solution

Hello,

 

I accidentally posted this in the multifunction DAQ forum so forgive me for posting this again here.

 

I am attempting to do a buffered edge counting with PCI-6115 for the application I am trying to develop.

 

Ideally, I would initialize a buffer array, then use a sample clock to time and acquire counter values which would then be stored in a buffer.  After a certain number of samples, I would then use the DAQmxReadCounterU32 function to extract the said data and perform some calculations.

 

However, windows gives me an error when I try to initalize the size of the buffer array to be larger than 255001, I need 264000+.

 

Essentially, only this part of the code seems to execute:

 

int         error=0;

TaskHandle  taskHandle=0;

TaskHandle  taskHandleCtr=0;

uInt32      data[260000];

 

After trying to initialize the uInt32 array my program crashes saying there was an error with my exe with a popup asking me if i want to send an error report to Microsoft.

 

Would this be a problem of windows not allowing me to allocated more than 255000 32 bit samples for that array?  If so how do i put the array onto the onboard memory?

0 Kudos
Message 1 of 2
(6,250 Views)
Solution
Accepted by topic author HT156

Sorry guys, it actually didn`t have anything to do with the DAQ board.

 

Apparently it was C++ that limits the size of the array I was calling, which was the traditional "int a[size]".

 

I used this instead to solve my problem:

 

    int* a = NULL;
    a = new int[10000000];

 

Problem solved.

 

Sorry for posting in the wrong forum, and thank you to everyone who's read this.

 

Howard

0 Kudos
Message 2 of 2
(6,248 Views)