Ich habe das Programm nochmal völlig überarbeitet und es läuft. Die Pinbelegung habe ich von dir übernommen, dass kann man aber jenachdem für andere Steuerungen ändern.

//------------------------------------------------------------------------------
//Autor : Yusuf Kuzu (Haupteil von AIKI)
//Programm: Ansprechen des Parallel Port´s
//------------------------------------------------------------------------------
#include <conio.h>
#include <iostream.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//================================================== ============================
typedef short (_stdcall *inpfuncPtr)(short);
typedef void (_stdcall *oupfuncPtr)(short, short);


extern inpfuncPtr inp32fp;
extern oupfuncPtr oup32fp;

#define PPORT_BASE 0x378

short Inp32 (short);
void Out32 (short, short);

//------------------------------------------------------------------------------
short Inp32 (short Port)
{
return (inp32fp)(Port);
}

void Out32 (short Port, short Data)
{
(oup32fp)(Port, Data);
}
//================================================== ============================
inpfuncPtr inp32fp;
oupfuncPtr oup32fp;

short Daten=0;

void display (short);
void display (short input)
{
Daten=Inp32(PPORT_BASE);
Out32(PPORT_BASE, input);
}
//------------------------------------------------------------------------------
int main()
{
HINSTANCE hLib;
int INF=0, i=0, x=0, y=0, z=0, a=0, b=0, c=0, Zeit=2; //Wartezeit in Millisekunden
//-----------------------Bibliothek wird geladen-------------------------------
hLib=LoadLibrary("inpout32.dll");
if (hLib==NULL)
{
cout<<"inpout32.dll nicht vorhanden"<<endl;
cout<<" PROGRAMM WIRD BEENDET "<<endl;
exit(0);
}
//------------------------Befehl wird geladen----------------------------------
inp32fp=(inpfuncPtr) GetProcAddress(hLib, "Inp32");
if (inp32fp==NULL)
{
exit (0);
}
//------------------------Befehl wird geladen----------------------------------
oup32fp=(oupfuncPtr) GetProcAddress(hLib, "Out32");
if (oup32fp==NULL)
{
exit (0);
}
//-----------------------------------------------------------------------------
display(0); //alles wird auf 0 gesetzt
//-----------------------------Hauptteil----------------------------------------
cout<<"Geben Sie die Bewegung in die Tiefe ein (X-Achse): "<<endl;
cin>>x;
cout<<"Geben Sie die Bewegung fuer die horizontale Achse ein (Y-Achse): "<<endl;
cin>>y;
cout<<"Geben Sie die Bewegung fuer die Hoehe ein (Z-Achse): "<<endl;
cin>>z;
//------------------------- X-Achse -------------------------------
if(x>=0 && x<32767)
{
while (a<x)
{
display(1); // pin D0 an
Sleep(Zeit);
display(0); // alle Pins aus
Sleep(Zeit);
a++;
}
}
else if (x<0 && x>-3276
{
while (x<a)
{
display(3); // pin D0 + Pin D1 an
Sleep(Zeit);
display(0); // alle Pins aus
Sleep(Zeit);
a--;
}
}
else
{
cout<<"Der Wert ist zu groß oder zu klein"<<endl;
}
//------------------------------------------------------------------------------
//------------------------- Y-Achse -------------------------------
if(y>=0 && y<32767)
{
while (b<y)
{
display(4); // Pin D2 an
Sleep(Zeit);
display(0); // alle Pins aus
Sleep(Zeit);
b++;
}
}
else if (y<0 && y>-3276
{
while (y<b)
{
display(12); // Pin D3 + D4 an
Sleep(Zeit);
display(0); // alle Pins aus
Sleep(Zeit);
b--;
}
}
else
{
cout<<"Der Wert ist zu groß oder zu klein"<<endl;
}
//------------------------------------------------------------------------------
//------------------------- Z-Achse -------------------------------
if(z>=0 && z<32767)
{
while (c<z)
{
display(4); // Pin D2 an
Sleep(Zeit);
display(0); // alle Pins aus
Sleep(Zeit);
c++;
}
}
else if (z<0 && z>-3276
{
while (z<c)
{
display(12); // Pin D3 + D4 an
Sleep(Zeit);
display(0); // alle Pins aus
Sleep(Zeit);
c--;
}
}
else
{
cout<<"Der Wert ist zu groß oder zu klein"<<endl;
}
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
display(0); //alles wird auf 0 gesetzt
FreeLibrary("inpout32.dll");
getch();
return 0;
}