Instruction manual

Using the COM Server
Using the COM server will only work on Windows computers. You'll need to install python, pyserial,
and pywin32; please refer to the appendices for instructions.
Here's a summary of the things we'll do in this section:
1. Connect a power supply to the computer.
2. Register the COM server.
3. Run a python script to access the power supply via the COM server.
4. Use Visual Basic to access the power supply via the COM server
Connect the DC load
Connect a power supply using either a serial port on your computer or the USB to serial device. If
you use the USB to serial device (IT-E132), you'll need to install the PL-2302 driver on the CD that
came with the IT-E132 device.
Make sure the power supply is powered on.
Register the COM server
Registering the COM server means telling Windows about the server. This only needs to be done
once and it will be remembered across power cycles. One condition, however, is that the
ps178x.py file must not be moved or deleted; otherwise, the functionality will not be accessible
through COM.
The easiest way to register the COM server is to open an Explorer window, navigate to the directory
containing the python files in this software package, then double-click on the ps178x.py file. A DOS
window will open momentarily, then disappear, probably too fast for you to see what happened.
If instead you wish to see what happens during registration, open a DOS window and go to the
directory that has the python file ps178x.py that came with this software package.
Execute the command python ps178x.py. You should see the message
Registered: BKServers.px178x
This means the COM server has been registered with the operating system. Now an application can
request a connection to a COM server named BKServers.px178x and the operating system will
start the ps178x.py script when such a connection is requested.
If you wish to unregister the COM server, execute the command
python ps178x.py --unregister.
You'd unregister, for example, if you wanted to move the ps178x.py script somewhere else, then re-
register it.
Use python to access the COM server
In a DOS window, go to the directory that has the python file test.py that came with this software
package. Run the command python test.py com p br. Here, p is the COM (RS-232
communications) port the DC load is connected to and br is the baudrate. You should see output
similar to the following (of course, your numbers will differ):
Time from Power Supply = Fri Dec 19 12:01:32 2008
Set to remote control
Set max voltage
B&K 1785, 1786B, 1787B, 1788 Python Library 15 January 2009 Page 9 of 14