Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-DAQ Error - 10444 while using PCI-6602/PCI-6024E

Software: NI-DAQ 6.9.2
Operating System : Windows 98
Language : Microsoft VC++ 6.0/MFC
Board : PCI-6602 used as multi-channel counter
PCI-6024E used for writing analog output,
and also generation of Gating Pulse
used by PCI-6602 counters

I am using the NI-DAQ API's in Microsoft VC++ 6.0-MFC/ Windows 98 environment to program PCI -6602 and PCI - 6024E boards connected via an RTSI cable

The high level view of the application flow is as below

Use an internal 20 mhZ timebase (ND_INTERNAL_20 MHz) using 6024E , and enable RTSI through ND_RTSI_0

Set the counters on 6602( from ND_COUNTER_0 to ND_COUNTER_3)
-set for ND_BUFFERED_EVENT_CNT
-set for ND_RTSI_0
-set for ND_BUFFER_MODE , N
D_CONTINUOUS
-set for ND_INTERRUPTS
-GPCTR_Config_Buffer
-ND_PROGRAM each of the counter

Arm the gating pulse from 6024 E using ND_PROGRAM

Wait for 10 ms using VC++ ::Sleep(10) command

Disarm 6024 E and each counter of 6602

Read the buffer contents collected while gating pulse was armed to an array (ND_READ_MARK)

The application runs fine for some time, but throws an error
GPCTR_Config_Buffer returned NI-DAQ Error - 10444
No more system memory is available on the heap ....

This appears to be due to memory leak

Would like to know any issues with configuring for the read / buffer size / gating signal freq etc.

Suggestions please...

Thanks in advance.


MOHANDAS
0 Kudos
Message 1 of 3
(4,309 Views)
Hello;

Some points are not clear to me. Do you keep arming/disarming/reading buffer in a loop? Also, why are you using Interrupts with the counters? Why son't you set the first three counters to use DMA and only the fourth one to use Interrupts?
Try to change the application so you will arm the counters and the AI operation, do all the buffer reading, and then, disarm those operations only at the end of the code execution.
Hope this helps.
Filipe
0 Kudos
Message 2 of 3
(4,309 Views)
Hello Filipe,

Thanks for the posting. As you have suggested, I will be using DMA for the first three counters.
I am furnishing more details on the application, your suggestions/view points please.

Thanks,

MOHANDAS


The pseudocode for the application is

LOOP:

Step 1 -

Output 2 Analog Voltages(X,Y) usingPCI-6024E Analog output

Step 2 -

Generate a Gating Pulse using PCI-6024E (Internal 20 MHz timebase,use ND_COUNT_1,values of 20k/100k,Select_Signal(ND_RTSI_0)

Step 3 -

Set Counters 0 to 7 on PCI-6602 forBUFFERED_EVENT_CNT for gating Pulse arriving at ND_RTSI_0, ND_BUFFER_MODE, ND_CONTINUOUS, ND_INTERRUPTS(for all counters0 -7), ND_COUNTING_SYNCHRONOUS, GPCTR_Config_Buffer(iDevice, ulGpctrNum, 0, ulCount, cnt_0_Buffer);(
The problem happens at this point)
ND_PROGRAM each of the counter

STEP 4 -

ND_PROGRAM PCI-6024E to generate gating pulse

STEP 5 -

ND_RESET PCI-6024E and counters 0 -7 on PCI-6602 to stop counting

STEP 6 -

GPCTR_Read_Buffer to an Array

END LOOP

The LOOP(Step 1 - 6) is repeated continuously n times.

PROBLEMS:

A. Throws an errorGPCTR_Config_Buffer returned NI-DAQ Error - 10444 This occurs after looping around 160 times

B. Inordinate delay at GPCTR_Read_Buffer for either of these conditions
-If we dont pause after Step 4
-Use a buffer of size more than one to read counts
-Use timeOut >0 in GPCTR_Read_Buffer


C. If we use timeOut >0 in GPCTR_Read_Buffer the application runs without delay at GPCTR_Read_Buffer step, but only one buffer point is read(we require at least two readings)

Would like to know,

-Is there any need to pause between ARM and DISARM of counters
-How long we have to wait between ARM and DISARM of cou
nters for reading buffer properly.
-Ideal timeOut value.
-Overall whether I am headed in the right direction for having the Application count continously and output Analog Voltage.
0 Kudos
Message 3 of 3
(4,309 Views)