I need to trigger a program to run with a contact closure that will interface through a parallel port. I've never done anything like this before. I've found some C# program stuff, but I've never worked with anything outside of QM. Please help me through this.
From what I understand, parallel ports use a high and low voltage (0 and 5V) to send bits of data. So I am pretty sure, but not positive, that the contact closure will just send a high signal on just one of the pins. I'll just need to grab that as a trigger to fire a program that will play audio.
Is there anyway to do this with just QM or do I have to get into other languages.
I am just trying to figure this out in advance, I don't have access to the Parallel port device I am going to be using, but when I load this up on my computer with nothing in the parallel port I get "Input is: 255" This 255, that's the what I should get in this instance? Then I should see that number change when a signal is received?
Also what are the four values received by SetTimer function.
When I export this as an .exe will the hwinterface.ocx file go with it or will I have to do something special. I just want to know little details like this in advance.
Also what exactly is "0x0378"
0x0376 jumps between 80 and 208
0x0377 is 255
0x0378 is 255
0x0379 is 120
others are 0
Most are 255
What do these number represent?
Ok...I see in Device Manager->Printer Port(LPT1)->Resources
there is I/O Range 0378-037F
When I change the value of the "send to output" the next time I open the dialog, the input reads as the new value. Is this what it is supposed to do?
I've been trying to skim stuff on parallel ports, but to be honest it is a bit above my head for now, any little extra information would be much appreciated!
I tested a bit...I could not get the 255 of the input to change by closing contacts, but I could get a voltage reading to go down when I would send a number to the output.
I am going to test some more and see if I am just messing it up.
I would really like to know how to read each pin on the parallel port...I've been trying to make it through all the garble on parallel ports, but it is greek to me still.
Any light on this would be awesome. Thanks.
Jimmy Vig
Maybe this relates to my problem...
From http://blogs.msdn.com/ericgu/archive/200...-port.aspx
"EPP ports aren't automatically configured for input. You need to set bit 5 in the control register (at the base address + 2) to turn it on."
How do I do this? Would this be 0x37a for the port address? What would be the correct value to send to output?
So is this talking about Pin 1 (nStrobe)? I think I remember somewhere else saying something about this toggling between read and writing data.
I don't know...still don't get this stuff, but I am on the edge of understanding.
Also, what's a quick way to convert a number into the 8 bit binary that I would see from the parallel port inputs....for example 255 is 11111111 which would be all high...right?
Ok...so the program you so kindly got me started on polls the changes on the data inputs. I really would like to use the IRQ for an interrupt instead. Do you see from the literature above how I would do this in QM. There is a program written in C given as an example, but I don't know how to recreate that in QM.
I see that I need to set Bit 5 on Base+1 port to high(1) to be able to input and to low(0) to be able to output. I think that is what will allow me to read contact closures, I can't test until I get back onto a PC, my laptop does not have a Parallel port.
Parallel Port reader works great. I am just putting the finishing touches on it and I will post the code.
How would I go about exporting the program to run on non-QM machine. I need to know what to do with the hwinterface control. Could you please give a detailed explanation how to register the osx without QM if that is possible.
Thanks.
So the Parallel Port is actually a pretty neat tool. I can wire any old button up to the parallel port and blammo...extra external control for the computer. So far I have figured out how to successfully read the 8 Data pins, I guess I am supposed to be able to use four control pins and maybe the five status pins too, but I haven't gotten that far yet. Basically I can add eight switches...any type of buttons, momentary, small, large, on/off and use them to fire off programs. If you really wanted you could have an on/off switch maximize a screen when on and minimize when off...so many possibilities!
Will it have a setup program? For example, you can use Inno Setup to create setup programs. It can install the COM dll.
Or the macro can install it using RegisterComComponent function.
Note that if you move the dll to another folder, you must register it again.
-----------------
Or use the dll version (inpout32.dll). Then it just must be in the same folder as your exe or somewhere where Windows could find it. Also, then dialog is not necessary because it is not an ActiveX control.
Returns an error message:
"C:\Program Files\Parallel_Port\inpout32.dll was loaded but the DllRegiterServer entry point was not found. This file can not be registered."
So I use RegisterComComponent to register the osx?
In dlg_parallel_port2 is that what you did?
"Or use the dll version (inpout32.dll). Then it just must be in the same folder as your exe or somewhere where Windows could find it. Also, then dialog is not necessary because it is not an ActiveX control."
Not quite sure what you mean here....
I'm a little slow to the draw...where do I put the .dll to get it to work. When I try to make an .exe it won't let me because the .dll can't be found. So how can I put the .dll in the same folder. Where is somewhere windows can find it. I am pretty new to programming and .dll's are still to me those annoying things that get corrupted and make me scream!
Could I get a simplified step by step...starting with right after I download the dll...then I??
Put the dll in the same folder as your exe.
Also copy it to the QM folder.
Or put it in Windows\System32.
Or put it in any folder and use full path with the dll statement.
Ok, on your computer you can put the dll in system32, or in a folder specified by the PATH environment variable. Then you don't need to have 2 dlls - 1 in qm folder and 1 in exe folder.
On other computers, put the dll in the same folder as the exe. Or in system32.
Ok...I think I have most of the kinks worked out for this. There is a long explanation in a Read Me function in the .qml
To date this is the most interesting project I have done...I'm still thinking of ways to use it, but the possibilities are pretty rad...well to me it's new...maybe to you guys out there this is an old trick.