Menu

Allgemeine Frage / Problem

Toddie
2023-03-18
2023-04-20
  • Toddie

    Toddie - 2023-03-18

    Ich habe mal ein kleines Delphi-Testprogramm angehängt.
    Da bekomme ich nicht mal ein Connect zustande.
    Kann mir jemand sagen, was ich falsch mache ??


    I once attached a small Delphi test program.
    I can't even get a connect there.
    Can anyone tell me what I'm doing wrong??

     

    Last edit: Toddie 2023-03-18
  • Diego Milzani

    Diego Milzani - 2023-04-20

    I cannot test because i'm using c++ to do some tests with the library, but try to change:
    in procedure TForm1.FormShow

     ModbusBroker.AddDevice(mbTCP, 1, '10.0.90.22', 502);  
    

    Cause the devId is the index (1) in the fieldcontroller and must be the same for all calls

    or use a single ethernet device and don't care the devid

        procedure TForm1.FormShow(Sender: TObject);
        begin
          ModbusBroker := TSnapMBBroker.Create(mbTCP,  '10.0.90.22', 502);
          ModbusBroker.SetLocalParam(1, par_AutoTimeout, 1);
          Timer1.Enabled := True;
        end;
    
     

Log in to post a comment.