void LoadAwg(FileBuffer fb) { int max_len = SetMaxLen(fb.nbytes); TcpClient sk; Console.WriteLine("awg_port:" + awg_port); if (awg_port == 6666) { sk = new TcpClient("localhost", awg_port); } else { sk = new TcpClient(uut, awg_port); } BinaryWriter writer = new BinaryWriter(sk.GetStream()); writer.Write(fb.raw); sk.LingerState = new LingerOption(true, 0); sk.Client.Shutdown(SocketShutdown.Send); WaitLoadComplete(max_len); sk.Client.Shutdown(SocketShutdown.Both); sk.Client.Disconnect(true); writer.Close(); sk.Close(); }
void RunAwg(FileBuffer fb) { WaitAwgNotActive(); s1.SetKnob("playloop_length", "0 0"); Console.WriteLine(uut + " shot:" + Shot + " load " + fb + s1.GetKnob("shot")); LoadAwg(fb); if (auto_soft_trigger) { s0.SetKnob("soft_trigger", "1"); } WaitShotComplete(); Console.WriteLine(uut + " shot:" + Shot + " done "); ++Shot; }