Skip to content
ggodart edited this page Jan 5, 2021 · 1 revision

Parallel port item

See original

SYNOPSIS

Item which follows digital logic state on standard PC parallel port inputs.

Each item should be defined with a pin number and description.

Example:

 use Parport_Item;
 $input1 = new Parport_Item('10', 'Test device on DB25 pin 10');

 print "Parallel port pin 10 now $state\n" if $state = state_now $input1;

DESCRIPTION

All inputs are pulled high in a typical parallel port (+5 V) when disconnected/open. The item is considered on if the voltage is +5 V (logic high) and off if voltage is 0 V (logic low). Also note that even for those bits that would normally be inverted in the register (ex: pin 11, nBUSY) are are automatically un-inverted such that all inputs work the same.

Currently a parallel port item only supports the 5 input pins (DB25 pins 10, 11, 12, 13, and 15).

For a description of the various pins see http://en.wikipedia.org/wiki/Parallel_port

Currently the item tries to automatically determine the correct driver, and will default to the first port. This means it should work cross platform but has not been tested on any platform other than Linux

INHERITS

Generic_Item

INI PARAMETERS

METHODS

Method Description
new()
get_pin_state()

DEPENDENCIES:

This code depends on the Perl modules Device::ParallelPort and may require Device::ParallelPort::drv::parport or Device::ParallelPort::drv::win32 depending on your platform. These modules are available from CPAN.

AUTHOR

Jeff Siddall ([email protected])

SEE ALSO

None

Clone this wiki locally