LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Identify the number of pulses per IRC revolution - how to trigger counter

I am trying to count number of pulses per one revolution of incremental sensor-e.g. pulses between two reference marks. But I cannot figure out how to start or even stop the counter.

Counter 1 - the IRC pulses
PFI0 - the reference mark as a trigger

I always get warning that : Specified property is not supported by the device or is not applicable to the task.
Property: Start.TrigType

Does it mean that the counters on PCI 6120 don't support triggering?
Thanks
Message Edited by ceties on 07-07-2009 12:19 PM
LV 2011, Win7
0 Kudos
Message 1 of 10
(3,680 Views)

Hi Ceties,

 

Thanks for posting this issue!

Unfortunately, I couldn't find any barriers specified using counter triggering with PCI-6120, though it turned out that only Analog Trigger is supported by this card. Even if I didn't find proof on that, I believe CI Start Trigger is not supported at all in this case. I can give you an easy workaround:

 

What you can do is to configure an analog input with Start Trigger and configure your counter like it take the AI Sample Clock as clock. There is a possibility to configure counter with Start Trigger.

 

I attached the solution as well!

 

Best Regards,

Matyas

Message 2 of 10
(3,653 Views)
Hello,
The prog timeouts when I run it but I might be doing some wiring in the wrong way since I am not exactly sure if I got the way it is supposed to work.

1) the reference mark connected to PFI0, right?
2) the TTL pulses connected to lets say AI3
3) and that's all? It doesn't matter what counter to choose?

I understood that: it chooses ctr1 (lets assume) and tells it to use the AI as the source of pulses. And the AI acquisition (and thus source creation of the source for the counter) will start when the trigger is recognized at PFI0. It is really posible to use AI as 'extrenal clock'?

Did I overlook something crucial?
Thanks!!!
LV 2011, Win7
0 Kudos
Message 3 of 10
(3,631 Views)

Hello Ceties,

 

I am afraid, I was not clear enough. I should have given a short explanation along with the code.

 

1) Correct. You wire your trigger source through PFI0.

2) Negative. The input of the AI task can be anything, for example 'nothing' = floating input

3) You need to connect the TTL pulses to the 'counter in', as you would do, if we could trigger the counter normally

 

We use the AI task only because of the trigger. The method is:

  • You initalize both tasks. You wire the TTL signal to the counter and 'nothing' to the AI.
  • Programatically connect the trigger source to the AI task.The acquisition of 'nothing' will start only when the trigger condition is positive.
  • Meaning, the AI starts sampling, the AI sample clock starts running. (we're not interested in the acquired the data, we use only the clock)
  • You connected the AI sample clock to your CI task.
  • Counter will start sampling only when the AI starts sampling - AI starts sampling only when the trigger occurs.
  • Result: Counter will start sampling only when the trigger occurs 🙂

I hope it'll work in your project!

 

Regards,

Matyas

 

ps:  you can also use ni.com/ask, write mail to techsupport@ni.com or call our native speaking engineers on this toll free number 800142669 (from Czech Republic) for technical support. Visit ni.com/czech.

Message Edited by Matyas on 07-15-2009 03:42 AM
Message 4 of 10
(3,617 Views)

Hello Hello, 

I'll have chance to test it next week so I will let you know how sucessfull I was.

Regarding the czech support - I had them on the phone but eventually they asked me to write them mail. And once I write something I prefer to post it to the forum since usually there is somebody who knows the answer(like you) and it can help to other ppl being in the same sittuation.

 

Thanks!

LV 2011, Win7
0 Kudos
Message 5 of 10
(3,602 Views)
Hi Matyas!
It works. I just made few changes. The last thing I want to do is to stop(preferably) or restart the process after receiving another trigger. I was playing with pause trigger and retriggerable but it doesn't seem the way to go. Could you help me one more time?
Message Edited by ceties on 07-22-2009 05:07 AM
LV 2011, Win7
0 Kudos
Message 6 of 10
(3,573 Views)

Hi Ceties,

 

I see your post is not fresh anymore. 🙂 I was out of office, so you might have managed to solve this issue so far. Even though, I can give you some guidelines.

 

You will not be able to pause or restart a 'fake' trigger method which we developed within this topic. The reason: meanwhile you stop/restart the AI task the CI task will not have a sample clock resulting in error messages.

 

I have two ideas for you to try out, they depend on your goals.

 

  • You can use the Gate input of your counters, to let the pulses on Counter In be counted (gate high) or ignore them (gate low). You may have to use a second counter the produce the digital waveform to be used as gate for the first counter, depending on your trigger source.
  • Check this KB out. It's about M series, but at least, you have something to start from: http://digital.ni.com/public.nsf/allkb/9D7D8E47D893350E862574F600805BC7?OpenDocument


Best,

Matyas

0 Kudos
Message 7 of 10
(3,492 Views)

Hello,

I've been using a program (created by my predecessor) in LABVIEW 8.0 (win xp) to count the rpm through NI 6624 counter card. It worked fine for the past one year. But all of a sudden, today it started to give an error 200474. I tried restarting the system, resetting the card from Measurement and Automation and changing the card (I have 2 of the 6624 cards). But nothing works. The error persists. I tried to build a new program, but that too did not give me the desired result. How do I sort this out? Thanks

 

Swaroop 

0 Kudos
Message 8 of 10
(3,464 Views)

Dear Swaroop,

 

Reading your problem description and error code, I assume there is a break somewhere in the connection between your signal source (connector block) and the measurement device. Error 200474 is a timeout issue, meaning either you don't get any signal on CI, or the source is too low frequency (in some cases measuring <100 Hz could result this error).

Please, review your physical connections and also check these KBs for other solutions:

 

http://digital.ni.com/public.nsf/allkb/4E017925BDF2DC2D862572E6007C9594?OpenDocument

http://digital.ni.com/public.nsf/allkb/F94FF852680CA9F78625739F007B3ECF?OpenDocument

 

Hope it'll help!

 

Have a nice day!

Matyas

Message Edited by Matyas on 08-07-2009 06:50 AM
Message Edited by Matyas on 08-07-2009 06:51 AM
0 Kudos
Message 9 of 10
(3,445 Views)

I am a bit late but this solution worked like a charm!

 

Same as measuring low frequency but instead of the timebase I use the IRC signal as source and I use the Trigger as the gate.

LV 2011, Win7
0 Kudos
Message 10 of 10
(2,861 Views)