func ClientAGWriteMulti(t *testing.T, client gos7.Client) {
	data1 := make([]byte, 1024)
	data2 := make([]byte, 1024)
	data3 := make([]byte, 1024)
	for i := 0; i < 16; i++ {
		data1[i] = 0x01
		data2[i] = 0x02
	}
	var error1, error2, error3 string
	var items = []gos7.S7DataItem{
		gos7.S7DataItem{
			Area:     0x84,
			WordLen:  0x02,
			DBNumber: 2710,
			Start:    0,
			Amount:   16,
			Data:     data1,
			Error:    error1,
		},
		gos7.S7DataItem{
			Area:     0x84,
			WordLen:  0x02,
			DBNumber: 2810,
			Start:    0,
			Amount:   16,
			Data:     data2,
			Error:    error2,
		},
		gos7.S7DataItem{
			Area:     0x84,
			WordLen:  0x02,
			DBNumber: 2910,
			Start:    0,
			Amount:   16,
			Data:     data3,
			Error:    error3,
		},
	}
	err := client.AGWriteMulti(items, 3)
	if err != nil {
		t.Fatal(err)
	}
	if error1 != "" || error2 != "" || error3 != "" {
		t.Fatal(error1 + error2 + error3)
	}
	AssertEquals(t, "", error1)
}
ClientAGWriteMulti read multi client
package test
import (
	"encoding/binary"
	"runtime"
	"strings"
	"testing"
	"../../gos7"
)
func ClientTestAll(t *testing.T, client gos7.Client) {
	ClientTestWriteIntDB(t, client, 100)
	ClientTestReadIntDB(t, client)
	ClientTestWriteIntDB(t, client, 0)
	ClientTestDirectory(t, client)
	ClientTestGetCPUInfo(t, client)
	ClientTestGetAGBlockInfo(t, client)
	ClientPLCGetStatus(t, client)
	ClientAGWriteMulti(t, client)
	ClientAGReadMulti(t, client)
}
func ClientTestWriteIntDB(t *testing.T, client gos7.Client, value int16) {
	address := 2710
	start := 8
	size := 2
	buffer := make([]byte, 255)
	var helper gos7.Helper
	helper.SetValueAt(buffer, 0, value)
	err := client.AGWriteDB(address, start, size, buffer)
	if err != nil {
		t.Fatal(err)
	}
	AssertEquals(t, err, nil)  
}
func ClientTestReadIntDB(t *testing.T, client gos7.Client) {
	address := 2710
	start := 8
	size := 2
	buf := make([]byte, 255)
	err := client.AGReadDB(address, start, size, buf)
	if err != nil {
		t.Fatal(err)
	}
	var s7 gos7.Helper
	var result uint16
	s7.GetValueAt(buf, 0, &result)
	AssertEquals(t, 100, int(result))
}
func ClientTestDirectory(t *testing.T, client gos7.Client) {
	bl, err := client.PGListBlocks()
	if err != nil {
		t.Fatal(err)
	}
	AssertEquals(t, len(bl.OBList), 10)
	AssertEquals(t, len(bl.DBList), 113)
	AssertEquals(t, len(bl.FBList), 81)
}
func ClientTestGetCPUInfo(t *testing.T, client gos7.Client) {
	info, err := client.GetCPUInfo()
	if err != nil {
		t.Fatal(err)
	}
	AssertEquals(t, strings.Index(info.SerialNumber, "0118701484"), 0)  
}
func ClientTestGetAGBlockInfo(t *testing.T, client gos7.Client) {
	info, err := client.GetAgBlockInfo(65, 2710)
	if err != nil {
		t.Fatal(err)
	}
	AssertEquals(t, info.CodeDate, "22.01.2018")
}
func ClientPLCGetStatus(t *testing.T, client gos7.Client) {
	status, err := client.PLCGetStatus()
	if err != nil {
		t.Fatal(err)
	}
	AssertEquals(t, status, 8)  
}
func ClientAGReadMulti(t *testing.T, client gos7.Client) {
	data1 := make([]byte, 1024)
	data2 := make([]byte, 1024)
	data3 := make([]byte, 1024)
	var error1, error2, error3 string
	var items = []gos7.S7DataItem{
		gos7.S7DataItem{
			Area:     0x84,
			WordLen:  0x02,
			DBNumber: 2710,
			Start:    0,
			Amount:   16,
			Data:     data1,
			Error:    error1,
		},
		gos7.S7DataItem{
			Area:     0x84,
			WordLen:  0x02,
			DBNumber: 2810,
			Start:    0,
			Amount:   16,
			Data:     data2,
			Error:    error2,
		},
		gos7.S7DataItem{
			Area:     0x84,
			WordLen:  0x02,
			DBNumber: 2910,
			Start:    0,
			Amount:   16,
			Data:     data3,
			Error:    error3,
		},
	}
	err := client.AGReadMulti(items, 3)
	if err != nil {
		t.Fatal(err)
	}
	value1 := binary.BigEndian.Uint16(data1[8:])  
	value2 := binary.BigEndian.Uint16(data2[8:])  
	value3 := binary.BigEndian.Uint16(data3[8:])  
	AssertEquals(t, value1, uint16(257))
	AssertEquals(t, value2, uint16(514))
	AssertEquals(t, value3, uint16(0))
}