Multiple K8055 control

If I’m driving more than one K8055 card in a program I get a problem.

I use:

OpenDevice(0); SetCurrentDevice(0);
If form1.CheckBox1.Checked=true then SetDigitalChannel(1) else ClearDigitalChannel(1);

and there after

SetCurrentDevice(1);
If form1.CheckBox1.Checked=true then SetDigitalChannel(1) else ClearDigitalChannel(1);

Now when I go to the second card, the first card also responds very briefly by briefly flashing (about 0.5 seconds).

Who knows this problem and has a solution?

You can use function SearchDevices.
Use it only once.
Then select the card by using SetCurrentDevice - as you have done.

This program works fine with two cards:[code]procedure TForm1.Button3Click(Sender: TObject);
begin
SearchDevices;
Timer1.enabled:=true;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
Timer1.enabled:=false;
SetCurrentDevice(0);
If form1.CheckBox1.Checked=true then SetDigitalChannel(1) else ClearDigitalChannel(1);
SetCurrentDevice(1);
If form1.CheckBox1.Checked=true then SetDigitalChannel(1) else ClearDigitalChannel(1);
Timer1.enabled:=true;
end; [/code]

No, unfortunately.

I have the codes entered, but the result remains the same.

I think the problem is in the switching time is that I give to the timer.

I turn every second two loupe and it will be too much.

[quote=“TheoHengelmolen”]If I’m driving more than one K8055 card in a program I get a problem.

I use:

OpenDevice(0); SetCurrentDevice(0);
If form1.CheckBox1.Checked=true then SetDigitalChannel(1) else ClearDigitalChannel(1);

and there after

SetCurrentDevice(1);
If form1.CheckBox1.Checked=true then SetDigitalChannel(1) else ClearDigitalChannel(1);

Now when I go to the second card, the first card also responds very briefly by briefly flashing (about 0.5 seconds).

Who knows this problem and has a solution?[/quote]

That code looks like there is only one checkbox controlling digital output 1 on both cards together. Is that intended?

Regards,
Jan

No i used:

OpenDevice(1); SetCurrentDevice(1);

If form1.CheckBox9.Checked=true then SetDigitalChannel(1) else ClearDigitalChannel(1);
If form1.CheckBox10.Checked=true then SetDigitalChannel(2) else ClearDigitalChannel(2);
If form1.CheckBox11.Checked=true then SetDigitalChannel(3) else ClearDigitalChannel(3);

You should use OpenDevice() only once in the callback for the “Connect” button. The fact that you have it in your code on the same line as SetCurrentDevice() tells me that you are calling OpenDevice() all the time inside the timer function, and that is not where that call belongs.

Regards,
Jan

Yes, it works

Thank you!