LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ping parallax with mydaq

I'm trying to read the response from a Ping))) sensor by Parallax using a MyDAQ.  I've created a 556 timer circuit to send the triggerpulses to the Ping, and am able to view the response via external 'scope or the MyDAQ's scope feature. 

 

The input has the trigger burst, on the order of 10s of microseconds, then 750 microseconds later,  the echo return, on the order of milliseconds.

 

When I try to read these with the pulsewidth feature of the counter input, I can only get the first trigger pulse, and not the second, echo, return.  How do I measure both? 

 

I've attached my latest effort, and have tried different combinations of single and double loops, to no avail.  Is there a refresh time that is in the way?

0 Kudos
Message 1 of 3
(2,640 Views)

The issue is that it takes longer than 750 us to destroy and re-create the task so your counter isn't armed in time to pick up the echo return.

 

Although myDAQ doesn't support buffered counter inputs, you should still be able to read multiple samples without having to start a new task.  I suggest trying the following:

 

        Read_2_Samples.png

 

 

I don't have the hardware immediately available to try this out, but I think it should work for what you need.

 

 

Best Regards,

John Passiak
Message 2 of 3
(2,632 Views)

Working nicely now, many thank yous!

0 Kudos
Message 3 of 3
(2,626 Views)