oWire Object

Back to top of pageDescription:
 The oWire Object reads a Boolean value from an Object and copies that value to up to four other objects.  The oWire can be configured to invert the value that it copies and has the option of either continuously copying the value or only copying when an event occurs.
 The following table lists the size and availability of the oWire Object and its variations.
 ObjectSizeDescriptionA1A2B1B2C1
oWire3 BytesCopies the value of an oLogic Object to another oLogic Object.xxxxx
oWire24 BytesCopies the value of an oLogic Object to 2 other oLogic Objects.xxxxx
oWire35 BytesCopies the value of an oLogic Object to 3 other oLogic Objects.xxxxx
oWire46 BytesCopies the value of an oLogic Object to 4 other oLogic Objects.xxxxx
oWireC5 BytesClocked copy of an oLogic Object's value to another oLogic Object.xxx
oWire2C6 BytesClocked copy of an oLogic Object's value to 2 other oLogic Objects.xxx
oWire3C7 BytesClocked copy of an oLogic Object's value to 3 other oLogic Objects.xxx
oWire4C8 BytesClocked copy of an oLogic Object's value to 4 other oLogic Objects.xxx
Back to top of pageOperation:
 The normal operation of the oWire Object is to take the value of the oLogic Object pointed to by the Input property and copy it to the oLogic Objects pointed to by the Output properties once every Object List Loop.  The value that is copied can optionally be inverted by setting the appropriate InvertOut property to 1. 

If the property option "C" is used, then the operation is modified so that this function only occurs once each time an oLogic Object transitions.

Back to top of pageProperty Options:
 The oWire Object has 8 variants which are selected with the property options 2, 3, 4 and C.  
  • 2 specifies that there are 2 outputs. 
  • 3 specifies that there are 3 outputs. 
  • 4 specifies that there are 4 outputs. 
  • C specifies that a clocked version of the object is used.
 Continuous
operation
Clocked
operation
Single OutputoWireoWireC
Two OutputsoWireoWireC
Three OutputsoWireoWireC
Four OutputsoWireoWireC
Back to top of pageProperties:
 

The following table lists the properties of the oWire Object:

Property

Description

Operate
A value that selects whether or not the Input value is copied to the Output objects.
Object Class: oOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
OperateConstantDescription
0cvOffThe copy function is not performed.
1cvOnThe copy function is performed.
Input
A pointer to an oLogic Object whose value will be copied to the Output objects.
Object Class: oLogicPtrI Value Range: Any oLogic Object
Data Type: Pointer Default Value: Null
InvertIn
A value that selects if the Boolean value is inverted as it is read.
Object Class: oSelect0to1L Value Range: 0 - 1
Data Type: Numeric Default Value: 0
InvertInConstantDescription
0cvFalseThe Boolean value is not inverted.
1cvTrueThe Boolean value is inverted.
Output
Output1
Output2
Output3
Output4
A pointer to an oLogic Object whose value will be updated with the value of the Input oLogic Object.
Object Class: oLogicPtrO Value Range: Any oLogic Object
Data Type: Pointer Default Value: Null
InvertOut
InvertOut1
InvertOut2
InvertOut3
InvertOut4
A value that selects if the Boolean value is inverted before stored into the Output oLogic Object.
Object Class: oSelect0to1 Value Range: 0 - 1
Data Type: Numeric Default Value: 0
InvertOutConstantDescription
0cvFalseThe Boolean value is not inverted.
1cvTrueThe Boolean value is inverted.
Process
Clock
See Clocked Objects for detail
Object Class: oClockedOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
Availability: When the property option "C" is used.
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

Back to top of pageExample:
 In the following example, a Virtual Circuit is created that uses the oWire Object to monitor a push button switch on I/O line 9.  When the push button is pressed, it turns on I/O lines 8 and 10 and when it is released, it turns off I/O lines 8 and 10.
Visual Basic Syntax C and Java Syntax
' This program creates a Virtual 
' Circuit that reads an input
' and sets two outputs to the
' same value.

Dim W As New oWire2
Dim S As New oSwitch
Dim L As New oLED
Dim D As New oDIO1

Sub Main()
  'ooPIC.PullUp = 1
  S.IOLine = 9
  L.IOLine = 8
  L.TurnOn
  D.IOLine = 10
  D.Direction = cvOutput
  W.Input.Link(S.Position)
  W.Output1.Link(L.Operate)
  W.Output2.Link(D.State)
  W.Operate = cvTrue
End Sub
// This program creates a Virtual
// Circuit that reads an input
// and sets two outputs to the
// same value.

oWire2 W = New oWire2;
oSwitch S = New oSwitch;
oLED L = New oLED;
oDIO1 D = New oDIO1;

Void Main(Void){
  // ooPIC.PullUp = 1
  S.IOLine = 9;
  L.IOLine = 8;
  L.TurnOn;
  D.IOLine = 10;
  D.Direction = cvOutput;
  W.Input.Link(S.Position);
  W.Output1.Link(L.Operate);
  W.Output2.Link(D.State);
  W.Operate = cvTrue;
}
Basic Syntax
' This program creates a Virtual 
' Circuit that reads an input
' and sets two outputs to the
' same value.

W As oWire2(S.Position,L.Operate,,D.State,,cvOn)
S As oSwitch(9)
L As oLED(8,7,cvOff)
D As oDIO1(10,cvOutput)
Back to top of pageRelated Items:
 The following table lists other objects with related functions.
 ObjectDescriptionA1A2B1B2C1
oGate(1-8,C)16 Objects that provide logic-gate functions.xxxxx
oBus(I,O,C)6 Objects that copy one Object's Value to another Objectxxx
Back to top of pageVersion History and Bug List:
 Firmware Ver A1: Introduced.
Firmware Ver B1: Clocking added.

Bugs: No known bugs.


ooPIC Compiler Ver 6.0 (c) Copyright 1997 - 2007 Savage Innovations, LLC.