Description Usage Arguments Value Note Author(s) See Also Examples
Switch individual channels on or off in the parallel port interface card, or read its current state.
1 |
state |
A logical vector of length 8 indicating the state (on or off) for each of the eight individual channels in the parallel interface card. |
change |
If |
port |
The lpt port to which the card is connected. Currently, only
standard LPT1, LPT2 or LPT3 ports are recognized (use lpt1, lpt2 or lpt3,
respectively, or their equivalent numbers, 1, 2 or 3). The default value is
stored in the |
If change = TRUE
, the function returns TRUE
in case of success,
or FALSE
otherwise (note that failure to load required dlls, or trying to
switch to a nonexistant LPT port raise an error).
If change = FALSE
, returns a vector of logical of length 8 indicating
the current state of the interface card. If state
was provided, its names
are reused in the returned logical vector.
These functions use the inpout32.dll
and lpttcl.dll
version 3.0
that are provided in the /bin
subdirectory of this package. These dlls work
only under Windows (95 -> XP) and are probably not compatible with Windows
Vista or higher. They do not work either under Linux or Mac OS X. You must
also copy these dlls in the /windows/system32
directory (administrator
rights required) before you can use them.
Philippe Grosjean Philippe.Grosjean@umons.ac.be
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
# If the parallel interface card is connected to LPT1, this should work:
options(para_port = "lpt1") # Change this to 2 or 3, if needed
para(c(T, T, T, T, T, T, T, T)) # All channels ON
para(c(T, F, T, F, T, F, T, F)) # All odd channels ON
para(c(F, F, F, F, F, F, F, F)) # All channels OFF
# Use a named vector for better tracking of the different channels
st <- c(ch1 = TRUE, ch2 = FALSE, ch3 = FALSE, ch4 = TRUE,
ch5 = TRUE, ch6 = FALSE, ch7 = FALSE, ch8 = TRUE)
st
para(c(F, T, F, T, F, T, F, T)) # All even channels ON
para(st, FALSE) # Read current config, keeping channel names from st
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.