oDIO8 Object

Main Index
Object List
Back to top of pageDescription:
 The oDIO8 Object manages 8 of the I/O Lines in such a way that they can be used in a virtual circuit. 

The eight I/O lines can be set to read the electrical state presented on them or set to output a specified electrical state.

The difference between this object and the oIOGroup Object is that oIOGroup will use 1 byte of variable memory while the oDIO8 uses 1 byte of object memory.  This can be an important difference when creating large programs. 

 The following table lists the size and availability of the oDIO8 Object.
 ObjectSizeDescriptionA1A2B1B2C1
oDIO81 ByteProvides an 8 line digital I/O.xxxxx
Back to top of pageOperation:
 

An oDIO8 Object's State property represents the binary value of the electrical state of the I/O lines specified by the IOGroup property. The I/O groups are 8 contiguous I/O Lines beginning at I/O line 8, 16, or 24. The Direction property specifies if the I/O Lines are inputs or outputs.

When the Direction property is 1 (an input), the electrical state of the specified I/O Lines are copied to the State property once each Object List Loop.

When the Direction property is 0 (an output), the electrical state of the specified I/O Lines are set to the state of the State property once each Object List Loop.

Note that the Direction property is a single bit.  When set, it will set all eight I/O Lines accordingly.  When the IOGroup property is set, the Direction property is updated to reflect the current state of the specified I/O Lines by copying the current direction from the 1st Pin's direction register.

The IOGroup property is an instance of the oIOGroup object which is created when the oDIO8 object is.  The oDIO8 object uses the oIOGroup Object to do the actual I/O to the eight I/O lines.  Since the default property of the oIOGroup specifies which I/O lines to work with, then the IOGroup property can be directly specified.  Example: IOGroup = 1. (see oIOGroup object for more detail)

3 physical 8-bit I/O Groups are implemented within the ooPIC.

Caution: IOGroup 2 is used for special purposes such as PWM, serial input/output and DDELink..  Be sure that you are not using this IOGroup if these special functions are in use.

Back to top of pageProperties:
 

The following table lists the properties of the oDIO8 Object:

Property

Description

State
A value that indicates the state of the I/O Lines.
Object Class: oValue Value Range: 0 - 255
Data Type: Numeric Default Value: 0
Bit Value in StateConstantDescription
0cvOffThe specified I/O line is at 0 Volts.
1cvOnThe specified I/O line is at +5 Volts.
IOGroup
A value that specifies which group of 8 I/O lines is used.
Object Class: oIOGroup Value Range: 0 - 3
Data Type: Numeric Default Value: 0
IOGroupConstantDescription
0cvOff

The instance of the oDIO8 Object is inactive.

1 

The oDIO8 Object uses pins 8 - 15 for its I/O.

2 

The oDIO8 Object uses pins 16 - 23 for its I/O.

3 

The oDIO8 Object uses pins 24 - 31 for its I/O

Some I/O Lines have special purposes.  Be sure to see oIOGroup for details.
Direction
A value that specifies if the I/O Lines are used as Inputs or Outputs.
Object Class: oProperty Value Range: 0 - 1
Data Type: Numeric Default Value: 0
DirectionConstantDescription
0cvOutput

The specified I/O Lines are outputs and the State property is written to them.

1cvInput

The specified I/O Lines are High-Z and the State property is read from them.

Note that the Direction property affects the IOGroup currently selected.  If the IOGroup is subsequently changed, then the Direction will change to reflect the Direction of the new IOGroup.
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 pageExamples:
 In the following example, the oDio8 Object is used.
'This program creates one oDio8 Object
'and outputs a count pattern.

Dim A As New oDIO8

Sub main()
  A.IOGroup = 1
  A.Direction = cvOutput
  Do
    A.Inc
  Loop
End Sub

Back to top of page Related Items:

 The following table lists objects with related functions
 ObjectDescriptionA1A2B1B2C1
oDIO1Provides a 1 bit digital I/O.xxxxx
oDIO4Provides a 4-bit digital I/O.xxxxx
oDIO8BProvides an 8-bit digital Output with blanking.x
oDIO8FProvides an 8-bit digital I/O with flow control.xxx
oDIO16Provides a 16-bit digital I/O.xxxxx
Back to top of page Version History and Bug List:
 Firmware Ver A1: Introduced.

Bugs: No known bugs.


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