Hello all, I have been having some difficulty getting the usb-6211 to read a magnetic encoder. Basically, this encoder is digitized providing a ssi interface. This is like a RS422 in which a clock pulse is needed to retrieve the bits of data through the data line.
I have tried to set one of the counters ctr0 to provide the clock at 1Mhz but when I set the second counter ctr1 as a digital input, I get an error that the resource is reserved. Almost as if it thinks I am using the same resource.
Should the usb-6211 be ableo to both provide a pulse train on one counter and read data on the second counter simultaneously?
thanks in advance.
You should have no problem doing a counter input and counter output task on the same USB-6211 using both counters. But for digital input tasks you should be using either the digital ports or PFI lines. Can you please post a screenshot of your code so we can see how you are implementing this?
Hi Brian, thanks for your reply. I am trying to "proof" the concept so I do not have any hard code sample to post. I have tried doing this as tasks on MAX and get the error I mentioned. I will follow your suggestion regarding using the ports for reading instead of the counter and will post back any updates.
The digital I/O on the 6211 is only software-timed so it won't be very useful for reading back data from the ssi encoder.
You may provide a pulse train on one counter and read data on the second counter simultaneously, but the counter input isn't really what you want to be using. The counter input can count edges (or pulses from a quadrature encoder) and can measure time/frequency, but it can't tell you the current state of the line based on a clock.
I guess it's probably possible to reconstruct your data with a counter input, but it wouldn't be as straightforward as using hardware with hardware-timed digital I/O capabilities (e.g. X Series). If you had to use a counter input to do this, you could do so by using the ssi clock as your sample clock and using the data line as the source for an edge count task--when the count value increases between samples you would know that this would correspond to a 1, if the count value does not increase between samples this would be a 0.
Hi John, thanks for your response. I have found what you explain the hard way. I have tried to simulate a SSI with this device but I have not had luck. The counter input does not work since as you explain it counts pulses (rising or falling edges) and not necessarily data.
My last attempt involved re-wiring the clk output back into one of the pfi lines and utilizing that as a dio trigger but the device does not seem to be fast enough. I suspect the software-timed limitation you referred to is to blame for this behaviour.
Anyways, it is a 13 bit encoder and I am about to explore the use of more suited hardware to accomplish this. I will look at the X series you mentioned.