Setting up Streaming Mode for Quadrature Encoder


dark212

Recommended Posts

Hi there!

I want to read a quadrature encoder using streaming mode with my U3-HV.

Basic Command/Response mode worked fine, but I now require a higher sampling rate.

Before, I just needed to enable two timers in a 'StartUp' sequence, specify the QUAD mode and read from a single 'Timer' channel.

But I can't seem to figure out how to set up streaming mode for this application.

I tried creating channels 200, 224, 201, 225, but I'm not sure how to get the single absolute position of the encoder.

All help will be appreciated!

Thanks in advance!

Alvin.

Link to comment
Share on other sites

First, you still need to enable/configure the timers. You can do that with a startup sequence like before, or use the "config defaults" section of LJControlPanel.

Then you want to stream channels 200 (LSW) and 224 (MSW). To get the total count take Ch200+(Ch224*65536).

http://labjack.com/support/u3/users-guide/3.2.1

Everything in stream mode is considered an analog input channel, so in DF you want to use iotype A/D. I would start with the example U3_StreamTimerCounter.ctl:

http://labjack.com/support/ud/examples/daqfactory

Link to comment
Share on other sites

Thanks for the reply!

I can get the counts to increment nicely, however, if I go the other way past 0 counts, it goes straight to 2^32. Is it possible to make it go negative like it did in basic command/response mode?

And also, since there isn't one single channel that displays the total counts of the encoder, how can I implement logging of this data? There are other input channels I would like to stream and log, so preferably without creating a sequence to continuously calculate the total counts, store it in a variable, and export.

Thanks in advance!

Alvin.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.