Showing results for 
Search instead for 
Did you mean: 

Problems while using PCI-6602 Counter-Timer Board to generate synchonised clocks

Hello everybody,
I tried to do something basic ( ?) with this Counter-Timer 6602 Board, and it doesn’t work.
So I hope some people with more experience than me could understand what happens here.

1) What I need:
I need to generate 4 synchonised clocks, whose periods will be multiple of 1 ms.

2) What I have:
LabVIEW 7.0 and a PCI-6602 Counter-Timer Board in a DELL PC running under XP pro.
The PCI-6602 Counter-Timer Board has 8 counter timers named CTR 0, CTR 1, ... CTR7.

3) What I have already done, and that worked:
- Generate a 1 kHz “Master Clock” signal from CTR 4, configured by “Continuous Pulse Generator” (found in “Data Acquisition, Counters...).
- configure CTR 0 and CTR 1 to work as frequency dividers, by use of “Down Counter or Divider”.
- Apply the output signal of CTR 4 (OUT ) to the SOURCE inputs of CTR 0 and CTR 1 by means of physical wiring in the SCB-68 connection box.
When I do this, I get two nice secondary clock signals on my oscilloscope screen, ( with periods = 3 ms, or 5 ms or whatever multiples of 1 ms I choose) from CTR 0 and CTR 1 outputs , very clean and perfectly in phase with the 1 kHz Master Clock.
So far, so good...
But I still need 2 more secondary clocks...
One would say: “No problem, do the same trick with two other counters...” Well, not so simple, it seems...

4) What I tried to do, and that did n’t work:
When I try to do the same frequency division with any of the remaining counters, (CTR2 to CTR7), the program stops and I get an error “ –10020 : Time base not valid “.
I can’t figure out what happens here: I thought any counter could be configured to work as a frequency divider, but it seems not to be so, and I am stuck here.
Has anyone an idea about how to fix this type of problem?

Attached file:
0 Kudos
Message 1 of 6

La réponse que je vous ai envoyé par mail vous a t-elle convenu?


0 Kudos
Message 2 of 6
A l'attention de Frédéric Boullot, NIF.

Cher Monsieur,
Grâce à votre message, j'ai bien compris que les vis du genre "" et "" ne savent pas gérer les CTRs de la carte 6602.
J'ai donc commencé à modifier le vi que vous recommandez : "Generate Pulse Train (NI-TIO).vi ", et je vois que l'on peut faire quelque chose avec (j'arrive à faire de la division de fréquence avec CTR 2 et CTR 3 fonctionnant en parallèle), mais (comme vous le disiez) c'est compliqué, et de plus, ça ne fait pas vraiment ce que je veux.
En effet j'ai besoin que tous les CTRs commencent à diviser exactement au même instant, pour que les horloges secondaires ainsi créées démarrent bien ensemble, et cela ne semble pas être le cas (j'ai controlé sur le scope).
Je dois dire que je me sens un peu perdu dans cette complexité.
Et je suis très étonné que le User Manual de la 6602 (qui fait pourtant 100 pages ! ) ne donne pas d'infos utiles pour programmer cette carte.
Une autre approche pourrait-elle être d'utiliser des vi Express?
Merci de votre intéret.
0 Kudos
Message 3 of 6

I've attached an example that seemed to work on my E-series board with just 1 divided-down counter. It also ran without errors using 4 divided-down counters on a 6602, but I had to disconnect its cable from our test equipment so I couldn't verify the hw signal.

-Kevin P.
CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 6
Hello Kevin,
Thanks for your interest in my question.
I have downloaded your vi.
Looking at the front panel, I see a Master Clock and four divided counters: Well, exactly what I need... I even get the impression that you wrote this VI specifically to answer my question!
Then, I look at the diagram and I see that you use DAQmx sub VIs, which have never used, and wich look very strange to me.
Anyway, your VI looks clean and documented, so I think I should be able to understand your code, after I get a little more familiar with DAQmx VIs.
Finally, when I launch your vi, it goes into a halt, and I get the following error message:
"L'erreur -50103 s'est produite à DAQmx Control
La ressource spécifiée est réservée. L'opération n'a pas pu être achevée telle que spécifiée.
Nom de la tâche : _unnamedTask<3> "
Wich means: the specified task ( _unnamedTask<3> ) has been reserved. The operation could not
be carried out as specified.
It seems to me now that I have several options:
- use traditional DAQ.
This is what I have been doing recently, trying to modify "Generate Pulse Train (NI-TIO).vi" which I have taken from a set of examples from NI.
Well, it works now , but it does'nt do exactly what I need (yes, counters CTR2 and CTR3 do count now, but their outputs are not in phase with each other, probably because they do not start working exactly at the same time). (See attached files : ).
- use DAQmx like you do (totally new to me).
- use VI Express (but I am not sure that this option is available with LabVIEW 7.0 ).
You opinion will be appreciated.
Thanks again for your help.
0 Kudos
Message 5 of 6

Actually, yes, I wrote it up to answer your question. I had some idle time while monitoring an automated test, so I did some tinkering. At this point, I'd recommend using the example I posted once we clear up the error.

I *did* get it running without generating errors using a 6602 (1 master and 4 divided) and an E-series board (1 master and 1 divided). Unfortunately, the network pc I'm on doesn't have LabVIEW so I can't look at either my code or yours right now. I think I cleaned up some wires and added some comments after last running it, and may possibly have goofed something up. Here are some things to check for in my code:

1. Run the diagram with debug highlighting on. At exactly which step does the error first show up?

2. Are all the counters being set up for "Continuous Sampling" rather than Finite? If any of them are configured to be Finite, they will start to interfere with one another and generate an error like the one you saw.

3. There's some issue of boards needing to be reset when switching between DAQmx and traditional NI-DAQ. I *think* it's mostly critical when switching one way but not so much the other. Can you try powering down your PC, waiting 10 seconds, then booting up and trying my example before doing anything with traditional NI-DAQ?

4. Are you sure all the device and channel designations are unique and valid? I think I had it setup to assume that the 6602 was Dev1.

-Kevin P.
CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 6 of 6