| Description: |
| | An Processing Object that provides a programmable logic clock. |
| Operation: |
| | The oClock Object takes a frequency of 283Hz and divides it by a value determined by subtracting the Rate property from 256. [Freq = 283 / (256-Rate)] It then updates the Result property with the resulting clock. An Output property is provided to copy the value of the Result property to another Object's Flag property. If the Mode property is set to 1, then the width of the high-going portion of the clock cycle will only last for 1 Object List Loop. By setting the InvertOut property to 1, this can be switched so that the low-going portion of the clock cycle will only last for 1 Object List Loop. |
| Storage size & Availability: |
| | The following table lists the size and availability of the oClock Object:
| Object | Size | Version |
|---|
 | oClock | 5 Bytes | B.1.0 |
|
| Properties: |
| | The following table lists the Properties of the oClock Object:
| Property | Description | | Address | Returns a pointer to the address of the oClock Object instance. Data-Type: Address, Read-Only Data-Range: 0 - 127 | | InvertOut | A value that specifies if the value of the Result property is inverted before it is copied to the Output Flag property. Data-Type: Bit, Flag Data-Range: 0 - 1 | | Mode | A value that specifies how long the high-going pulse will last. (pulse on/off go high once go low once) Data-Type: Bit Data-Range: 0 - 1 | | Operate | A value that specifies whether or not the data is updated. Data-Type: Bit, Flag Data-Range: 0 - 1 | | Output | A pointer to a Flag Property that will be set to the value of the Result property. Data-Type: Flag-Pointer Data-Range: 0 - 127 | | Rate | A value that specifies the number of times that an internal clock of 283Hz is to be divided. Data-Type: Word Data-Range: 0 - 255 | | Result | A value that is clocked at a rate specified by the Rate property. Data-Type: Bit, Flag, Default Data-Range: 0 - 1 |
|
| Example: |
| | In the following example, the oClock Object is used to
'This program sets up an oClock
'Object that cycles three times
'every second.
Dim A As New oClock
Dim B As New oDio1
Sub Main()
A.Rate = 162
A.Output.Link(B)
A.Operate = cvTrue
B.IOLine = 8
B.Direction = cvOutput
End Sub
|
|
| See Also: |
| | oTimer - A high speed timer. |