Drivers: Difference between revisions

From SweepMe! Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
Several Modules can load Devices and they are represented by Device Classes which are small python based code snippets allowing you to include and use any equipment with SweepMe!. It basically is a file called '''main.py''' written in the programming language python 3.6 (https://www.python.org/). All Device Classes can be found in the folder Devices of the SweepMe! installation.  
Several Modules can load Devices and they are represented by Device Classes which are small code snippets allowing you to include and use any equipment with SweepMe!. It basically is a python file called '''main.py''' written in the programming language python 3.6 (32bit) (https://www.python.org/).  


== Download ==
== Download ==
Line 7: Line 7:


=== Direct download ===
=== Direct download ===
Click the link "Devices" on our webpage and you will come to a list of all available Devices. You can download the Device directly as a zip-folder and you only need to unzip the Device Class into your local "Devices" folder of your SweepMe! installation.
Direct download is possible via an account and appropriate rights. Please contact us if you need an account.


== Upload ==
== Upload ==
Line 19: Line 19:
'''pre-installed''': These Device Classes come with your installation of SweepMe! You can find them in the folder 'Devices' of your SweepMe! installation, e.g "C:\SweepMe!\SweepMe!_1.5.4\Devices" if you use the suggested installation path
'''pre-installed''': These Device Classes come with your installation of SweepMe! You can find them in the folder 'Devices' of your SweepMe! installation, e.g "C:\SweepMe!\SweepMe!_1.5.4\Devices" if you use the suggested installation path


'''installed''': These Device Classes are obtained using the VersionManager ("Modules&Devices"). Every Device Class you download is versionized and will be copied to "C:\ProgramData\SweepMe!\Devices". These folders are read-only. Do not modify them. You can delete these versions using the VersionManager of SweepMe! Please also do not add any Device Class yourself, except you know why.
'''installed''': These Device Classes are obtained using the [[version manager] (menu "Modules&Devices"). Every Device Class you download is versionized and will be copied to "C:\ProgramData\SweepMe!\Devices". These folders are read-only. Please, do not modify them to keep the file integrity. You can delete these versions using the version manager of SweepMe! Please also do not add any Device Class yourself, except you know why. You can make a copy of these files if you like to test modifications as described below.


'''custom''': These Device Classes are placed in the public folder of SweepMe! called "CustomDevices". You can find this folder via the folder link on your desktop that was created during the installation or via the Menu of SweepMe! 'File' -> 'Open Folder' -> 'Public'. We recommend to use this folder to create you own Device Classes as this folder will not be changed if you install a newer version of SweepMe! so that you can still access your Device Class with any further SweepMe! version
'''custom''': These Device Classes are placed in the public folder of SweepMe! called "CustomDevices". You can find this folder via the folder link on your desktop that was created during the installation or via the Menu of SweepMe! 'File' -> 'Open Folder' -> 'Public'. We recommend to use this folder to create your own Device Classes as this folder will not be changed if you install a newer version of SweepMe! so that you can still access your Device Class with any further SweepMe! version.
 
These different kinds of Device Classes are shown in the VersionManager of SweepMe! having the label '''pre-installed''', '''installed''', or '''custom'''.


These different kinds of Device Classes are shown in the version manager of SweepMe! having the label '''pre-installed''', '''installed''', or '''custom'''.


== Structure ==
== Structure ==

Revision as of 15:55, 11 June 2020

Several Modules can load Devices and they are represented by Device Classes which are small code snippets allowing you to include and use any equipment with SweepMe!. It basically is a python file called main.py written in the programming language python 3.6 (32bit) (https://www.python.org/).

Download

Version manager

You can download or update Devices via the Version Manager which is part of the SweepMe! installation. (>= v.1.5.4 needed)

Direct download

Direct download is possible via an account and appropriate rights. Please contact us if you need an account.

Upload

To make SweepMe! a powerful tool, we are relying on you! Help us to build up a large library of Devices. Implement your own Device Classes and upload your files to our webpage. Contact us and request an account. Using the dashboard, you can upload, manage, and share your Devices with other users.

Places and folders

SweepMe! can load Device Classes from different places:

pre-installed: These Device Classes come with your installation of SweepMe! You can find them in the folder 'Devices' of your SweepMe! installation, e.g "C:\SweepMe!\SweepMe!_1.5.4\Devices" if you use the suggested installation path

installed: These Device Classes are obtained using the [[version manager] (menu "Modules&Devices"). Every Device Class you download is versionized and will be copied to "C:\ProgramData\SweepMe!\Devices". These folders are read-only. Please, do not modify them to keep the file integrity. You can delete these versions using the version manager of SweepMe! Please also do not add any Device Class yourself, except you know why. You can make a copy of these files if you like to test modifications as described below.

custom: These Device Classes are placed in the public folder of SweepMe! called "CustomDevices". You can find this folder via the folder link on your desktop that was created during the installation or via the Menu of SweepMe! 'File' -> 'Open Folder' -> 'Public'. We recommend to use this folder to create your own Device Classes as this folder will not be changed if you install a newer version of SweepMe! so that you can still access your Device Class with any further SweepMe! version.

These different kinds of Device Classes are shown in the version manager of SweepMe! having the label pre-installed, installed, or custom.

Structure

SweepMe! searches for new Device Classes in the folders described above. Each Device Class has to have a name of the following structure:

<Type of the Module>-<Name of the manufacturer>_<Name of the device model>

Examples:

  • SMU-Keithley_2400
  • LCRmeter-HP_4284A
  • Logger-PC_Mouse

The <Type of the Module> must be related to the Modules provided by SweepMe! and every Module provides different functionality to control a certain type of equipment.

The Device Class itself is a file which always has the name "main.py" and which can load further python modules, [dll]s, or simply text files as needed to get your Device Class working.

The Device Class Structure provides various standard functions which can be used at certain points during the run of the measurement sequence.


Creating new Device Classes

You can implement Device Classes on your own into SweepMe!. How to program a Device Class is described here: Device Class Programming

Create a copy of an existing one

  • Open SweepMe!'s version manager using the menu 'Modules & Devices'
  • Navigate to the Device you like to copy and choose a version
  • Right-click the version and choose "Copy to public folder 'CustomDevices'"
  • Right-click on the new version and select "Open in folder" or "Open in editor" to find or modify

Create a new one using the version manager

  • Open SweepMe!'s version manager using the menu 'Modules & Devices'.
  • Navigate to the Device you like to copy and choose a version.
  • Right-click the version and choose "Copy to public folder 'CustomDevices'".
  • Open the public folder "CustomDevices" (e.g. using the main menu via File -> Open folder -> Devices -> public).
  • Rename the folder regarding module name, manufacturer and model.
  • Delete the info.ini file if the new Device Class was not automatically removed.
  • Restart SweepMe! to reload all Device Classes.

Manually create one

  • Open the public folder "CustomDevices" (e.g. using the main menu via File -> Open folder -> Devices -> public).
  • Create a folder with module name, manufacturer and model as defined above
  • Add a main.py
  • Insert the minimal working example as given in Device class programming

Open/Modify

You can open any Device Class out of SweepMe! in an included notepad++ editor. Any change to the Device Class will automatically affect its operation after saving the file. If you like to try some modifications, we recommend to create a copy of the respective Device Class folder and rename it by keeping the same folder name structure as given above.