Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to detect falling and rising edge of a TTL signal with a 6036E PCMCIA card?

Hi.

I want to detect the falling and rising edges of a TTL signal with my DAQ card (6036E PCMCIA with LabView 8.2.1). The goal is to set on occurrence when a falling edge is detected, and another when a rising edge is detected. I try to make with the program attached, but I always get the following error (-89137 in DAQmx):

Possible reason(s):

Specified route cannot be satisfied, because it requires resources that are currently in use by another route.

Property: SampClk.Src
Property: SampClk.ActiveEdge
Source Device: Dev1
Source Terminal: PFI9

Required Resources in Use by
Task Name: _unnamedTask<1A>
Source Device: Dev1
Source Terminal: PFI3
Destination Device: Dev1
Destination Terminal: ao/SampleClock

Task Name: _unnamedTask<1B>


Is it not possible to have to different sample clocks with two PFI?

Thanks

Guillaume

Message Edité par gbugnard le 01-24-2008 03:41 AM
0 Kudos
Message 1 of 6
(5,664 Views)
Hi gbugnard,

for counting edges you should use counters. In following link you can see that you will need 2 counters for counting raising AND falling edge.
http://digital.ni.com/public.nsf/allkb/15170E05F0F4B65C86256E2400812CD9?OpenDocument
You may use the example shipped with labview --> examples --> Hardware Input and output --> DAQmx --> Counter measurements --> Count digital events --> count digital events.vi
But you have to double this code and use one counter for counting the raising and the other counter for counting the falling edge.


Regards
DianaS
0 Kudos
Message 2 of 6
(5,637 Views)
Hi Diana

Thanks for the answer. Unfortunately, I don't need to count the edges, but to set occurences at both edges of the signal (or to make an operation, when the signal is rising and another operation when the signal is falling). I made a better diagram (see the "Tryd.jpg" image), to explain more clearly what I want. Each time the signal is rising, I want an operation within another while loop to be completed, and the same when the signal is falling. I already tried with a counter, but the think is, it absolutely doesn't work. I have to set a sample clock which scan the PFI for rising or falling edge. Then the VI "Wait for next sample clock" stops the while loops until the next edge comes. This action set an occurence, which will release a parallel while loop. This method works fine with only one PFI, and if I only want to detect a falling or a rising edge.

The analog output is only a dummy task. For this reason, I only give a 0 as output for the two analog ouptu channels.

I guess the problem comes from the two DAQ tasks which are both defined with the analog output. I should only create one task with two analog output channels. The problem is, that I cannot assign two different sample clocks for the same task... So I only can detect the falling or the rising edge... (see the "Two_Output_Tryd.jpg" image).

Regards

Guillaume
Download All
0 Kudos
Message 3 of 6
(5,628 Views)

You've got the right idea by using a dummy AO task to get a hardware-level reaction to the signal.  The problem is that you can only have one timed AO task running at a time.

What problem did you have when trying to use a dummy counter task to do this?  I would expect you should be able to make a dummy buffered edge-counting task that has similar behavior to the dummy AO task.  That's how it'd work on a desktop PCI card, but maybe this is another case where your PCMCI card behaves differently? (Like that other thread we were in recently.)

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 6
(5,613 Views)
Hi gbugnard,

in this case the following link will help you:
http://digital.ni.com/public.nsf/allkb/2D3F6E2F9AAA7B2A86256D600075B88E?OpenDocument
Because as you considered right you can't have 2 AO tasks and you can't have 2 Sample clocks in one tasks.
But you can have 2 counter Tasks.


Regards
DianaS
0 Kudos
Message 5 of 6
(5,607 Views)
Hi DianaS
Your method seems to work quite good! I have no parallel timed loop with two different counters (as timing sources), one for the rising edges and one for the falling edges.
Thank you!
Regards
Guillaume

Message Edité par gbugnard le 01-29-2008 02:59 AM
0 Kudos
Message 6 of 6
(5,590 Views)