Menu

How to write single bit in Settimino

2018-02-27
2019-09-10
  • Marcel Schuurman

    First of all thanks tot David for making it possible to communicate with a PLC using Settimino, Snap7 and Libnodave. Great Job!

    I am using these library's for a few years tot communicate to my PLC (as Master Domotica) í am a hobbiest but i managed to connect to PLC with Linux, Windows and Android.

    My Domotica PLC works mostley with the use of I/O's (Inputs.Outputs and Merkers) and some reading of DB's. I'managed tot have do that with all platforms.. I use several RPI's to send On/Off status to PLC IO, but now i want to use NodeMCU's to send Sensor I/O to PLC but i dont know how to do in Settimimo

    I use this command to set a single bit for example Input 10.0 .
    Client->WriteArea(S7AreaPE, 0, iStart, iLen, S7WLBit, &MyByt)
    Where iStart = 108+0 this works great!
    But in Settimimo
    int WriteArea(int Area, uint16_t DBNumber, uint16_t Start,     int Amount, void
    pUsrData);
    i mis the possibility S7WLBit.

    Can someone help me to explain how to set a single bit

    Thanks in advance.
    Marcel.

     
  • Long Nguyen

    Long Nguyen - 2019-03-26

    Sorry,
    Where iStart = 108+0 ?? Where 108 ?

     
  • Davide Nardella

    Davide Nardella - 2019-03-26

    Can someone help me to explain how to set a single bit
    Settimino 2.0 (just released) allows single bit read/write.
    Have a look at Settimino.h, sorry I didn't update the Docs.

     
  • fabio

    fabio - 2019-09-10

    I had the same problem, with ReadBit it gave me an error in the array of extracted bits and I solved this.

    I write with -
    Client.WriteBit (S7AreaDB, dbc, R_byte, R_bit, state);
    and I read it with
    byte Buffer [1];
    int _R_bit = R_byte * 8 + R_bit;
    Client.ReadArea (S7AreaDB, dbc, _R_bit, 1, S7WLBit, & Buffer);

    I hope I was helpful.

     

Log in to post a comment.