Answers

0

1. Data parameter is the "address pointer" to which Modbus registers are being stored. In SIMATIC S7 lingo this is the Datablock pointer. Typically this is assigned by the operator ADR(datablock), where datablock can be type ARRAY[0..100] of WORD or similiar.

2. You may use function codes 1,2,3,4 for reading and 5,6,15,16 for writing. NB is the number of registers/bits to read. I would highly recommend that you read up on Modbus protocol first -> http://en.wikipedia.org/wiki/Modbus

3. Data are stored in the datablock assigned by your address pointer, in sequential order.