Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting measurements after a digital input rising edge

Hello to all,

 

For my project I am trying to record a small amount of measurements

using a digital trigger.

At first I am using an analog module for the measurements, and I would like

that my software start recording (or maybe also acquiring), when a rising digital event occur, on a Terminal of a digital input Counter (here I am using here the NI 9361)

So, I programmed my Software basing on the Simulation devices on my cDAQ, and it seems to be working very well.

Then When I've changed the different controls on the front panel to those of the real project (you will find the different controls labelled in yellow)... The SW didn't work, or let me saying didn't display any measurement till the end of the iteration time.

 

Please if someone could help me, I 'll be very thankful. 

I am attaching below my VI.

 

 

 

 

 

0 Kudos
Message 1 of 12
(5,671 Views)

Hello youkou,

 

can you please try that the slave first started before the master start.

Unbenannt.PNG

 

best regards
Alexander
0 Kudos
Message 2 of 12
(5,629 Views)

Hello Duffy2007,

Thank you very much for your reply.

I've tried with your suggestion it remains the same problem.

But After I made some modification on my software, also I've modified the source as shown on the image attached below.

My question here, that I cannot really judge whether my measurements are correct or not., because I am expecting to wire my start trigger source to the input terminal of the counter.

So what I've did is to make the DAQmx Trigger property node and the Start Digital Edge VI, sharing the same time base , also as shown in the front panel image. And from here I started to get and record measurements.

I don't really know if this is the solution for my problem or not. And please if you have any other suggestions.

You can find also a figure for the signal used as input for the counter module. 

Many thank in advance.

Regards,

Youkou.

 

0 Kudos
Message 3 of 12
(5,624 Views)

Hello       youkou,

 

in the attached snipped you see the AI is the master and the CTR the slave with every clock pulse of the AI the counter will be read the edge count out, so they are synchroniced. Is this what you want to do sync AI and CTR measurement?

 

trigger.png

best regards
Alexander
0 Kudos
Message 4 of 12
(5,615 Views)

Hello again,

So what I want to do is to start recording measurements once the counter receives 

a rising edge. And for sure both channels must be synchronized (counting, and analog channel).

I made once more other modification on my SW.. I think this one makes sense better than the other one.  

So anymore suggestions to add ?

Thank you in advance  🙂 

Kind regards,

 

 

 

0 Kudos
Message 5 of 12
(5,610 Views)

Hello youkou,

 

remove the timing in the while loop and use the samples to read to make the timing for the loop. If you want only measure a finite time the samples can also be used to set the time. You can use the count edges input trigger as the trigger for ai and for the counter, because this input should start all.

 

Why are presamples needed?

best regards
Alexander
0 Kudos
Message 6 of 12
(5,605 Views)

Hello Duffy2007

 

Thank you for yours suggestions.

I used the reference trigger in order to acquire also some samples just before the

the triggering event. 

 Kind regards,

0 Kudos
Message 7 of 12
(5,589 Views)

Hello youkou,

 

can you please post the code and a description, what is not working.

Thanks

best regards
Alexander
0 Kudos
Message 8 of 12
(5,417 Views)

Hello again, 

 

Well, after testing my code for the first time, the measuring channel seems not taking in account the Digital edge coming from the counter, I 've tried to correct it, but that doesn't work.

I would appreciate any help you cam provide 🙂 

Thank you in advance,

Please find attached the code that i ve done so far.

0 Kudos
Message 9 of 12
(5,412 Views)

Hello youkou,

 

if i understand you correct you are missing counts?

Did counting work, if you are using a testpanel in MAX?

Have you tried the example i attached in an earlier post?

 

Remove timing form the while loop. Set the same value for reading samples for the counter and the ai. AI should be the master and the counter the slave task.

best regards
Alexander
0 Kudos
Message 10 of 12
(5,406 Views)