The output is a square wave. The samples per channel per second is 2500. I wrote a method to count the pulses per second and the average pulse count is around 900.
If I use a counter (MccDaq.ChannelType.Ctr) to process the output from the Turck encoder and configure the counter as follows:
Question
PhilipW
If I use digital input (MccDaq.ChannelType.Digital16) I am able to read the output from an Turck encoder. The output looks like the following:
0 0 0 1 1 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 1 1 0 0 0 1 1 0 1 1 1 1 0 0 0 1 1 0 0 1 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 1 1 0 0 ...
The output is a square wave. The samples per channel per second is 2500. I wrote a method to count the pulses per second and the average pulse count is around 900.
If I use a counter (MccDaq.ChannelType.Ctr) to process the output from the Turck encoder and configure the counter as follows:
MccDaq.CounterMode Mode = MccDaq.CounterMode.Totalize;
MccDaq.CounterDebounceTime DebounceTime = MccDaq.CounterDebounceTime.DebounceNone;
MccDaq.CounterDebounceMode DebounceMode = 0;
MccDaq.CounterEdgeDetection EdgeDetection = MccDaq.CounterEdgeDetection.RisingEdge;
MccDaq.CounterTickSize TickSize = 0;
int MapCounter = 0;
uLStat = daqBoard.CConfigScan(CounterNum, Mode, DebounceTime, DebounceMode, EdgeDetection, TickSize, MapCounter);
The output looks like the following:
0 1 1 1 3 4 5 5 5 6 7 8 8 8 10 11 12 12 12 12 14 15 15 15 16 17 18 19 19 20 21 22 22 22 23 24 25 26 26 26 28 29 29 29 30 31 32 32 32 34 35 36 36 36 36 38 39 ...
The samples per channel per second is also 2550. The average pulse count per second is around 3500.
Any idea why my pulse counts don't match?
In the encoder data, when a 1 follows a 0, is it a rising edge?
Regards,
Philip
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now