package nmodbus_test import ( "encoding/binary" "git.noahlan.cn/noahlan/nnet/config" "git.noahlan.cn/noahlan/ntool-biz/nmodbus" "testing" ) func TestA(t *testing.T) { ngin, handler := nmodbus.NewModbusTCPEngine(nmodbus.ModbusTCPConf{ EngineConf: config.EngineConf{ Mode: "dev", Name: "ModbusTCP", }, ByteOrder: binary.BigEndian, }) defer ngin.Stop() handler.DataManager(0x01).WriteSingleHoldingRegister(0, 3) _ = ngin.ListenTCP(config.TCPServerConf{ Protocol: "tcp", Addr: "0.0.0.0:5502", }) }