Menu

How to adress a input/output are and merker area

lawi
2015-12-07
2015-12-08
  • lawi

    lawi - 2015-12-07

    Dear David,

    thank you for the great software moka7. Its really usefull for my bachelor work. I understand the most functions of moka7, but I have one question: I want to read for example the input E0.0 or the merker M 1.7.
    How can I do this? How I have to use the command ReadArea(Area, DBNumber, Start, Amount, Data)?
    I know: Area is S7.AreaPE for example and Data is my Buffer, but I dont kow how I have to Adress the rest?

    I hope you can help me!
    Thanks a lot!

     
  • Davide Nardella

    Davide Nardella - 2015-12-08

    To read one bit you need to read the containing byte then extract the bit.
    To read M1.7
    Area=S7.S7AreaMk // Merker area
    DBNumber=0 // we don't care of it
    Start=1 // first byte
    Amount=1 // one byte to read

    Assuming that you passed a generic byte buffer, it will filled starting from the 0 position.

    Then extract the 7th bit using
    S7.GetBitAt(Buffer,0,7)
    where 0 is the first byte into your buffer and 7 is the bit position

    Refer to the manual

     
  • lawi

    lawi - 2015-12-08

    Thanks a lot!

     

Log in to post a comment.

MongoDB Logo MongoDB