Jump to content
  • 0

Issues When Using Max and Min Limit Registers


Question

Posted

I'm currently reading from a Quad08 card into a c# program using the Universal library.

Here is how I'm configuring the counter I'm using

CounterMode mode = CounterMode.Bit32 | CounterMode.RangeLimitOn | CounterMode.Rollover;
ErrorInfo err = board.CConfigScan(Axis, mode, CounterDebounceTime.DebounceNone, CounterDebounceMode.TriggerBeforeStable, CounterEdgeDetection.RisingEdge, CounterTickSize.Tick20ns, 0);

My understanding is that when setting a max limit it is supposed to roll over to the minimum limit when reached. When I set the max Limit it gets to the max limit and stops. I had Assumed that the minimum limit would default to 0. Unfortunately when it gets to 1000 it stops

err = board.CLoad32(CounterRegister.MaxLimitReg0, 1000);

So I tried setting the minimum limit to 0

err = board.CLoad32(CounterRegister.MinLimitReg0, 0);

However when I do this I receive the error

Bad counter arg passed to cbCLoad.

Is there something I'm missing here to be able to set and roll over at the limits?

1 answer to this question

Recommended Posts

  • 0
Posted

Use the following:  CounterMode mode = CounterMode.Bit32 | CounterMode.Totalize| CounterMode.ModuloNOn;

CounterMode.RollOver is not an option for the USB-QUAD08.

The USB-QUAD08 doesn't have minimum limit registers, so set only the maximum limit register.

To recap, RangeLimit will count to 1000 and stops; ModuloNOn will count to 1000 repeatedly.

This information can be found in the UL Help file. It is on the USB-QUAD08 page, which can be found using the search function.

 

image.png

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...