I/O with MSW Logo and XP

Windows NT4, 2000 and XP are all 'high security' "NT- New Technology" operating systems. They prevent conventional program calls to hardware.

It is not possible to use commands such as <OutportB 888 1> on an "NT" system. If you try, MSW Logo will probably shut down and you will lose any unsaved work.

Fred Bulback has written a set of Dynamically Linked Libraries ("DLLs") that overcome the problem. He calls the DLL "io.dll". You can download his DLL from: http://www.geekhideout.com/  

While you are there you should also download Fred's Parallel Port Monitor. It is great for seeing what is happening at the Printer Port without actually requiring an interface.

How it Works

A DLL is "called" as the program is running. (The DLL is not built-in to the software itself.) This is an active (or "dynamic") process. Hence the name. The functions within the DLL are accessed in MSW Logo using the DLLLOAD and DLLCALL commands. When you have finished using a DLL you should use DLLFREE to unload it and free up memory.

STEP 1    Download Fred Bulback's "io.dll".

STEP 2    Copy the DLL into the MSW Logo directory. On an XP system this is probably - 

C:\Program Files\Softronics

STEP 3    Open the MSW Logo Edit window and write your code along the lines of:

to bulback
  dllload "io.dll
  dllcall [v   PortOut   w  1   w   888]
  ;NOTE: The argument calls are in reverse order!
  dllfree
end

STEP 4    Go to the MSW Logo command line and write bulback. The LED on Data Line D0 should go on.

A typical procedure to 'pulse' 8 LEDs would be...

to pulse
  dllload "io.dll
  dllcall [v   PortOut  w   1   w   888]
   wait 30
  dllcall [v   PortOut  w   2   w   888]
   wait 30
  dllcall [v   PortOut  w   4   w   888]
   wait 30
  dllcall [v   PortOut  w   8   w   888]
   wait 30
  dllcall [v   PortOut  w   16   w   888]
   wait 30
  dllcall [v   PortOut  w   32   w   888]
   wait 30
  dllcall [v   PortOut  w   64   w   888]
   wait 30
  dllcall [v   PortOut  w   128   w   888]
   wait 30
  dllfree
end

Remember that the printer port address on your system may be "956" instead of "888".

 

See the MSW Logo 'Help" screens for further information about using  DLLLOAD, DLLCALL and DLLFREE.