118153-001 Rev. B
15
private
static
int
ethernetCommand(
Socket
sock,
string
cmd)
{
int
idx
=
0;
int
timer
=
0;
int
counter
=
0;
byte
[]
buf
=
new
byte
[256];
foreach
(
char
c
in
cmd.ToCharArray())
//
copy
characters
from
cmd
string
{
//
into
buf
for
sending
to
uX
buf[idx++]
=
(
byte
)c;
}
sock.Send(buf,
idx,
SocketFlags
.None);
//
Send
the
command
via
the
socket
Array
.Clear(buf,
0,
buf.Length);
//
Clear
the
buffer,
response
is
put
here
counter
=
0;
//
Counts
the
number
of
bytes
received
//
Response
loop,
keep
reading
socket
until
timer
expires
(timeout)
or
//
the
STX
char
is
found
in
the
buffer
while
(timer
<
6000
&&
(!((
IList
<
byte
>)buf).Contains(ETX)))
{
counter
+=
sock.Receive(buf,
128,
SocketFlags
.None);
Thread
.Sleep(5);
timer++;
}
cmd
=
System.Text.
Encoding
.ASCII.GetString(buf);
return
counter;
}
Содержание uX SERIES
Страница 11: ...uX MANUAL 4 118151 001 REV A Figure 2 1 50kV uX DIMENSIONS ...
Страница 12: ...uX MANUAL 5 118151 001 REV A Figure 2 2 65kVuX DIMENSIONS ...
Страница 16: ...uX MANUAL 9 118151 001 REV A Table 3 2 DC Input Filament Connections ...
Страница 17: ...uX MANUAL 10 118151 001 REV A Figure 3 3 Monitors Voltage Current Control Connections ...
Страница 18: ...uX MANUAL 11 118151 001 REV A Figure 3 4 Recommended Interlock HV on Configurations ...