X2364 MANUAL
19
118044-001 REV E
The protocol for the
Set
Command is as follows:
The power supply receives the “S” command and
performs a checksum comparison and other error
checking. If a communication or other error is detected,
the power supply will not execute the command but will
send an error message back to the computer. If the
checksum compares properly and no errors exist, the
power supply will execute the Set command and return a
simple 2 byte Acknowledgement message. The computer
should then Query the power supply to be sure that the
power supply parameters are set as desired.
The data will be ASCII encoded, where scaling is done in
the Customer computer. The resolution for the two
analog controls is 12 bits, so full scale will be represented
by FFF hex. The first byte, “SOH”, can be entered at the
keyboard by the “CONTROL-A” key combination
(“CTL-A”).
All alphabetical entries should use
CAPITAL
letters
only. Use of lower case letters will result in errors.
The byte definitions of the command message are shown
in Table 8.3. Note that high order bytes are sent first.
An example will illustrate the ASCII data protocol is
used. Assume that the Customer computer sends a
command to the power supply that sets the analog power
parameters to 33kV, 3.75 milliamperes current, and
asserts the digital X-ray On control.
The following 18 byte packet will be sent:
Byte 1
will contain the ASCII character SOH, which will
be sent as 01 hex = 0000 0001 binary (enter Ctrl-A at the
computer keyboard).
Byte 2
is the Set Power Supply command identifier
character S. In ASCII, this is 53 hex = 0101 0011 binary
(enter capital S at the computer keyboard).
Byte 3 through 5
represents the voltage. 33,000 volts is
55% of full scale. Full scale (60,000 volts) with 12 bit
resolution is FFF-hex. 33,000 volts is therefore
represented as 8CC hex (within an error of 1 lsb). Bytes
3-5 will be sent containing the ASCII representation of
8CC (enter 8CC at the computer keyboard):
Byte 3:
38 hex = 0011 1000 binary
Byte 4:
43 hex = 0100 0011 binary
Byte 5:
43 hex = 0100 0011 binary
Byte 6 through 8
represents the current. 3.75
milliamperes is 25% of full scale. Full scale (15mA) with
12 bit resolution is FFF hex. 3.75mA is therefore
represented as 3FF hex (within an error of 1 lsb). Bytes
6-8 will be sent containing the ASCII representation of
3FF hex (enter 3FF at the computer keyboard).
Byte 6:
33 hex = 0011 1011 binary
Byte 7:
46 hex = 0100 0110 binary
Byte 8:
46 hex = 0100 0110 binary
Byte 9 through 11
are required to fill in the control
string. 000 hex should be entered. Bytes 9-11 will be
sent containing the ASCII representation of 000 hex
(enter 000 at the computer keyboard).
Byte 9:
30 hex = 0011 0000 binary
Byte 10:
30 hex = 0011 0000 binary
Byte 11:
30 hex = 0011 0000 binary
Byte 12 through 14
are required to fill in the control
string. 000 hex should be entered. Bytes 12-14 will be
sent containing the ASCII representation of 000 hex
(enter 000 at the computer keyboard).
Byte 12:
30 hex = 0011 0000 binary
Byte 13:
30 hex = 0011 0000 binary
Byte 14:
30 hex = 0011 0000 binary
Byte 15
represents the digital control data. The digital
control byte is assigned as follows (only the least
significant four bits are encoded into the ASCII byte):
Bit 0 X-ray on (On = 1)
Bit 1 0
Bit 2 X-ray Off and reset (Off and reset = 1)
Bit 3 unused
The digital control nibble will therefore contain 0001
binary = 01 hex. The ASCII representation is (enter
number 1 at the computer keyboard):
Byte 15:
31 hex = 0011 0001 binary
The checksum is calculated on all bytes before it excepts
the SOH character. Bytes 16 and 17 will therefore
contain the remainder of a modulo 256 addition of bytes 2
through 15. In hex, these bytes are:
53 + 38 + 43 + 43 + 33 + 46 + 46 + 30 + 30 +
30 + 30 + 30 + 30 + 31hex = 321 hex