LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using a hardware trigger to reset a counter

Hi all...I am trying to using a quadrature encoder with A,B,Z outputs on an e-series card (pci-6052e). the problem is that the card does not support the z output since it only has 2 counters. So i am trying to find a way to get around this problem. I start off using ctr 1 (to the source pin of which i connect the A signal)..to count the events which will tell me how many angles the shaft has rotated through. The only other thing i need is to use the single pulse generated on the z line to reset the count each time it turns high. From reading posts it seems like i have to stop and restart the counter task to accomplish this. So the thing i dont know how to do is to convert that pulse on the z-line to a boolean value so i can run a case loop to stop and restart the task. I can use a daq-mx start trigger to look at the pulse but how do i convert that to a boolean value to run the case loop.

Thanks in advance, Shyam.

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

Hi again..I am attaching a picture of the code in lv..the thing i want to do is to link the trigger output somehow to the case loop..!

Thanks, Shyam.

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

Hi Shyam,

 

Depending on how fast the encoder will be rotating, you can do a few things. The simplist is to just read the Z index on a digital line as you have begun doing. Using a DAQmx Read, you can detect the state of the line and if the rotation is slow enough, you can use the boolean value. Again, this is not ideal. The newer M-Series boards have a counter input for the Z index in addition to being able to do change detection on digital lines which will make this task much easier. See if this works for your needs.

 

Regards,

Kent

Applications Engineer 

Message 3 of 3
(2,285 Views)