Communicate with parallel port

Hi Everybody, I’ve just faced with an exciting problem: I would like to wirte a program, where you move around in an environment, whilst things appear at your sight. This is the easier side of it, but I want to send an 8 bit number to the parallel port to communicate with an instrument that works as a printer (it’s an EEG amplifier, Brain Products GmbH | Solutions for neurophysiological research). The most important thing is to synchronize (in time) the “new thing appeared on the screen” event with the trigger on the parallel port.

Has somebody any idea?

Thanks in advance,

Torok

update Since Unity5 you don’t need Unity pro in order to use native code plugins. So even the personal / free edition can use such a plugin.

Unity pro → native code plugin → access to low-level hardware

Usually the port address of LPT1 is 0x378. I guess you are familiar with the parallel port harware?
If not look here:
http://www.beyondlogic.org/spp/parallel.htm

Unity has no way to communicate with a printer port when running in a web browser. If you have Pro and use the standalone build option then you can talk to the printer port using a plugin. This will require you to write a DLL that does the actual talking.

There are some DLLs you can use - check this link:

http://logix4u.net/Legacy_Ports/Parallel_Port/Inpout32.dll_for_Windows_98/2000/NT/XP.html

You must write a C# script to declare and access the DLL functions. I did it with another DLL (to access joystick rumble feature). In my project, the C# script read a static variable and sent it’s value to the joystick any time it changed value, but it’s better to have a function in the C# script to write whatever you want via DLL functions.

Hi all,

I need to solve a similar question. I’m working with a Mac, and the output would be through a USB port, that will be converted to a parallel port. I wonder whether Agoston Torok solved that, or if there are other better solutions.

Thanks in advance.