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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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!
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
Thanks a lot!