118153-001 Rev. B
13
The application can be set to either default to a specific COM Port
or the End User can be allowed to choose one for the particular PC.
After initial configuration the following could be an example C#
code routine to set up a transmit array, to build and send out a
message to the COM port.
Void
SendCommand(
Command
cmd,
string
[]
parameters,
ref
byte[]
buf)
{
Array
.Clear(buf,
0,
128);
//
Clear
a
transmit
buffer.
len
=
BuildCommand(cmd,
parameters,
buf);
//
Build
Message.
port.Write(buf,
0,
len);
//
Send
buffer
to
COMM
Port.
lastResult
=
CommResult
.CmdGood;
}
For the receive routine, the reply routine would be polled when the
receive buffer is filled with messages. Then a user routine would be
needed to parse the reply messages.
void
ReceiveCommand(ref
byte
[]
buf)
{
//
Wait
for
response
Array
.Clear(buf,
0,
buf.Length);
//
Clear
Receive
Port
port.ReadTimeout
=
50;
port.Read(buf,
0,
128);
//
Read
COM
port
char.
By
char.
Into
//
buffer.
DecodeResponse(buf);
//
Decode
message
in
buffer.
}
Содержание 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 ...