Set PS

This program was initially written for HP 6032A. I wrote it to be used at work but as I wrote it at home where I don't have a HP supply I used my PS 5010 instead and then

added the HP commands. A few minor changes in appearance had to be made and as a result this program now can control both and as of v1.2 also PS5004.

The program can control both positive and negative supplies of the PS5010 but not the +5 V supply other than turning output on and off.

The Tek PS 50xx  must be is in the high power (rightmost) compartment of a TM 5006 if max current is to be used. The program will always assume high power.

The program will automatically find any supported PS on the bus as long as its address is higher than 0. The search order is PS5010, PS5004 and HP6032A.

If more than one of the first found supported type is connected the one with lowest address will be selected.


Oct  1, 2021  - New version 1.5.1


Changes from 1.5.0 to 1.5.1:



 The default current setting for the negative supply of PS5010 was wrong, 0 instead of 0.40.

 Options changes weren't saved on exit if PS has been turned of .



 Loading Settings button and menu item and also menu item Start with Saved are now disabled if no saved data is is available.

  This will mean that settings saved with a previous program version cannot be loaded manually until settings has been saved again or a registry entry of "Saved Exist = True" has

  been added to   HKEY_CURRENT_USER\SOFTWARE\VB and VBA Program Settings\Set PS\xxx   where xxx is the PS type. Starting with saved settings will work if it was

  enabled by the prevous version


Changes from 1.4.1 to 1.5.0:



 Current Limit text box accepted muliple decimal separators (comma or point). 



 Due to the different look of windows in Win10 the layout was changed i.e. control buttons on top right were removed and a menu bar was added.

 Menu options are: Start with  Saved settings,  Save Settings at Exit, Turn off Output at Start and Exit, Turn Off Output before changes are applied and Confirm Output ON/OFF.

 Other Menu items are Initialize PS (Tek only), Save settings  (also as button on main window) and Load saved settings (also as button on main window).

 About Window with Program and device info.



  No query at exit.

 All user selectable options checkboxes removed and are now included in the Settings menu instead. 

 All user selectable options are saved on Exit if changes were made.

 Right click on New Settings free space for menu removed.  

 Registry settings changed so each supported PS now has its own folder with a complete set of settings as opposed to shared like before.

   This off course means that settings generated by an earlier version will not work.


Screen shot of the new Win10 look:




Changes from 1.4 to 1.4.1:



   A stop command which was left in the code by mistake caused the program to quit if any of the labels Voltage, Current Limit or Output was clicked.

   Project version number, shown in the exe-file properties, had not been updated since 1.3.


Changes from 1.3.2 to 1.4:



   If an invalid current setting, i.e. too high if the PS is not in a high power compartment, both voltage and current settings were ignored.



   Voltage and current text boxes now changes a single decimal point or comma to 0. (=zero plus decimal point). 

   Voltage and current text boxes now can be cleared by double click.

   Ignore Saved Settings option and the initial query removed and a button to load saved settings was added instead and a query to save settings (if any change was made) was added when the program is ended.

   Changed Output ON/OFF indicator to be red when Output is OFF rather than invisible.


Changes from 1.3.1 to 1.3.2:



   A mistake in v1.3.1 disabled the Toggle Output with Space bar function.

   Two option boxes had the same keyboard Alt shortcut


Changes from 1.3 to 1.3.1:



   Both Voltage and Current textboxes accepted multiple commas or periods. Now only one.

   Refresh only loaded settings from the selected output (+ or -) on PS5010. Now it loads all settings.
   Tab stop order was wrong.



   Option added to select if output should be turned off or not at start & exit of program. Previous versions always turned off.
   Ignore Saved settings now also doesn't save settings at exit. Previous versions always saved the current settings.  

   Some internal code changed.



   Right Click on a free space inside the New Settings frame opens a menu to Initialize the PS (Tek only)


Changes from 1.2.2 to 1.3:



   Current Limit textbox accepted space if in focus rather toggle output.

   Both textboxes accepted invalid characters e.g.letters and symbols, now only numbers, comma and period.

   If the mainframe was switched off before ending the program an Error occured when the program was closed because the it couldn't read the actual values.

     Now if the PS is off the last settings done by program are saved i.e. in case a manual setting has been done it will not be saved unless a Refresh was done before shutdown.



   Changed the way settings are loaded at start and saved at exit, now only the settings for the particular PS are loaded/saved where settings for all PS's were loaded/saved before.

   The way invalid settings error trapping worked changed.

   Default settings i.e. setting at the very first time the program is run removed i.e. no change to the PS setting is done.



   Option to ignore loading saved settings at start up added.


Changes from 1.2 to 1.2.2:



   Didn't indicate correct output status when Apply was clicked if output had been changed manually.



   Got rid of the ini-file and saved settings in Registry instead.


Changes from 1.1 to 1.2:



  A lot of code rewritten.



  Support for Tek PS5004 added.

  The ini-file increased to contain the actual settings when the program was last terminated which are now restored when the program is started again.

  A short delay introduced to ensure that the output has been turned off before the voltage/current settings are changed when this option is enabled.


Changes from 1.0 to 1.1:



  The ini-file saves at exit rather than manual edit.

  Some error handling changed.



   Output ON/OFF can now be toggled with space bar.

   A green dot now indicates when output is on.


Version 1.0

  Initial version.



Here's a screen shot.



The values for the checkboxes can be changed by editing the values in the ini-file located in the same folder as the exe-file.

This applies to v1.0 only, later versions save the ini-file on exit and from v1.22 the settings are saved in the registry.


Refresh inputs all the actual settings of the PS to the program. On PS5010 now from both outputs (v1.31).

Apply sets the PS to the settings of the program. (Same as hitting PC keyboard ENTER) On PS5010 only for the currently selected output.

Turn OFF Output before applying changes option: If ticked turns off the output before sending setting changes to the PS (New in v1.3).

Ignore Save settings option:   If ticked the program will start with the actual settings of the PS as opposed to starting with the saved settings which also are sent to the PS.

                                                New in v1.31 is that if ticked settings will also not be saved at exit and a dialog box will pop up at start asking if you want to override this option

                                                and load the save settings.

                                                This option was removed in v1.4 and replaced by the Load last Saved Settings button. On exit a query to save the current settings will appear

                                                and the program now always starts with the actual settings of the PS.

Turn OFF Output at Start & Exit option: If ticked the output will be turned off at Start and Exit of the program. (New in v1.31)

Confirm Output change option: If ticked a dialog box asking for confirmation to change the output status will appear when Turn ON/OFF Output is clicked.

Turn ON/OFF Output toggles the Output status.


Hidden features: Output status can be toggled by hitting the Space bar on the PC keyboard (New in v1.1).

                             The PS could be Initialized by Right clicking on a free space inside the New Settings frame (New in v1.31 and only for Tek PS)


You must have a NI GPIB card with the proper drivers installed.  Find  and download National Instruments GPIB card drivers here.

It is expected to work on any PC/win OS (not 3.1) with a  correctly installed and working NI card.


Be sure to uninstall any previous version before installing this one or extract the *.exe file from the *.CAB file and replace your current file.


Download Set PS here


Email me with comments  /Håkan

Home  /  Go back