Description: |
| | The oNib Object manages a 4-Bit variable that can be used in a virtual circuit. As well as the value of the variable, status properties are also provided that can be used in a virtual circuit. There are three main differences between this object and a standard Nib variable.
- This Object's Value property is an instance of the oValue Object which can be pointed to by a Virtual Circuit.
- This Object maintains status bits which can be pointed to by Virtual Circuits.
- This Object is 4-bits larger in order to store the status information.
|
| | The following table lists the size and availability of the oNib Object.
| | Object | Size | Description | A1 | A2 | B1 | B2 | C1 |
 | oNib | 1 Byte | Manages a value with a range of 0 to 15. | x | x | x | x | x |
|
Operation: |
| | An oNib Object variable stores a 4-Bit value in its Value property and maintains other values that represent the status of those 4 bits. The MSB property indicates the Most-Significant-Bit of the value which can be used to indicate when the value is more than half. The NonZero Property indicates if the value is not zero. |
Properties: |
| | The following table lists the properties of the oNib Object:
Property | Description |
| Value |
| The value of the 4-bit variable. |
 | Object Class: | oValue | | Value Range: | 0 - 15 |
| Data Type: | Numeric | | Default Value: | 0 |
|
|
| MSB |
| A value that indicates the Value property is more than half its range. |
 | Object Class: | oProperty | | Value Range: | 0 - 1 |
| Data Type: | Numeric | | Default Value: | 0 |
|
The MSB property reflects the most significant bit (MSB) of the oNib Object's Data property and therefore is updated when either the Value property or the Data property is written to. Any writes the the MSB property will result in changing the most significant bit of the Data property. |
| MSB | Description |
| 0 | The Value property is 7 or less (Less than half) |
| 1 | The Value property is 8 or more (more than half) |
|
|
| NonZero |
| A value that indicates the Value property is more than zero. |
 | Object Class: | oLogic | | Value Range: | 0 - 1 |
| Data Type: | Numeric | | Default Value: | 0 |
|
| The NonZero property is updated when the Value property is written to. Any modifications that are made directly to the Data property will have no effect on the NonZero property. |
| Notes on virtual circuit usage: Not all implementations of the oNib Object have a linkable NonZero property. While all instance of the oNib Object that you create in your programs will have a linkable NonZero property, some of the ooPIC Objects create a custom oNib Object instance that cannot. |
| NonZero | Constant | Description |
| 0 | cvFalse | The Value property is zero. |
| 1 | cvTrue | The Value property is not zero. |
|
|
| Data |
| The data for the Value property. |
 | Object Class: | oVar4 | | Value Range: | 0 - 15 |
| Data Type: | Numeric | | Default Value: | 0 |
|
|
| Address |
| Returns a pointer to the address of the oCounter Object instance. |
 | Object Class: | oAddress | | Value Range: | 0 - 127 |
| Data Type: | Pointer (Read Only) | | Default Value: | Address of Object |
|
|
|
Methods: |
| | The following table lists the Methods of the oNib Object
| Method | Description |
| Value.Clear | Clears the Value property to 0. |
| Value.Dec | Decrements the Value property by 1. |
| Value.Inc | Increments the Value property by 1. |
| Value.Invert | Inverts the bits in the Value property |
| Value.LShift | Shifts the bits in the Value property left. |
| Value.RShift | Shifts the bits in the Value property Right. |
| Value.Set | Sets the Value property to 15. |
| Init | Initializes the properties. |
|
Example: |
| | In the following example, a Virtual Circuit is created that outputs the NonZero status property.
' This program creates a Virtual
' Circuit that connects the oNib's
' NonZero property to a Digital
' Output. Starting from a
' value of 10, it decreases the
' oNib's Value property every
' 1/10 of a second.
Dim V As New oNib
Dim W1 As New oWire
Dim L1 As New oDIO1
Sub main()
L1.IOLine = 8
L1.Direction = cvOutput
W1.Input.Link(V.NonZero)
W1.Output.Link(L1.State)
W1.Operate = cvOn
V = 10
Do
V.Value.Dec
Delay = 100
Loop
End Sub
|
|
Related Items: |
| | The following table lists objects that use the oNib Object.
| | Object | Description | A1 | A2 | B1 | B2 | C1 |
 | o7Seg | An Object that displays a number on a 7-Segment LED display. | x |
 | o8Bar | An Object that displays a number on an 8-Segment LED bargraph. | x |
 | oKeypad | Reads a 4 x 4 Keypad matrix. | x | x | x | x | x |
 | oLED | Controls an LED light. | x | x | x |
|
| | The following table lists other objects with related functions.
| | Object | Description | A1 | A2 | B1 | B2 | C1 |
 | oBit | Manages a 1-bit value with a range of 0 to 1. | x | x | x | x | x |
 | oNibX | Manages a 4-bit signed value with a range of -8 to +7. | x |
 | oByte | Manages a 8-bit value with a range of 0 to 255. | x | x | x | x | x |
 | oChar | Manages a 8-bit signed value with a range of -128 to -127. | x | x | x |
 | oWord | Manages a 16-bit value with a range of 0 to 65,535. | x | x | x | x | x |
 | oInt | Manages a 16-bit signed value with a range of -32,768 to +32,767. | x | x | x |
 | oBuffer(1-32) | 32 Objects that Manage various sized data-buffer/string variable. | x | x | x | x | x |
|
Version History and Bug List: |
| | Firmware Ver A1: Introduced. Bugs: No known bugs. |