WndLpt and 12 LEDs
|
 |
WndLpt introducing
 |
WndLpt is a program designed to regularly set a combination of LPT port digital
output signals in accordance with the script commands.
Supported methods: set, clear, invert state of several pins, shift
left/right, waiting for specified time interval; cycles, subprograms.
This is useful for automatic control LEDs, relays or other devices
directly connected to the LPT port.
Creation of a script is extremely simple, clear and logical.
Preview LEDs and Music Visualization supported.
Just try click to the Preview or Visualisation pictures (by Left and Right buttons).
|
OS: Windows 9x/Me/2000/NT/XP/Vista/Seven
Platforms: 32/64-bit (x86/x64) (x64: AMD64 - Yes, IA64 - No)
LEDs direction examples
Downloads and Links
Download from
sourceforge
Download from codeplex
Description
at wikispace and
Instructions
Description in
Russian
Fast Start
1. Just run wndlpt.exe
2. Drag-n-Drop text file with script to WndLpt window.
3. Script will be automatically compiled and run. JUST
ALL!
4. Now look at the LEDs or other devices connected to LPT
port.
Additional features
1. You can Drag-n-Drop another script to WndLpt window.
2. On startup without command line arguments WndLpt trying
to run a script "autorun.txt".
3. The window can be hidden and shown using the context
menu icon in the taskbar.
4. On F6 performed: read script from file, compile, run.
5. On F11 - Step mode. On F5 - Continue.
6. In the directory "scripts" you can find some training
examples.
7. The script stops when it detects errors in it.
8. Unessential errors errors will be ignored.
9. Script is ANSI or Unicode text. Maximum script file
size restricted by 64 kB for reasons of common sense.
Command line features
Syntax:
wndlpt [-on|-off]
wndlpt [-bkgnd] [filename]
Examples:
wndlpt -on
wndlpt -off
wndlpt -bkgnd
wndlpt -bkgnd script.txt
wndlpt script.txt
wndlpt "c:\program files\script.txt"
wndlpt ".\scripts\script.txt"
Some technical details
Some examples of scripts is available
For low-level LPT I/O used winring0 or inpout32.
Default LPT port is 0x378 in hexadecimal (or 888 in
decimal).
Other port may be specified by the registry key:
[HKEY_LOCAL_MACHINE\SOFTWARE\MAVius\LPT_port]
"addr"=dword:00000378
Masked output:
mask
111111111111
000000000000
xxxxxxxxxxxx
!!!!!!!!!!!!
111000xxx!!!
1010
Cycles:
try, for, while
repz, rep
do obsolete
loop obsolete
Change by mask:
+, -,
~ |
Branches, Subroutines, Labels:
goto, jmp, jump
gosub, call
sub, func, psub
return, ret
Logic:
on
off
nop
and, &
or, +
xor, eor, inv, ~
clr, - |
Logic:
lsl
lsr
asl
asr
rol, rlc
ror, rrc
ssl
ssr
nsl
nsr
not
inc
dec
mul
div |
Syntax
Arguments description
- <mask>
- 1) Sequense of 0 or 1, for ex. 111000111000. Well, mask is binary
number.
2) Alternative way to set mask - enumerating pin-numbers at brackets, for ex. (1),
(2,3,4) or (8,12,5,11), its accordingly to 100000000000,
011100000000 or 000010010011. First byte named as number
1, it's left byte:
LSB MSB
000000000000
123456789012
111
- [count]
- Decimal number from 2 to 100, tells how many times command will be retried.
- [number]
- Decimal number from 1 to 100, it's argument.
- <label>
- Label's name. May consists of letters, digits, and underscore symbol.
- <function>
- Function name. May consists of letters, digits, and underscore symbol.
- [ ms [ sec [ min [hours] ] ] ]
- Decimals sets milliseconds, seconds, minutes and hours. Examples:
sleep 500 ; Pause for 500 ms
sleep 30 100 ; Pause for 100 s and 30 ms
sleep 0 0 20 1 ; Pause for 1 hour and 20 minutes
wait 0 0 10 8 ; Wait while system time less or equal to
8 hours and 10 minutes. At 08:10 AM next command will be performed.
Masked output
- mask 111000xxx!!!
- Set outputs to: 1 - High state, 0 - Low state, x - don't change state, ! - invert one.
Sets of synonyms: «1o», «0.», «xX*». The record oooo....oo..
is analog of 111100001100 and seens more
ostensive (may be).
- mask 1010
- Short form of record. Unspecified bytes will be set such as last specified one. For
ex. 1010 is analog of 101000000000, 01!x
is analog of 01!xxxxxxxxx.
- 111111111111
on
- Set all discrete outputs to High state. Analogues to command on.
- 000000000000
off
- Set all discrete outputs to Low state. Analogues to command off.
- xxxxxxxxxxxx
- Do nothing. Analogues to command nop.
- !!!!!!!!!!!!
- Invert all. Analogues to command not.
- 111000xxx!!!
- Clear/set/don't change/invert outputs.
- 1010
- Short form of record.
Change by mask
Some commands hawe more short and easy equivalents.
- or [<mask> [count]]
+ [<mask> [count]]
- Set pointed pins to 1. Logical OR.
- clr [<mask> [count]]
- [<mask> [count]]
- Set pointed pins to 0. Logical NAND.
- xor [<mask> [count]]
inv [<mask> [count]]
eor [<mask> [count]]
~ [<mask> [count]]
- Invert pointed pins. Logical EOR. (Exclusive OR)
- and [<mask> [count]]
& [<mask> [count]]
- Logical AND.
- nop [count]
- Do nothing.
- lsl [count]
- Logical Shift Left. http://en.wikipedia.org/wiki/Logical_shift
- lsr [count]
- Logical Shift Right. http://en.wikipedia.org/wiki/Logical_shift
- rol [count]
rlc [count]
- Circular Shift Left. http://en.wikipedia.org/wiki/Circular_shift
- ror [count]
rrc [count]
- Circular Shift Right. http://en.wikipedia.org/wiki/Circular_shift
- asl [count]
- Arithmetic Shift Left. http://en.wikipedia.org/wiki/Arithmetic_shift
- asr [count]
- Arithmetic Shift Right. http://en.wikipedia.org/wiki/Arithmetic_shift
- ssl [count]
- Circular Shift Left with 1 priority.
- ssr [count]
- Circular Shift Right with 1 priority.
- nsl [count]
- Circular Shift Left with 0 priority.
- nsr [count]
- Circular Shift Right with 0 priority.
- not [count]
- Invert all outputs.
- inc [number]
- Add number.
- dec [number]
- Subtract number.
- mul [number]
- Mul to number.
- div [number]
- Div to number.
Cycles
- try <count>
while <count>
for <count>
- Perform next command for <count> times. Several commands may be used with using of
curly brackets { }.
- repz <count>
rep <count>
- Perform next command for <count> times, but pauses will be skipped. Several
commands may be used with using of curly brackets { }.
- {
- Must be used in separate line.
- }
- Must be used in separate line.
- do <count>
- Obsolete command. Perform commands disposed between do and loop
for <count> times. Curly brackets may be used, but in this case loop
must not used.
- loop
- Obsolete command. Used with do only if curly brackets not used.
Branches, Subroutines, Labels
- goto <label>
- Goto label. If label not found - command will be skipped.
- jmp <label>
jump <label>
- Goto label. If label not found - script will be stopped and error posted.
- label <label>
:<label>
<label>:
- Defines a label for using with goto/jump/jmp.
- gosub <function>
- Call function. If function not found - command will be skipped.
- call <function>
- Call function. If function not found - script will be stopped and error posted.
- sub <function>
func <function>
(psub <function>) obsolete
- Defines a function (subroutine) for using with gosub/call.
- return
ret
- Performs return from function.
Pauses
- speed [number]
- Set speed. Range SPEED=[10...500]. PAUSE = MULTIPLIER * SPEED.
Default value is 10.
- sleeps [ ms [ sec [ min [hours] ] ] ]
- Directly set pause. PAUSE = ms + sec * 1000 + min * 1000 * 60 + hours * 1000 * 60 * 60.
- sleep [ ms [ sec [ min [hours] ] ] ]
- Directly set pause only for current step.
[Current PAUSE] = ms + sec * 1000 + min * 1000 * 60 + hours * 1000 * 60 * 60.
[Current PAUSE] will be performed only once.
- wait [ ms [ sec [ min [hours] ] ] ]
- Wait while system time less or equal to specified time.
- skip
- Cancels any pauses between previous and next commands (commands with output assumed:
"Masked output" and "Change by mask").
Environments management
- cmd count [number]
- Sets amount of used pins. Default is 12. Available range 1 to 30. Frequently used 8.
- cmd remap [number] [number] ... [number]
- Remaps pins output. Example, in result of:
remap 2 1 4 3 6 5 8 7 10 9 12 11
state 101001011010 will be sets as 010110100101.
- cmd ms [number]
- Set speed multiplier. Range MULTIPLIER=[10...500]. PAUSE = MULTIPLIER * SPEED.
Default value is 10.
- cmd restart
- Restart script.
- cmd show
- Show window WndLpt. Automatically performed by command stop and on
errors.
- cmd hide
- Hide window WndLpt. (Tray icon will stay untouched)
- cmd set_lpt_port_addr_in_decimal_at_owners_risk [number]
- Set another LPT port address. If wrong address set system may be crashed (with BOD)
and looses of data. Default value 0x378 (888) may be overloaded by the registry key:
[HKEY_LOCAL_MACHINE\SOFTWARE\MAVius\LPT_port]
"addr"=dword:00000378
- cmd priority [number]
- Set thread priority. Min 1, max 7. Default value is 7 - maximum priority.
- cmd switch_to_music
- Activate the Music Visualization tab.
Screenshots
   
Version history
WndLpt-0.2.3-a1
* New: Music Visualization
* New: Preview LEDs
WndLpt-0.2.2
* New: Command line support
* New: Documentation added (wiki)
* Fixed: Bug with comments //
WndLpt-0.2.1
* New: Windows Vista/Seven support
* New: x64 support
WndLpt-0.2.0
* New: New Kernel
* New: Dynamic Compilation
* New: Taskbar icon
* New: Simultaneous executing limited
* New: Trace mode
* Improved: New commands added
* Misc: Old scripts capability
WndLpt-0.1.0
* Experimental version
* Easy algorithm
// Feedback: mavjuz@users.sourceforge.net
// Feedback: m a i l t o : m a v i u s @ y a n d e x . r u
// Search project by: mavjuz WndLpt
// GUID: {987A951E-427B-4e41-8CA2-8436C754F921}
Go back
|