oCountDown Object
An Object that counts down to 0.
Description:
 

A Processing Object that decreases another Object's value until that value is zero.

Operation:
 

The oCountDown Object monitors the value of the Object to which the output property links and determines whether it is greater than zero.  If it is zero, then the NonZero property is cleared.  If it is greater than Zero, then the NonZero property is set and the Flag property to which the ClockIn property links is used as a clock signal that will decrement the value of the Object to which the Output property links by 1 for each clock cycle.

The PreScale property is used to divide the ClockIn cycle rate.  If PreScale is set to a value greater than 0, then the ClockIn cycle rate will be divided by that number + 1.  For example, if the ClockIn property is linked to OOPic.Hz60 and the PreScale property is set to 59, then the count down rate will be once every second.

An 8-Bit Value property can be substituted for the Output property by specifying the appropriate property options.

Property Options:
  The oCountDown Object has 1 variant which is selected with the property option O.
  • O specifies that the Output property is replaced with a Value property.
Pointers for both input and output: oCountDown
Signed 8-Bit Value on output: oCountDownO
Storage size & Availability:
 

The following table lists the size and availability of the oCountDown Object and its variations:

ObjectSizeVersion
oCountDown 6 Bytes B.1.0
oCountDownO 6 Bytes
Properties:
 

The following table lists the Properties of the oCountDown Object:

Property Description
Address

Returns a pointer to the address of the oCountDown Object instance.

Data-Type: Address, Read-Only

Data-Range: 0 - 127

ClockIn

A pointer to an Object's Flag property whose value is used as a clocking signal to determine when to decrement the Value of the Object pointed to by the Output property.

Data-Type: Flag-Pointer

Data-Range: 0 - 127

NonZero

A value that specifies if the Output Object's value is zero or not.

Data-Type: Bit, Flag

Data-Range: 0 - 1

Operate

A value that specifies whether or not the data is updated.

Data-Type: Bit, Flag, Default

Data-Range: 0 - 1

Output

A pointer to an Object whose &Value property is decremented for each "Clock-Tick".

Data-Type: Number-Pointer

Data-Range: 0 - 127

PreScale

A value that specifies what to divide the ClockIn rate by.

Data-Type: Byte

Data-Range: 0 - 127

Example:
  In the following example, the oCountDown Object is used
'This program creates a Virtual Circuit
'that will count down from what ever
'number to which B is assigned.

Dim A As New oCountdown
Dim B As New oDio8

Sub Main()
  A.Output.Link(B)
  A.Prescale = 59
  A.Clockin.Link(OOPic.HZ60)
  A.Operate = 1
  B.IOGroup = 3
  B.Direction = cvOutput
  B = 5
End Sub
See Also:
 

oCounter -