The parallel port is a simple and super-cheap way to hook-up a maximum of 8 different switches to a PC, obviating the need for a keyboard in interactive installations. But I haven’t seen any examples here of someone actually using the Port(Devices) to get input from the LPT port.
I also haven’t been able to get it to work, but I’m a brand new user to vvvv, so perhaps I’m missing something. But I was able to get it working easily in VB using the IO.DLL.
You just have to first write a byte (E4h/228d) to the control port (37Ah/890d) in order to set the port to bi-directionality, then you can just read the input on the 8 data pins at 378h/888d.
As I mentioned, this is easy as pie in Visual Basic, but for some reason I’m unable to do it in vvvv. Perhaps because of execution order? Any suggestions?
I guess you didn’t notice that I wrote that I’d already copied the .DLL and written a VB program that used it. I was just having troubles with the vvvv implementation, which I’ve now sorted out.
Anyway, since no one seems to have posted something for this here yet (using the parallel port bi-directionally for both reading and writing 8 bits - for switch input, relay output, etc), I’ve attached my patch here.
Edit: Just wanted to add the link for the io.dll in the patch so it’s all in one place. But can’t seem to get rid of the old patch - oh well… sorry I’m new here ;)
Absolutely, but you’d need to know some low-level data about the scanner (protocols, etc) which might be hard to find out. But if it does use Centronics or some other standard protocol, it would be no problem to make a patch that uses the scanner data elsewhere in vvvv.