oFlipFlop Object

Back to top of page Description:
 A Processing Object that takes two inputs and performs a Flip-Flop function.
 The following table lists the size and availability of the oFlipFlop Object.
 ObjectSizeDescriptionA1A2B1B2C1
oFlipFlop5 BytesProvides a Flip-Flop function.xxx
oFlipFlopC6 BytesProvides a Flip-Flop function.xxx
Back to top of page Operation:
 

In normal operation, the oFlipFlop Object evaluates the oLogic Object that the Input1 and Input2 properties point to and perform a standard flip-flop function based on their values once every Object List Loop.

To perform the flip-flop function the value of Input1 is evaluated first. If Input1 is 1, the Result property is set to 1.  If Input1 is 0 then Input2 is evaluated.  If Input2 is 1, then the Result property is cleared to 0. If Input2 is 0, then no changes are made.  

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 page Property Options:
 The oFlipFlop Object has 2 variants which are selected with the property option C.
  • C specifies that a clocked version of the object is used.
Continuous
operation
Clocked
operation
oFlipFlopoFlipFlopC
Back to top of page Properties:

The following table lists the properties of the oFlipFlop Object:

Property

Description

Operate
A value that selects whether or not the Output objects are updated with the result of the logic operation.
Object Class: oOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
OperateConstantDescription
0cvOffThe operation is not performed.
1cvOnThe operation is performed.
Input1
A pointer to an oLogic Object whose value will used to set the result.
Object Class: oLogicPtrI Value Range: Any oLogic Object
Data Type: Pointer Default Value: Null
InvertIn1
A value that selects if the Boolean value is inverted before used.
Object Class: oSelect0to1L Value Range: 0 - 1
Data Type: Numeric Default Value: 0
InvertIn1ConstantDescription
0cvFalseThe value of the Input1 Object is not inverted.
1cvTrueThe value of the Input1 Object is inverted.
Input2
A pointer to an oLogic Object whose value will used to reset the result.
Object Class: oLogicPtrI Value Range: Any oLogic Object
Data Type: Pointer Default Value: Null
InvertIn2
A value that selects if the Boolean value is inverted before used.
Object Class: oSelect0to1L Value Range: 0 - 1
Data Type: Numeric Default Value: 0
InvertIn2ConstantDescription
0cvFalseThe value of the Input2 Object is not inverted.
1cvTrueThe value of the Input2 Object is inverted.
Output
A pointer to an oLogic Object whose value will be updated with the result of the operation.
Object Class: oLogicPtrO Value Range: Any oLogic Object
Data Type: Pointer Default Value: Null
Result
The result of the Flip-Flop.
Object Class: oLogic Value Range: 0 - 1
Data Type: Numeric Default Value: 0
InvertInConstantDescription
0cvOffThe value of Input2 has been set.
1cvOnThe value of Input1 has been set.
Process
Clock
See Clocked Objects for detail
Object Class: oClockedOperate Value Range: 0 - 1
Data Type: Numeric Default Value: 0
Availability: oFlipFlopC
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 page Examples:
 In the following example, the oFlipFlop Object is used
'This program creates a Virtual 
'Circuits that will turn on I/O 
'line 12 when one button is pushed
'and turn off I/O line 12 when 
'a different button is pushed.

Dim A As New oFlipFlop
Dim X As New oDIO1
Dim Y As New oDIO1
Dim Z As New oDIO1

Sub Main()
  ooPIC.PullUp = 1
ooPIC.Node = 5
  X.IOLine = 8
  X.Direction = cvInput
  Y.IOLine = 10
  Y.Direction = cvInput
  Z.IOLine = 12
  Z.Direction = cvOutput
  A.Input1.Link(X)
  A.InvertIn1 = cvTrue
  A.Input2.Link(Y)
  A.InvertIn2 = cvTrue
  A.Output.Link(Z)
  A.Operate =1
End Sub

Back to top of page Related Items:

 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oGate(1-8,C)16 Objects that provide logic-gate functions.xxxxx
Back to top of page Version History and Bug List:
 Firmware Ver B1: Introduced.

Bugs: No known bugs.


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