Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting impulses/counter from encoder

Hello again

 

I've managed to connect my encoder to USB 6009 and I wrote a program which counts the impulses and turns on a diode at X impulses and turns it off at Y impulses. What I want to do now is to make it work continuously without any buttons and so on. Now it works only between 250 and 500 impulses, then the diode would never turn on again (of course), because I've used the 'In range and coerce' block (see my atachment).

 

I tried to solve it in several ways. At first I tried to use Event Structure, but I don't have enough skill to succeed. Then I tried the Case Structure to reset the signal when it's more than 500 - but failed again. Is there any way to reset the signal automatically when it reaches the set value, so it starts counting from 0 again? Or maybe any other ways to do it?

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

Can't edit my post now, so I'm writing a new one.

 

I managed to solve my problem somehow. Instead of using 'in range and coerce' and case/event structures I've put 'quotient and remainder' (see attachment). I't doesn't actually reset the signal, but it resets the counter on my 'camera diode' (I haven't connected camera yet), so te diode lights on and of between the set interval.

 

Now there is my last challenge - I had to connect my line camera and replace the diode with it, so the camera will be activated by the encoder and will make an acquisition of the picture between X and Y impulses. Can you give me any advices how to do it?

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