Use AGWriteDB to write values to a Data Block and AGReadDB to read them. Because the protocol works with byte buffers, use gos7.Helper to encode values into a buffer before writing, or decode them from a buffer after reading.
// Setup
address := 2710
start := 8
size := 2
buffer := make([]byte, 255)
value := 100
var helper gos7.Helper
// 1. Write to DB
// Prepare the buffer with the value
helper.SetValueAt(buffer, 0, value)
// Write to address DB2710, starting at position 8, size 2
err := client.AGWriteDB(address, start, size, buffer)
// 2. Read from DB
readBuf := make([]byte, 255)
err = client.AGReadDB(address, start, size, readBuf)
// 3. Interpret the result
var result uint16
var s7 gos7.Helper
s7.GetValueAt(readBuf, 0, &result)