Polybench® Reference
Operator that reads data from a parallel port

Parallel Port Input

Overview

This operator forms a hardware connection via the standard parallel port (lpt printer port). The operator can only read values from the port, and cannot write values to the port.

Operator ports

Output lpt: Floating point values

Properties

Find more information about changing properties here: link

StreamName
type: See description
Select which parallel port you want to use.


DeviceInfo
type: Undefined [this value cannot be changed]
Information about the device itself.


Synchronized
type: True or False
Specify if the data acquisition should be synchonized to the central clock (true) or to the device itself (false). You have to re-start the device operator after changing this property.
Select one of those presets:
True or False
True may also be read like 'yes' and false like 'no'

You must set the property to True if you are processing data from multiple data sources (for example this device in combination with a Signal Generator, or another device). How to set up your project in order to process data from multiple data sources, please read the following information carefully: link.

TimeDelay
type: See description
Sets the delay time in seconds that your device requires to send data to this PC. Only works if Synchronized is True. You have to re-start the device operator after changing this property.


TimeOut
type: See description
The time out time in seconds. This value determines how long Polybench is waiting for data, before it assumes the device is off. You have to re-start the device operator after changing this property.


SyncID
type: See description
If this device should start and stop synchronously with other objects, then they should all have an equal SyncID. This is a word or number you can think out yourself.

For more information about the behavior of the START, STOP and RESET actions in relation to the SyncID setting, please read more here: link.

Caption
type: Word or phrase
The name of the object in the project. This name must not contain '.' or '$' characters.

Every object has the Caption property. This property is very important, because it is the name by which Polybench recognizes this object.
It is allowed to give multiple objects the same name, as long as the objects are of the same type. In that case, a reference to this caption includes all the objects with the same caption.
In Polybench, every object can be addressed by an Address specifier, which starts with the dollar sign, for example: $My Page.My Object. 'My Page' would be the Caption of a page, and 'My Object' the Caption of an object on that page.

Documentation
type: See description
Optional documentation of this object.

It is good practice to write in short notes why you have used this object, and why its properties are set the way they are set. If this object is an operator, the Documentation text is displayed below the operator symbol.

Variable Parameters

Find more information about Variable Parameters here: link

Devices
type: Parameter list (see link)
A list of devices that the user can selec. You may use this to make device selection available in the user interface of your application.

You can use a Drop-Down list (link) or a List viewer (link) to display the contents of this list. This allows your user to select one device, or one port that connects the device (for example a COM-port).
If you want your application to always start with the device choice your user has made the last time, you could use an Application Settings operator (link) and specify the address of this Devices variable.

StreamName
type: See description
Use this variable to store and restore (using the Application Settings operator) the stream name of this device. If you set a new stream name, then this must be one that is available in the Devices parameter list (or the StreamName drop down list of the properties).


MeasuredDelay
type: See description
The average delay in seconds that it takes for the signals to flow from the device driver to your application. Note that the device and the communication medium may add more delay, but the software cannot measure that.

This variable parameter is only changed if the device operator is in Synchronized mode. If the device is system-synchronized, a fixed time delay should be set. The MeasuredDelay parameter shows the actual delay as measured by the system. Use a Variable Viewer to view the changing value.
The MeasuredDelay should show a value that is approximately equal to the TimeDelay property. If the value is greater or less, then Polybench tries to adjust the signals timing so that the value is as set again. If that does not work, so if this value continues to be much less or more, then either the set TimeDelay is too small or too large, or the communication with the device does not run smoothly.

Connected
type: See description
Shows if the software can communicate with the device or its driver. Is pseudo-true ('1') if connected. See also the Connect function.

'Connected' does not always mean that the device can start or is ready to send data. But this variable at least is an indication if the device interface is ready to be used.

Functions

Find more information about Functions here: link

Disable
Disables this operator, so that it does not react on START, STOP or RESET actions.

Enable
Enables this operator, so that it reacts on START, STOP or RESET actions.

Connect
Tries to open a communication channel to the device or its driver with the current settings. If a connection could be made, the variable parameter Connected will be 1.

Details

Note: this operator uses open source software modules. It is not allowed to use this operator in software applications that comply to medical product classes I, IIa, IIb and III.

In the figure below, it is shown which channels are displayed if you connect a Value Viewer to the Parallel Port operator:



The parallel port operator will only work on hardware parallel ports, and not on parallel-to-USB converts, because the port is addressed on PC-hardware level.

This software component uses WinRing0 from OpenLibSys (www.openlibsys.org) and can be distributed freely, providing the following license and copyright notice:

Copyright (c) 2007-2009 OpenLibSys.org. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.