Open ThinkontrolSY opened 4 years ago
test CPU: SIMENS S7-1211
func TestGetCpuInfo(t *testing.T) { handler := gos7.NewTCPClientHandler("192.168.1.3", 0, 1) handler.Timeout = 5 * time.Second handler.IdleTimeout = 5 * time.Second defer handler.Close() if err := handler.Connect(); err == nil { client := gos7.NewClient(handler) info, err := client.GetCPUInfo() t.Log(err) t.Log(info) } else { t.Fatal(err) } }
return
=== RUN TestGetCpuInfo --- PASS: TestGetCpuInfo (0.07s) plc_test.go:20: CLI : invalid CPU answer plc_test.go:21: { }
test CPU: SIMENS S7-1211
return