Using the setpoint status register, Using, The setpoint status register – Measurement Computing USB-1602HS-2AO User Manual

Page 36

Advertising
background image

USB-1602HS-2AO User's Guide

Functional Details

36

When setting a detection window, keep a sample period in mind. This applies to analog inputs and counter
inputs. Quickly changing analog input voltages can step over a setpoint window if not sampled often enough,
resulting in missed setpoint event.

There are three possible solutions for overcoming this problem:

 Shorten the sample period to give more timing resolution on the counter values or analog values.
 Widen the setpoint window by increasing limit A and/or lowering limit B.
 A combination of both of the above solutions could be made.

Using the setpoint status register

You can use the setpoint status register to check the current state of the 16 possible setpoints. In the register,
Setpoint 0 is the least significant bit, and setpoint 15 is the most significant bit. Each setpoint is assigned a value
of 0 or 1.

 A value of 0 indicates that the setpoint criteria is not met — the condition is False.
 A value of 1 indicates that the criteria is met — the condition is True.

In the following example, the criteria for setpoints 0, 1, and 4 is satisfied (True), but the criteria for the other
13 setpoints is not met.

Setpoint #

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

True (

1

)

False (

0

)

0

0

0

0

0

0

0

0

0

0

0

1

0

0

1

1

<<< Most significant bit

Least significant bit >>>

From the above table we have

10011

binary, or 19 decimal; it is derived as follows:

 Setpoint 0, having a True state, shows 1, giving us decimal 1.
 Setpoint 1, having a True state, shows 1, giving us decimal 2.
 Setpoint 4, having a True state, shows 1, giving us decimal 16.

For proper operation, the setpoint status register must be the last channel sampled.

Advertising
This manual is related to the following products: