LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Re-Triggering rising and falling edge NI 9401 and NI 9215

Hello,

 

I've the problem to use a incremental encoder as trigger to sample analoge inputs. With each rising and falling edge (->NI9401) a new sample should be taken (->NI9215).

By using the example "Acq&Graph Voltage-Int Clk-Retriggerable.vi" I always get the error code -200452 wich tells that the property "Retrigger" is

not supported by the device... Smiley Indifferent

 

 

Any helps?!

0 Kudos
Message 1 of 9
(5,690 Views)

Hi _EMG_,

 

CompactDAQ does not support AI retriggering (more info in this thread). The example you referred to acquires N samples on each rising edge, but since you only need to acquire one sample per edge, you should be able to use an external sample clock instead of a start trigger. Try "Acq&Graph Voltage-Ext Clk.vi".

 

However, an external sample clock causes AI to sample on rising or falling edges, but not both. To sample on both edges, perhaps you could create a digital input task, configure it for change detection with the desired rising/falling edge lines, start it, and use /cDAQ1/ChangeDetectionEvent as the AI task's external sample clock. There also may be a way to solve this using a counter/timer.

 

Brad

---
Brad Keryan
NI R&D
Message 2 of 9
(5,678 Views)

Hi Brad,

 

Thanks for your answer.

 

I solved it now in first step by using a counter as Trigger. With this solution the trigger shot is done when the counter value changes. In digital word this means it is triggerd on one rising edge of one line.

Using rising and falling edge of both lines is with this solution not possible.

 

I tried also to configure a digital task with sample clock "Change detection event", but it seams that this mode is not supported with a NI9174 / NI9401 ...!

 

Any ideas.....?

 

0 Kudos
Message 3 of 9
(5,671 Views)

Hi _EMG_,

 

> I solved it now in first step by using a counter as Trigger. With this solution the trigger shot is done when the counter value changes. In digital word this means it is triggerd on one rising edge of one line.

 

What you're describing here doesn't seem to match the VI you posted. Does that mean that you have a different VI that is working the way you want?

 

> Using rising and falling edge of both lines is with this solution not possible.

 

That's right, to convert both rising and falling edges into an AI sample clock I think you need to use DIO change detection or external circuitry. (However, there may be some clever approach I didn't think of.)

 

> I tried also to configure a digital task with sample clock "Change detection event", but it seams that this mode is not supported with a NI9174 / NI9401 ...!

 

Why does it seem that way? Do you get an error? If so, please post some details.

 

The NI 9174 + NI 9401 combination should support DIO change detection, but if you're using DIO and counters on the same NI 9401 you're very likely to run into the issue described in this knowledgebase: Why Do I Get Error 201133 When Trying To Perform Bidirectional DI/O with My NI 9401 in DAQmx?

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 4 of 9
(5,654 Views)

Hi Brad,

 

what do you mean exactly with "external circuitry"??

 

Jan

0 Kudos
Message 5 of 9
(5,424 Views)

Hi Jan,

 

I meant edge detection circuits OR'ed together. However, I don't think external circuitry is needed if you can use DIO change detection. I don't have a system set up to try it out right now, so I don't know what errors/output caused _EMG_ to conclude that it's not supported.

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 6 of 9
(5,417 Views)

 

Hi there,

 

thank you for your answer, Brad!

 

 

Change Detection isn't possible in this case, because this operation is only executable in digital operations (I believe it is, because I tried, but maybe someone has an idea). But I have to trigger an analogue measuring which is triggered by, and this is the crunchpoint, two digital tracks of an incremental encoder. Furthermore at rising and falling edge because of sufficient accuracy.

 

I have a cDAQ-9174 chassis, 2 9215 and 1 9401 module. I have a traversing unit, the position of the x axis is measured by an incremental encoder type "SICK DGS60" with 10000 lines. The spindle has a slope of 5mm/round. So I have to measure a voltage each line of the two tracks to get enough accuracy. With one track (to trigger only by one track is so simply done) I have an accuracy of 0,005mm. But this isn't enough.

 

I also tried to start the measuring by triggering and then measure with a sufficient rate. But then I have to do that in a while loop to register further edges. Then I have to put the complete task in a while loop, because the task has to be closed each iteration. But then the measuring isn't progressive because of initializing the task.

 

I have the fear this doesn't work with my hardware. Does somebody have an idea?

 

Thanks for your help, everybody.

 

Jan

0 Kudos
Message 7 of 9
(5,403 Views)

Hi Jan,

 

I believe Brad was describing something like this:

 

undefined

 

You should be able to configure a DI task using change detection timing, which will generate a clock (called "/<chassis_name>/ChangeDetectionEvent") on every rising and/or falling edge of whichever lines you want to use.  You can then use this clock to sample your analog input.

 

If you're using the 9401 and you have another task running on the module (e.g. an encoder task) you'll want to make sure to reserve both tasks running on the 9401 before starting.

 

 

Best Regards,

John Passiak
Message 8 of 9
(5,397 Views)

 

 

Hi John,

 

thank you very much for your idea. I tested it and, as far as I can see, it works. Now I'll see if the aquition rate is sufficient.

 

Jan

0 Kudos
Message 9 of 9
(5,370 Views)