Ver Mensaje Individual
  #1  
Antiguo 16-11-2008
gaston260 gaston260 is offline
Miembro
 
Registrado: ene 2008
Posts: 169
Reputación: 17
gaston260 Va por buen camino
Diferente velocidad en distintos pines del puerto paralelo

Hola ! me podrian guiar en una aplicacion con la que estoy practicando , quiero sacar un tren de pulsos por el pin uno del puerto paralelo y cuando intento sacar el segundo tren de pulsos por el segundo pin resulta que un pin ya no va a la velocidad que yo quiero ! , creo que estoy teniendo problemas de logica pero no se como encararlo ! aca paso el codigo

procedure Tform1.Timer1Timer(Sender: TObject);
var
Estado1: String;

begin
if (valorActual = strtoint(txtPararEntrada.text)) then
begin
exit;
end;

if envios1 = 3 then
begin
if checkbox1.checked then
begin
valor := 1;
im3.Brush.Color := clRed;
Estado1 := 'si';
end;
end;

if envios1 = 4 then
begin
im3.Brush.Color := clblack;
valor := 0;
Estado1 := 'no';
end;

if envios1 = 0 then
begin
imReset.Brush.Color := clyellow;
im3.Brush.Color := clblack;
Estado1 := 'Indefinido';
end
else
imReset.Brush.Color := clBlack;
begin
if envios1 = 1 then
begin
im3.Brush.Color := clYellow;
Estado1 := 'Indefinido';
end;
end;
if envios1 = 4 then
envios1 := 2;
Out32(StrToInt(txtpuertobucle.text), valor);
envios1 := envios1 + 1;
be.panels[9].text := 'Envíos: ' + Estado1;
Timer1.Interval := ((strtoint(txtmaximo.text) + 1) - deslizador1.position) {div 1};
end;

//************************************

procedure Tform1.Timer3Timer(Sender: TObject);
var
Estado2: String;

begin
if (valorActual = strtoint(txtPararEntrada.text)) then
begin
exit;
end;
if envios2 = 3 then
begin
if checkbox2.checked then
begin
valor := 2;
im4.Brush.Color := clRed;
Estado2 := 'si';
end;
end;
if envios2 = 4 then
begin
im4.Brush.Color := clblack;
valor := 0;
Estado2 := 'no';
end;
if envios2 = 0 then
begin
imReset.Brush.Color := clyellow;
im4.Brush.Color := clblack;
Estado2 := 'Indefinido';
end
else
imReset.Brush.Color := clBlack;
begin
if envios2 = 1 then
begin
im4.Brush.Color := clYellow;
Estado2 := 'Indefinido';
end;
end;
if envios2 = 4 then
envios2 := 2;
Out32(StrToInt(txtpuertobucle.text), valor);
envios2 := envios2 + 1;
be.panels[9].text := 'Envíos: ' + Estado2;
Timer3.Interval := ((strtoint(txtmaximo.text) + 1) - deslizador2.position) {div 1};
end;

//******************************************************************************

procedure Tform1.Iniciar1Click(Sender: TObject);
begin
Timer1.Interval := deslizador1.position;
Timer2.Interval := (strtoint(txtmaximo.text) + 1) - deslizador1.position;
im1.Brush.Color := clblack;
im2.Brush.Color := clgreen;
im3.Brush.color := clblack;
envios1 := 1;
valor := 0;

if valor = 256 then
Timer2.Enabled := False;
Timer1.Enabled := True;
be.panels[0].text := 'Bucle iniciado';
be.panels[1].text := 'Iniciar 1 Activado';
end;

//************************************

procedure Tform1.Iniciar2Click(Sender: TObject);
begin
Timer1.Interval := deslizador2.position;
Timer4.Interval := (strtoint(txtmaximo.text) + 1) - deslizador2.position;
im1.Brush.Color := clblack;
im2.Brush.Color := clgreen;
im3.Brush.color := clblack;
envios2 := 2;
valor := 0;

if valor = 256 then
Timer4.Enabled := False;
Timer3.Enabled := True;
be.panels[0].text := 'Bucle iniciado';
be.panels[2].text := 'Iniciar 2 Activado';
end;
Responder Con Cita