I am using ParallelPort
to do communicate with One Electric Device.
My Task on ParallelPort
is to just start and stop device.
For that I have write up following code:
[My Code is written in C#.Net]
One static
Class ParellelPort
which contain Method static extern void Output(int address, int value)
.
public static class ParellelPort
{
[DllImport("inpout32.dll",EntryPoint = "Out32")]
public static extern void Output(int address, int value);
}
Using that method
I do write something on ParallelPort
in my case just writing 1 and 0.
For starting and stopping Device. i using following Code.
private const int PORT_ADDRESS = 0x0378;
int startMachine = 1;
int stopMachine = 0;
ParellelPort.Output(PORT_ADDRESS, startMachine); //For starting Device.
ParellelPort.Output(PORT_ADDRESS, stopMachine);//For Stoping Device.
Now my PROBLEM IS,
Whenever i am starting CPU it cause start Device automatically as CPU writing on Parallel
Port each time it starts.
So starting of CPU start my DEVICE I need to get rid of it.
Is there any way to disable ParallelPort or way something like this to get rid of it.
NOTE:
I am using PIN-2 for Communicate with my device.
Each time I write value=1 on ParallelPort
5 volt is available at PIN-2 and
When write value=0 on on ParallelPort
0 volt is available at PIN-2 (this cause stops my Device).
And whenever CPU start 5 volt is available on each DataPort Pin from PIN-2 to PIN-9.
Thanks.....