| An oIOGroup Object provides access to 8 I/O Lines by indexing the available I/O Lines via the value of the Group property. The Group property specifies which group of I/O lines to use. The groups are defined by the physical PIC I/O Ports available in the PIC where 1 = Port B, 2 = Port C and 3 = Port D. Setting the Group property to 0 is a special case that effectively points to nothing. Once the Group property is set, the Direction and the State properties reference the actual hardware that controls the Direction and State of the specified PIC I/O Pins. The State property references the electrical state of the I/O Pins specified. (Note that this property was added in Firmware C.1. See history.) The Direction property specifies if the I/O Pins are inputs or outputs. (Note that this property was added in Firmware C.1. See history.) When the Direction property is set to 0 (cvOutput), then the specified Pins will output either 0 or 5 Volts depending on what the State property is set to. When the Direction property is set to 1 (cvInput), then the specified Pins are set to be an inputs and the State property will report whether or not 5 Volts is being applied to the Pins by an external device. Note that since the Direction and State properties reference the actual hardware of the specified PIC I/O Pin, then changing the Group property will also re-index the hardware that the Direction and State properties reference. This means that you MUST set it BEFORE you set the Direction property for the Direction property to affect the I/O line you want to use. For example, if Pins 8-15 are specified and they are inputs, then the Direction property would read 255 and the State property would report the current electrical state of Pins 8-15. Then if the Pack property was changed to 3 and Pins 24-31 were outputs, the Direction property will now read 0 and the State property would report the current electrical state of Pins 24-31. See other examples below. Note that the Group property is the default property. This means that if an instance of the oIOGroup Object exists, then not only can the Group property be set to 1 by assigning it with the statement "IOGroup.Group = 1", it can also be set with the statement: "IOGroup = 1" as demonstrated in the o7Seg Object's help page. Caution: the I/O lines in Group 2 are used for special purposes such as PWM, serial input/output and DDELink. Be sure that you are not attempting to reuse them if the special functions are in use. |