Knowledge Base

Programming the OBCB is quite simple. The instructions are summarized below:

Starting and stopping counting.

You can start and stop counting either asynchronously (at any time) or in synchronism with the timebase A and B phases.

OBCB_Start   c     ;Start counting on channel c immediately
OBCB_StartA c ;Start counting on channel c when in phase A
OBCB_Stop c ;Stop counting on channel c immediately
OBCB_StopB c ;Stop counting on channel c when in phase B

Note: OBCB_StartA will start counting immediately if the timebase is already in phase A. OBCB_StopB will stop counting immediately if the timebase is already in phase B.

Reading out and clearing the counter

There are two instructions for reading out counts. One clears the counter. By clearing the counter simultaneously with reading it out, you can guarantee not to lose counts if you are totalizing them elsewhere.

OBCB_fRead   c     ;Read the contents of channel c to W as a floating point number
OBCB_fRdClr c ;Read the contents of channel c to W and clear the counter
Testing the timebase

Two instructions allow you to synchronize your program to the A and B phases of the timebase. You will need these only if you are measuring frequency (not counting events/items).

OBCB_GoIfA   llll  ;Go to program line llll if the time base is in phase A
OBCB_GoIfB llll ;Go to program line llll if the time base is in phase B