Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-DAQ GPCTR Error 10013 with PCI-6601

I am doing a single channel buffered period measurement using a PCI-6601 - DMA counter 0.
 
I have setup and programmed the board at the start of my application and then use the GPCTR_Control / ND_ARM command to initiate taking a new set of readings.
 
This works fine for a vast majority of the time but intermittetly my application crashes with NI-DAQ Error 10013 when I call the GPCTR_Control / ND_ARM command.
 
I do not reset or re-program the counter inbetween read cycles, simply arm and disarm.
 
The system does have a PCI-6711 analogue output card which is not using DMA or anything else and FieldPoint on Ethernet.
 
Any help most appreciated.
 
Many thanks
 
 
0 Kudos
Message 1 of 6
(3,953 Views)
Hi!

Hope you are doing well today! Can you post a small snapshot of your code which demonstrates this behavior? Also, you are just using one counter right?
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 6
(3,935 Views)

Hi Adnan,

Yes I am only using one counter.

Attached are the two routines I have written - int Configure_PCI6601(long CNTR_NO)   is called at the start of the application and double Read_PCI6601(long CNTR_NO)  from a timer thread.

The 6601 has only one DMA channel 0 (CNTR_NO = ND_COUNTER_0).

The program will work fine for a vast majority of time and then as mentioned before, intermittantly crash.

For background...The application is to control dynamometer engine speed and therefore the function double Read_PCI6601(long CNTR_NO) is repeatedly called as fast as the program can handle - the time thread interval time is set to 0. There are 60 teeth on the drive shaft, so every quarter revolution an adjustment to the pid is done.

Many thanks

 

 

0 Kudos
Message 3 of 6
(3,925 Views)
Hi,

Your code looks good to me. I was talking to a colleague over here and our assumption is that the GPCTR_Control call might have been made in the wrong state and that might be causing the error. Is it possible for you to attach isolated code which replicates the behavior? I will then create a project and run the code with the hardware so I can recreate the error.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 4 of 6
(3,912 Views)

Hi Adnan,

I have attached the routines which are connected to the speed reading. Essentially I have created a Timer control in the Uir with an interval of 0.000 seconds (so as fast as possible) to Read_Speed(...) which in turn calls Read_PCI6601(ND_COUNTER_0);

There is also another timer control which services reading data from FieldPoint via Ethernet and one to update the Uir.

 

Many thanks.

 

 

0 Kudos
Message 5 of 6
(3,909 Views)
Hi,

I have finally got a system installed and running over here. To speed things up, is it possible for you to attach code which has all the header files and only the necessary code included in it. I would like you to remove references to 6711 and make it in such a way that I just need to create a project and run the program. How long does it take for you to see the error?


Message Edited by Adnan Z on 12-05-2007 10:06 AM
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 6 of 6
(3,883 Views)