| | For any ooPIC program, the Object List is composed of each of the Objects that are dimensioned in that program. The Object List Loop is a reference to the way the code for those Objects is executed. Beginning with the first Object, each Object's code is performed sequentially in the order that they are dimensioned. Once each Object's code has been executed, the execution loops back to the first Object and the process begins again. The ooPIC Object is always the first Object in the list, and therefore is the first Object whose code is executed in each Object List Loop. The ooPIC Object is responsible for reading the user program out of the EEPROM and executing the program instructions as they are read. This results in the user program instructions also being executed at the beginning of the Object List Loop. Since the user program is read in from the EEPROM at 2000 instructions per second, several Object List Loops are completed between each program statement being executed. Objects which create conditions that are described as "lasting for one Object List Loop" work in this way: upon the Object's code being executed, the Object sets up the condition and the control is passed to the next Object in the Object List. The code for each subsequent Object in the list and all Objects before the Object in the list are then executed, after which the Object removes the condition. For example, if an Object such as the oOneShot sets a property to 1 for One Object List Loop, then all other Objects in the Object List will see the value of 1 exactly one time. After this, the Object will set the property back to 0. Each Object that has an Operate property has the ability to be turned on and off. When an Object's Operate property is off, the Object is skipped in the Object List Loop. |
| | The order that the Objects are dimensioned can change the results of any Virtual Circuit. In the following example, a Virtual Circuit takes the Value of the oBit Object A, does a logical operation, and stores the result in the Value of the oBit Object D. The logical operation is comprised of the oGate C, which is set up for an Exclusive-Or function and an oWire B on one of the oGate's inputs. The order that the oGate Object and the oBit Object are dimensioned will change the results of the logic operation. 
If the Objects are dimensioned in the following order, the Value of D will always be 0: Dim A as new oBit Dim B as new oWire Dim C as new oGate(2) Dim D as new oBit To demonstrate how this works, when A's Value is changed from 0 to 1, then the Virtual circuit will operate in the following manner:
- A does not require any processing.
- B takes the value of A, which is 1, and stores it into its Result property.
- C takes the value of A, which is 1, and the value of B's Result property, which was just set to 1, Exclusive ORs the two values together which results in a value of 0, and stores that value into D.
- D does not require any processing.
- All subsequent Object List Loops also result in setting D to 0.
However, if the Objects are dimensioned in the following order, in which B is dimensioned after C, the Value of D will be set to 1 for one Object List Loop and then will be set to 0 for subsequent Object List Loops. Dim A as new oBit Dim C as new oGate(2) Dim B as new oWire Dim D as new oBit To demonstrate how this works, when A's value is changed from 0 to 1, then the Virtual circuit will operate in the following manner:
- A does not require any processing.
- C takes the value of A, which is 1, and the value of B's Result property, which starts out as 0, Exclusive Ors the two values together which results in a value of 1, and stores that value into D.
- B takes the value of A, which is 1, and stores it into its Result property.
- D does not require any processing.
- The process repeats, but this time different values are generated because the Result property of B is now 1.
- A does not require any processing.
- C takes the value of A, which is 1, and the value of B's Result property, which was set in the last Object List Loop to 1, Exclusive Ors the two values together which results in a value of 0, and stores that value into D.
- B takes the value of A, which is 1, and stores it into its Result property.
- D does not require any processing.
- All subsequent Object List Loops result in setting D to 0.
|
| | A new set of Objects were introduced in Version B.1.0 of the ooPIC firmware. This new set of Objects operates on event clocks. This is in contrast to the original set of objects that operated continuously. In the original set of Objects found in ooPIC firmware version A, each Object's Code was executed once for each iteration of the Object List Loop. The way to conditionally control the execution of an Object's code is to control its Operate property. For example, if the oGate Object is needed to evaluate its inputs only under certain conditions, an oOneShot Object's Output property can be linked to the oGate's Operate property. When this is done, the oGate's function is performed once when the oLogic Object pointed to by the oOneShot Object's Input property goes high. As of ooPIC firmware Version B.1.0, this function can now be accomplished without the need of using the oOneShot Object. By dimensioning the oGate Object with the "C" property option (oGateC), the properties ClockIn and InvertInC are added to the Object. Linking the ClockIn property to the same oLogic property in the Virtual Circuit, the oGateC will perform its function once when the oLogic property goes high. This is beneficial in several ways:
- Event clocks takes less memory than the equivalent Virtual Circuit using an oOneShot Object.
- Event clocks operate faster than the equivalent Virtual Circuit using an oOneShot Object.
- Event clocks require less setup code to be written.
- The Operate property can be used for other control purposes.
|