B&K Precision 1785B Instruction Manual

Browse online or download Instruction Manual for Power supply units B&K Precision 1785B. B&K Precision 1785B Instruction manual User Manual

  • Download
  • Add to my manuals
  • Print
  • Page
    / 14
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 0
B&K Precision 1785B, 1786B, 1787B, 1788 Power supply
Python Library
Table of Contents
Introduction 2
Prerequisites 2
Why a Library is Useful 3
Using the Library from Python 6
Conventions 6
Return values 6
Example 6
TimeNow() 7
TurnPSOn() 7
TurnPSOff() 7
Remote or local control 7
SetRemoteControl()
SetLocalControl()
Maximum 7
SetMaxVoltage(voltage)
Output 7
SetOutVoltage(voltage)
SetOutCurrent(voltage)
SetCommunicationAddress(address=0)
Reading 7
GetReading()
EnableLocalControl() 8
DisableLocalControl() 8
GetProductInformation() 8
Using the COM Server 9
Connect the DC load 9
Register the COM server 9
Use python to access the COM server 9
Use Visual Basic to access the COM server 10
Troubleshooting 11
All my commands are failing 11
Serial interface seems to be locked up 11
Python References 12
Appendices 13
Appendix 1: Getting and Installing Python 13
Appendix 2: Getting and Installing pyserial 13
Appendix 3: Getting and Installing pywin32 13
B&K 1785, 1786B, 1787B, 1788 Python Library 15 January 2009 Page 1 of 14
Page view 0
1 2 3 4 5 6 ... 13 14

Summary of Contents

Page 1 - Table of Contents

B&K Precision 1785B, 1786B, 1787B, 1788 Power supply Python LibraryTable of ContentsIntroduction 2Prerequisites 2Why a Library is Useful 3Using th

Page 2 - Introduction

Set output voltageSet output current Input values: Current output current: 0.0 A Current output voltage: 0.02 V Power supply state:

Page 3 - Why a Library is Useful

TroubleshootingAll my commands are failingIf you get the message Command cannot be carried out (i.e., the 0xB0 status byte), it's possible that y

Page 4

Python ReferencesIf you're an experienced programmer, you can learn python by reading the tutorial that comes with python (it's in the Doc d

Page 5

AppendicesIntroduction:For convenience, included in the “python.zip” file that can be downloaded from www.bkprecision.com are Python 2.5.2, pyserial 2

Page 6 - Using the Library from Python

If you see no error message after the import serial line, your pyserial installation was successful. Press ctrl-z and return to exit the python inter

Page 7

IntroductionWe provide a python library, ps178x.py, that can provide programming access to B&K Precision's power supply 1785-1788 series. Th

Page 8 - EnableLocalControl()

Why a Library is UsefulThe native programming interface to the power supplies is fairly low-level. It involves sending 26 byte commands and receiving

Page 9 - Using the COM Server

checksum += ord(cmd[i]) checksum %= 256 return checksumdef main(): port = 3 # COM4 for my computer baudrate = 38400 sp = seria

Page 10

The first byte of a command is always 0xaa and the second byte is the address of the power supply. The address should be set to 0. The third byte ide

Page 11 - Troubleshooting

Using the Library from PythonThe pyserial library abstracts the serial port. Thus, you may be able to use the ps178x.py module for python programming

Page 12 - Python References

Output Mode: Off Over heat protection: Normal Output State: OFF Output current set to: 5.0 Maximum output voltage: 5.0

Page 13 - Appendices

ReadingGetReading()Gets the reading for the current displayed output current and output voltage, the state of the power supply ( output state, over he

Page 14

Using the COM ServerUsing the COM server will only work on Windows computers. You'll need to install python, pyserial, and pywin32; please refer

Comments to this Manuals

No comments