Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WriteCoils (WriteCoils sss) Problem #41

Open
guverdik opened this issue May 4, 2020 · 0 comments
Open

WriteCoils (WriteCoils sss) Problem #41

guverdik opened this issue May 4, 2020 · 0 comments

Comments

@guverdik
Copy link

guverdik commented May 4, 2020

procedure TfrmMain.btnWriteClick(Sender: TObject);
var iAmount: Integer; Data: array[0..4096] of Boolean; i: Integer;
begin
mctPLC.Host := edtIPAddress.Text;
iAmount := StrToInt(edtReadAmount.Text);

if CheckBox1.Checked then Data[0] := True else Data[0] := False;
if CheckBox2.Checked then Data[1] := True else Data[1] := False;
if CheckBox3.Checked then Data[2] := True else Data[2] := False;
if CheckBox4.Checked then Data[3] := True else Data[3] := False;
if CheckBox5.Checked then Data[4] := True else Data[4] := False;
if CheckBox6.Checked then Data[5] := True else Data[5] := False;
if CheckBox7.Checked then Data[6] := True else Data[6] := False;
if CheckBox8.Checked then Data[7] := True else Data[7] := False;
if mctPLC.WriteCoils(StrToInt(edtWriteReg.Text), iAmount, Data) then
Label6.Caption := 'PLC Write Success!' else Label6.Caption := 'PLC Write Not Success!';

But not success. What is the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant