The checksum number is the arithmetic sum of each of the bytes modulo 256.
Status packets
When you send a command that does not cause the DC Load to send requested information back to
you, you will receive a status packet back. The structure of a status packet is
Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 to 24 Byte 25
0xAA Address 0x12 Status byte Reserved Checksum
The meaning of the return status byte is defined below:
0x90 Checksum incorrect
0xA0 Parameter incorrect
0xB0 Unrecognized command
0xC0 Invalid command
0x80 Command was successful
Example program
As you have seen, the native programming interface to the DC loads is fairly low-level. It involves
sending 26 byte commands and receiving 26 byte responses from the instrument. To demonstrate
how to write your own source code to remotely control the DC load, we provide a custom program
written in python which translates well into other text based languages like C/C++
About Python: Python is a dynamic object-oriented programming language that can be used for
various kinds of software development. It offers strong support for integration with other languages
and tools, comes with extensive standard libraries, and is easy to learn in a few days time. Python is
distributed under an OSI-approved open source license that makes it free to use.
You can download a complete python program along with detailed documentation from our website
at www.bkprecision.com. Also available under the download area is a high level library which will
make programming much easier as it does the low level bit manipulation for you. Instead of sending
a 26 byte string, you can send a high level command such as SetMaxCurrent(current)
Example script:
# Set DC load to remote mode.
import serial
length_packet = 26 # Number of bytes in a packet
def DumpCommand(bytes):
assert(len(bytes) == length_packet)
header = " "*3
print header,
for i in xrange(length_packet):
if i % 10 == 0 and i != 0:
print
print header,
if i % 5 == 0:
8500 DC Load Series Version: February 4, 2009 Page 46 of 76