LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timer/Counter for board 6025E

I want to use the 24-bit counters on the 6025e board however I'm still quite loss on how to utilize it. I had gone thorugh the whole palette of VIs to use under the Data Acquisition->Counter palette in the diagram, none of them seems fit my application.

First, I need a counter to start count when my program start, then interrupt to occur when it detects a rising edge (from I/O pin), in the interrupt routine, it read the number from the counter and stores it in an array.

a. Does the "Counter start.vi" refer to the counter on the 6025E board(20MHz)?

b. The Counter on the board, is it a count up/down counter?

c. What happens when the counter overflow? Will it reset and continue to count? Is it possible to note down the number of tim
es the counter overflow?

d. Is there any information on using of interrupts?I need an interrupt to occur when it detects a rising edge from an I/O pin(Hardware Interrupt).

Happy New Year!!!

Thks & Best regards
lyn
0 Kudos
Message 1 of 4
(2,937 Views)
I appreciate your frustration. Counters need configured to dowhat you want, so a single VI ussualyy does not dothe job. The counter are generally upcounters. I believe that you can control this so they can be used fro quadrature encoders.

Goto help search examples.look for;
Hardware input output >>> DAQ >>> Counters
Check the spec and that board ( I do not have them all memeorized) to find out what knid of counter chip it has.

Look through the eamples for something that should work.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 4
(2,937 Views)
I've been looking into this as well, lyn. The answer is this:


You can't use your counters for interrupts the way you wish. Only a counter/timer card can do this. Your counter can count up or down, but it can't have a hardware interrupt in this manner.

What it WILL do is start when your program starts, and count every time it sees an edge on one of its inputs, and store the TIME between each rising edge in a buffer, but it does it automatically. It won't, however, notify you when one of these edges has been detected.

Mark
0 Kudos
Message 3 of 4
(2,937 Views)
Greetings,

I have a couple of things to add:

1. "Counter Start.vi" is one of the Intermediate Counter VIs and does not provide the flexibility that is available when using the Advanced Counter VIs. I would suggest using these.

2. When the counter overflows, it will reset and continue counting. You can program the counter to output a pulse on its OUT pin when terminal count (TC) is reached. You could then use another counter to count how many times this occurs. Furthermore, you can call "Counter Get Attribute.vi" to determine if TC has been reached.

3. Although you will not be able to have an interrupt generated each time a rising edge occurs, it sounds as if the example "Count Buffered Edges (DAQ-STC).vi" might accomplish your task. This exampl
e is installed with LabVIEW. It will store the count from the Source into a buffer each time that an active edge occurs on the Gate. The example was created to have both an external Source and Gate signal, but you could use an internal timebase as your Source.

I hope this helps. Good luck with your application.

Spencer S.
0 Kudos
Message 4 of 4
(2,937 Views)