MultiPyVu 2.2.0__tar.gz → 3.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {MultiPyVu-2.2.0/src/MultiPyVu.egg-info → multipyvu-3.1.0}/PKG-INFO +147 -89
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/README.md +141 -88
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/setup.py +3 -2
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/BRT.py +34 -34
- multipyvu-3.1.0/src/MultiPyVu/CommandChamber.py +428 -0
- multipyvu-3.1.0/src/MultiPyVu/CommandField.py +528 -0
- multipyvu-3.1.0/src/MultiPyVu/CommandMultiVu.py +221 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/CommandSdo.py +36 -41
- multipyvu-3.1.0/src/MultiPyVu/CommandTemperature.py +490 -0
- multipyvu-3.1.0/src/MultiPyVu/CommandWaitFor.py +513 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/Command_factory.py +82 -36
- multipyvu-3.1.0/src/MultiPyVu/ICommand.py +322 -0
- MultiPyVu-2.2.0/src/MultiPyVu/ServerEventManager.py → multipyvu-3.1.0/src/MultiPyVu/IEventManager.py +15 -12
- multipyvu-3.1.0/src/MultiPyVu/IServer.py +68 -0
- multipyvu-3.1.0/src/MultiPyVu/MultiVuClient.py +460 -0
- multipyvu-3.1.0/src/MultiPyVu/MultiVuClient_base.py +428 -0
- multipyvu-3.1.0/src/MultiPyVu/MultiVuServer.py +395 -0
- multipyvu-3.1.0/src/MultiPyVu/ParseInputs.py +282 -0
- multipyvu-3.1.0/src/MultiPyVu/SocketMessage.py +470 -0
- multipyvu-3.1.0/src/MultiPyVu/SocketMessageClient.py +293 -0
- multipyvu-3.1.0/src/MultiPyVu/SocketMessageServer.py +687 -0
- multipyvu-3.1.0/src/MultiPyVu/__init__.py +448 -0
- multipyvu-3.1.0/src/MultiPyVu/__main__.py +48 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/__version.py +1 -1
- multipyvu-3.1.0/src/MultiPyVu/check_windows_esc.py +19 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/exceptions.py +28 -24
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/generate_sdo_objects.py +3 -3
- multipyvu-3.1.0/src/MultiPyVu/gui/Controller.py +246 -0
- {MultiPyVu-2.2.0/src/MultiPyVu → multipyvu-3.1.0/src/MultiPyVu/gui}/IController.py +64 -10
- {MultiPyVu-2.2.0/src/MultiPyVu → multipyvu-3.1.0/src/MultiPyVu/gui}/IView.py +21 -3
- {MultiPyVu-2.2.0/src/MultiPyVu → multipyvu-3.1.0/src/MultiPyVu/gui}/ViewFactory.py +5 -2
- multipyvu-3.1.0/src/MultiPyVu/gui/ViewTk.py +532 -0
- multipyvu-3.1.0/src/MultiPyVu/gui/__init__.py +0 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/instrument.py +106 -166
- multipyvu-3.1.0/src/MultiPyVu/logging_config.py +67 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/project_vars.py +9 -1
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/sdo_object.py +4 -4
- {MultiPyVu-2.2.0 → multipyvu-3.1.0/src/MultiPyVu.egg-info}/PKG-INFO +147 -89
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu.egg-info/SOURCES.txt +14 -12
- multipyvu-3.1.0/src/MultiPyVu.egg-info/requires.txt +7 -0
- multipyvu-3.1.0/src/MultiPyVu.egg-info/top_level.txt +1 -0
- MultiPyVu-2.2.0/src/MultiPyVu/CommandChamber.py +0 -233
- MultiPyVu-2.2.0/src/MultiPyVu/CommandField.py +0 -344
- MultiPyVu-2.2.0/src/MultiPyVu/CommandMultiVu_base.py +0 -112
- MultiPyVu-2.2.0/src/MultiPyVu/CommandMultiVu_imp.py +0 -44
- MultiPyVu-2.2.0/src/MultiPyVu/CommandMultiVu_sim.py +0 -27
- MultiPyVu-2.2.0/src/MultiPyVu/CommandTemperature.py +0 -291
- MultiPyVu-2.2.0/src/MultiPyVu/Controller.py +0 -165
- MultiPyVu-2.2.0/src/MultiPyVu/ICommand.py +0 -68
- MultiPyVu-2.2.0/src/MultiPyVu/MultiVuClient.py +0 -565
- MultiPyVu-2.2.0/src/MultiPyVu/MultiVuClient_base.py +0 -413
- MultiPyVu-2.2.0/src/MultiPyVu/MultiVuServer.py +0 -541
- MultiPyVu-2.2.0/src/MultiPyVu/ParseInputs.py +0 -235
- MultiPyVu-2.2.0/src/MultiPyVu/SocketMessage.py +0 -442
- MultiPyVu-2.2.0/src/MultiPyVu/SocketMessageClient.py +0 -159
- MultiPyVu-2.2.0/src/MultiPyVu/SocketMessageServer.py +0 -194
- MultiPyVu-2.2.0/src/MultiPyVu/ViewTk.py +0 -397
- MultiPyVu-2.2.0/src/MultiPyVu/__init__.py +0 -1120
- MultiPyVu-2.2.0/src/MultiPyVu/__main__.py +0 -27
- MultiPyVu-2.2.0/src/MultiPyVu/create_logger.py +0 -139
- MultiPyVu-2.2.0/src/MultiPyVu.egg-info/top_level.txt +0 -2
- MultiPyVu-2.2.0/src/MultiVuDataFile/__init__.py +0 -37
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/LICENSE +0 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/pyproject.toml +0 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/setup.cfg +0 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/MultiVuDataFile/MultiVuDataFile.py +0 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/MultiVuDataFile/__init__.py +0 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/MultiVuDataFile/__version.py +0 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/MultiVuDataFile/is_pathname_valid.py +0 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/font/Play-Bold.ttf +0 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/font/Play-Regular.ttf +0 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/images/Q.png +0 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/images/QD_logo.jpg +0 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu/scripts/whats_my_ip_address.cmd +0 -0
- {MultiPyVu-2.2.0 → multipyvu-3.1.0}/src/MultiPyVu.egg-info/dependency_links.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: MultiPyVu
|
|
3
|
-
Version:
|
|
3
|
+
Version: 3.1.0
|
|
4
4
|
Summary: Control MultiVu using Python
|
|
5
5
|
Author-email: Damon D Jackson <djackson@qdusa.com>
|
|
6
6
|
Maintainer-email: "Quantum Design, Inc." <apps@qdusa.com>
|
|
@@ -38,6 +38,11 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
38
38
|
Requires-Python: >=3.8
|
|
39
39
|
Description-Content-Type: text/markdown
|
|
40
40
|
License-File: LICENSE
|
|
41
|
+
Requires-Dist: typing
|
|
42
|
+
Requires-Dist: pandas
|
|
43
|
+
Requires-Dist: pywin32>=300; platform_system == "Windows"
|
|
44
|
+
Requires-Dist: pillow
|
|
45
|
+
Requires-Dist: pyyaml
|
|
41
46
|
|
|
42
47
|

|
|
43
48
|
# MultiPyVu
|
|
@@ -49,13 +54,15 @@ License-File: LICENSE
|
|
|
49
54
|
* [Using Using MultiPyVu.Server() and MultiPyVu.Client()](#using)
|
|
50
55
|
* [Starting the Server Using the GUI](#gui)
|
|
51
56
|
* [Commands](#commands)
|
|
52
|
-
* [set_temperature() /
|
|
57
|
+
* [set_temperature() / get_temperature()](#temp)
|
|
53
58
|
* [set_field() / get_field()](#field)
|
|
54
59
|
* [set_chamber() / get_chamber()](#chamber)
|
|
55
60
|
* [wait_for()](#waitfor)
|
|
61
|
+
* [is_steady()](#is_steady)
|
|
56
62
|
* [get_aux_temperature()](#aux_therm)
|
|
57
63
|
* [resistivity option](#brt)
|
|
58
64
|
* [Saving & Opening a MultiVu Data File](#save)
|
|
65
|
+
* [Querying the Server Status](#server_status)
|
|
59
66
|
* [Testing the Server Using Scaffolding](#scaffolding)
|
|
60
67
|
* [Troubleshooting](#troubleshooting)
|
|
61
68
|
* [Changelog](#changelog)
|
|
@@ -65,7 +72,7 @@ License-File: LICENSE
|
|
|
65
72
|
### Introduction<a class="anchor" id="intro"></a>
|
|
66
73
|
MultiPyVu provides the ability to control the temperature, magnetic field, and chamber status of Quantum Design, Inc. products using python. This module includes MultiPyVu.Server, which runs on the same computer as MultiVu, MultiPyVu.Client, which is used to send commands to the cryostat, and MultiPyVu.DataFile, which is used to save data to a *.dat* file and read a *.dat* file into a Pandas DataFrame.
|
|
67
74
|
|
|
68
|
-
MultiPyVu.Client can run (1) locally on the same PC
|
|
75
|
+
MultiPyVu.Client can run (1) locally on the same PC which is running the MultiVu executable along with MultiVu.Server, or (2) remotely on another computer that has TCP access to the computer running MultiPyVu.Server.
|
|
69
76
|
|
|
70
77
|
The components of MultiPyVu enable access to the set and read the temperature, field, and chamber on the following QD platforms: PPMS, DynaCool, VersaLab, MPMS3, and OptiCool. MultiPyVu.Client can run on a PC, Mac, or Linux, including a RaspberryPi.
|
|
71
78
|
|
|
@@ -74,6 +81,8 @@ MultiPyVu uses the following modules:
|
|
|
74
81
|
- python version 3.8 or higher
|
|
75
82
|
- pywin32 - version 300 or higher.
|
|
76
83
|
- pandas - data read back from a *.dat* file is a Pandas Dataframe
|
|
84
|
+
- pillow - supports server gui
|
|
85
|
+
- pyyaml - supports logging
|
|
77
86
|
|
|
78
87
|
For the Python 3 distribution Quantum Design recommends [Anaconda](https://www.anaconda.com/products/individual) as it includes most modules needed for this server and other packages useful for scientific computing. This code was built and tested using Python 3.8. If you are not sure which version of Python you are using, from a command prompt type:
|
|
79
88
|
```
|
|
@@ -81,74 +90,83 @@ python --version
|
|
|
81
90
|
```
|
|
82
91
|
MultiPyVu can be installed using pip via the following command:
|
|
83
92
|
```
|
|
84
|
-
pip install
|
|
93
|
+
pip install --upgrade MultiPyVu
|
|
85
94
|
```
|
|
86
95
|
### Included Example Scripts<a class="anchor" id="examples"></a>
|
|
87
|
-
Several examples have been uploaded to [Quantum Design's Pharos database](https://www.qdusa.com/pharos/view.php?fDocumentId=
|
|
96
|
+
Several examples have been uploaded to [Quantum Design's Pharos database](https://www.qdusa.com/pharos/view.php?fDocumentId=4780). These examples demonstrate various capabilities of the module, and serve as templates upon which users can add their own code to integrate external hardware operations with the environmental controls of the Quantum Design instrument.
|
|
88
97
|
| Filename | Description|
|
|
89
98
|
-----|-----
|
|
90
99
|
example_local.py | A simple script which starts the server, then the client, on the PC running MultiVu. It relays instrument parameters and status to demonstrate communication, serving as a minimum working example useful for testing basic functionality.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
100
|
+
example_command_demos.py | Utilizes most functions of the module, setting temperature/field/chamber operations, reading back the values and status of those parameters, and waiting for stability conditions to be met. This also saves data to a MultiVu .dat file and plots the results. As-written, it runs in local mode.
|
|
101
|
+
example_experiment.py | Demonstrates an example experiment where a remote connection is used to measure the resistance of the 3 bridge channels while cycling temperature. The data is saved to a .dat file and then plotted with matplotlib.
|
|
102
|
+
Remote Connection\run_server.py | For remote operation; this script must be running on the on the control PC along with the MultiVu executable.
|
|
103
|
+
Remote Connection\example_remote_client.py | For remote operation; this script runs on a separate PC and relays instrument parameters and status to demonstration communication.
|
|
104
|
+
Remote Connection\example_MVDataFile_VISA.py | Simple example showing how to route environmental parameters and data from external instruments into a single MultiVu-readable *.dat* file. As-written, it runs in local mode.
|
|
105
|
+
Data Processing\example_save_open_dat.py | Script showing how to save and read a MultiVu *.dat* file into a Pandas DataFrame, then plot with matplotlib.
|
|
106
|
+
Measuring\example_stabilize.py | Measures the temperature while stabilizing at each temperature.
|
|
107
|
+
Measuring\example_sweep.py | Measures the temperature while sweeping the temperature.
|
|
108
|
+
Options\example_aux_therm.py | Gets the temperature of the auxilary thermometer from the OptiCool.
|
|
109
|
+
Options\example_resistivity_option.py | Demonstrates how to set up the BRT module bridges for resistivity measurements and how to save the data.
|
|
110
|
+
UsefulBatchFiles\whats_my_ip_address.cmd | This batch file script prints out the IP address for the computer, providing an easy way to get the server IP address needed for remote operation. Alternatively, the gui can be used to get the IP address by calling ```python -m MultiPyVu```.
|
|
111
|
+
UsefulBatchFiles\show_process_with_port.cmd | Shows that active processes are running and what port is being used. By default, this looks for processes running on port 5000. To query a different port number, append it to the command line arguments. ```$ show_processes_with_port.cmd 4567```
|
|
112
|
+
UsefulBatchFiles\RunServer.cmd | This runs the server GUI.
|
|
113
|
+
UsefulBatchFiles\kill_process.cmd | This ends the processes with the specified PID (which can be identified using show_process_with_port.cmd). Run using ```$ kill_process.cmd 13579```
|
|
97
114
|
|
|
98
115
|
### Getting Started<a class="anchor" id="getting-started"></a>
|
|
99
|
-
Once the MultiPyVu module has been installed, be sure that the MultiVu executable is running on the PC connected to the cryostat before starting the server. For testing purposes, you can use MultiVu in simulation mode on an office computer.
|
|
116
|
+
Once the MultiPyVu module has been installed, be sure that the MultiVu executable is running on the PC connected to the cryostat before starting the server. For testing purposes, you can use MultiVu in simulation mode on an office computer, or run mpv.Server with the -s flag which runs the python code in scaffolding that mimics MultiVu. This is especially helpful for developing a script on a computer that does not have MultiVu running (Mac, Linux, or any PC without MultiVu). When running MultiVu and MultiPyVu, be sure that they are running under the same permissions.
|
|
100
117
|
|
|
101
118
|
**Local Operation:**
|
|
102
|
-
It is suggested to run first run the '
|
|
119
|
+
It is suggested to run first run the 'example_local.py' script with no changes on the MultiVu PC connected to the instrument- this should verify that the underlying resources required by the module are all present and functioning properly. If this is successful, proceed to the 'example_command_demos.py' script for a brief demonstration of the commands used to set and monitor the sample space environmental parameters, as well as the wait command.
|
|
103
120
|
|
|
104
121
|
**Remote Operation:**
|
|
105
|
-
After confirming the local example scripts have executed correctly, remote operation can be attempted. First, on the MultiVu PC, open the server
|
|
106
|
-
```
|
|
107
|
-
python
|
|
122
|
+
After confirming the local example scripts have executed correctly, remote operation can be attempted. First, on the MultiVu PC, open the server by running Remote Connection\run_server.py
|
|
123
|
+
```cmd
|
|
124
|
+
$ python run_server.py
|
|
108
125
|
```
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
python -m MultiPyVu
|
|
126
|
+
Ths server can also be started using the gui by calling:
|
|
127
|
+
```cmd
|
|
128
|
+
$ python -m MultiPyVu
|
|
129
|
+
```
|
|
130
|
+
or, to start the gui using scaffolding to simulate MultiVu running you can specify the flavor of MultiVu as below:
|
|
131
|
+
```cmd
|
|
132
|
+
$ python -m MultiPyVu -s opticool
|
|
133
|
+
```
|
|
134
|
+
When the gui opens, it will show the IP address of the host computer, which must be included in the client script if it is running remotely. The IP address can also be obtained from the command line using:
|
|
135
|
+
```cmd
|
|
136
|
+
$ python -m MultiPyVu -get_ip
|
|
112
137
|
```
|
|
113
|
-
When the gui opens, it will show the IP address of the host computer, which should be included in the client script.
|
|
114
138
|
|
|
115
139
|
On the client PC, update the 'host' variable of the 'example_Remote-Client.py' script *with the same server PC IPV4 address* and run it. The script will report the present temperature and field value/status a few times to show the connection is functioning.
|
|
116
140
|
|
|
117
141
|
**Next Steps:**
|
|
118
|
-
It may sometimes be desirable to combine the sample environment parameters (temperature, field) with readings from a user's own instrumentation into a single *.dat* file which can be plotted in MultiVu. This functionality, accomplished using the MultiPyVu.DataFile module, is demonstrated using PyVISA to communicate with a VISA-compatible instrument in the '
|
|
142
|
+
It may sometimes be desirable to combine the sample environment parameters (temperature, field) with readings from a user's own instrumentation into a single *.dat* file which can be plotted in MultiVu. This functionality, accomplished using the MultiPyVu.DataFile module, is demonstrated using PyVISA to communicate with a VISA-compatible instrument in the 'example_MvDataFile_VISA.py' example. Note that for this routine to execute properly, the correct instrument bus/address and query string need to be updated in the script.
|
|
119
143
|
|
|
120
144
|
For further information on the detailed operation of the components of the module, see the following sections.
|
|
121
145
|
|
|
122
146
|
### Using MultiPyVu.Server() and MultiPyVu.Client()<a class="anchor" id="using"></a>
|
|
123
147
|
To start the server on localhost, open MultiVu, and then, using the example script _run_server.py_, go to a command prompt and type:
|
|
124
|
-
```
|
|
125
|
-
python
|
|
148
|
+
```cmd
|
|
149
|
+
$ python run_server.py
|
|
126
150
|
```
|
|
127
|
-
|
|
128
|
-
```
|
|
129
|
-
python
|
|
151
|
+
The server can also be started using a gui:
|
|
152
|
+
```cmd
|
|
153
|
+
$ python -m MultiPyVu
|
|
130
154
|
```
|
|
131
|
-
As mentioned above, if the client and the server are running on the same computer as MultiVu, then one can use
|
|
155
|
+
As mentioned above, if the client and the server are running on the same computer as MultiVu, then one can use example_local.py as a guide to set up the whole script in one file.
|
|
132
156
|
|
|
133
157
|
There are a list of useful flags to specify settings. These can be found by typing -h, which brings up help information:
|
|
134
|
-
```
|
|
135
|
-
python
|
|
158
|
+
```cmd
|
|
159
|
+
$ python -m MultiPyVu -h
|
|
136
160
|
```
|
|
137
161
|
|
|
138
|
-
One can specify the
|
|
139
|
-
```
|
|
140
|
-
python run_server.py opticool
|
|
162
|
+
One can specify the Quantum Design platform, but if MultiVu is running, specifying the platform should not be necessary. For example:
|
|
163
|
+
```cmd
|
|
164
|
+
$ python run_server.py opticool
|
|
141
165
|
```
|
|
142
166
|
|
|
143
|
-
If the
|
|
144
|
-
|
|
145
|
-
If one is using a command line, then to specify an IP address of 127.0.0.1, use the following command:
|
|
146
|
-
```python
|
|
147
|
-
python run_server.py -ip=127.0.0.1
|
|
148
|
-
```
|
|
149
|
-
One can also follow example_Remote_Server.py to insert the IP address directly in the script. If they are on the same computer, then the -ip flag can be omitted and server will use 'localhost.'
|
|
167
|
+
If the Server and Client are going to be running on two different computers, the Server's IP address must be specified when instantiating the Client.
|
|
150
168
|
|
|
151
|
-
|
|
169
|
+
Both the Server and the Client are context managers, which means to write a script which connects to the server from a client machine, put all of the commands to control the cryostat inside a with-block:
|
|
152
170
|
```python
|
|
153
171
|
import MultiPyVu as mpv
|
|
154
172
|
|
|
@@ -157,8 +175,6 @@ with mpv.Client('127.0.0.1') as client:
|
|
|
157
175
|
<do post-processing once the client has been closed>
|
|
158
176
|
```
|
|
159
177
|
|
|
160
|
-
Note that one can use either the command line arguments to specify the host and port, or these can be specified when instantiating the Server. If the host or parameter are specified in both cases, the command line arguments will be used.
|
|
161
|
-
|
|
162
178
|
If the host or port are not default values (localhost and 5000, respectively), then these parameters must be specified when instantiating MultiPyVu.Client().
|
|
163
179
|
|
|
164
180
|
Alternatively, one can start a connection to the server using:
|
|
@@ -169,17 +185,18 @@ client.open()
|
|
|
169
185
|
client.close_client()
|
|
170
186
|
<do post-processing once the client has been closed>
|
|
171
187
|
```
|
|
188
|
+
Using the above method could end up with the server hung up because errors need to be correctly accounted for. It is safer to use the Client as a context manager using a with-block.
|
|
172
189
|
|
|
173
|
-
|
|
190
|
+
If needed, one can turn off socket timeouts so that the client will wait indefinitely for a response from the server. To do this, set the time in seconds using the 'socket_timeout' keyword when instantiating the client, or set the time to *None* to turn off the timeout. By default, the timeout is set to one second.
|
|
174
191
|
```python
|
|
175
192
|
client = mpv.Client(socket_timeout=None)
|
|
176
193
|
```
|
|
177
194
|
|
|
178
|
-
The client can also
|
|
195
|
+
The client can also close the server directly using:
|
|
179
196
|
```python
|
|
180
197
|
client.close_server()
|
|
181
198
|
```
|
|
182
|
-
instead of client.close_client().
|
|
199
|
+
instead of client.close_client(). Note that once this is called, the server will need to be reopened. Also, this can not be accessed from within a with-block.
|
|
183
200
|
|
|
184
201
|
If the client and server are being run on the same computer, then one could also write one script to control them both.
|
|
185
202
|
```python
|
|
@@ -191,29 +208,22 @@ with mpv.Server() as server:
|
|
|
191
208
|
<do post-processing now that the client and server have been closed>
|
|
192
209
|
```
|
|
193
210
|
|
|
211
|
+
This is convenient as it does not require running two different scripts.
|
|
212
|
+
|
|
194
213
|
### Starting the Server Using the GUI<a class="anchor" id="gui"></a>
|
|
195
|
-
The Server can be run using a simple graphical user interface which helps to show information about its status.
|
|
196
|
-
```
|
|
197
|
-
conda install -c conda-forge pillow
|
|
198
|
-
```
|
|
199
|
-
or, using PyPi:
|
|
200
|
-
```
|
|
201
|
-
pip install pillow
|
|
202
|
-
```
|
|
214
|
+
The Server can be run using a simple graphical user interface which helps to show information about its status.
|
|
203
215
|
|
|
204
216
|
Start the gui from the command line using the -m flag when calling the module:
|
|
205
217
|
|
|
206
|
-
```
|
|
207
|
-
python -m MultiPyVu
|
|
218
|
+
```cmd
|
|
219
|
+
$ python -m MultiPyVu
|
|
208
220
|
```
|
|
209
|
-
or, to start the gui using scaffolding to simulate
|
|
210
|
-
```
|
|
211
|
-
python -m MultiPyVu -s opticool
|
|
221
|
+
or, to start the gui using scaffolding to simulate a flavor of MultiVu:
|
|
222
|
+
```cmd
|
|
223
|
+
$ python -m MultiPyVu -s opticool
|
|
212
224
|
```
|
|
213
225
|
|
|
214
|
-
This brings up a window with a button to start the server, quit, and a window to
|
|
215
|
-
|
|
216
|
-
Status information about the client is also displayed in the gui.
|
|
226
|
+
This brings up a window with a button to start the server, quit, and a window to view the IP address. Status information is also displayed in the gui.
|
|
217
227
|
|
|
218
228
|
### Commands<a class="anchor" id="commands"></a>
|
|
219
229
|
The commands to set and get the temperature, field, and chamber status are defined here:
|
|
@@ -224,8 +234,7 @@ client.set_temperature(set_point,
|
|
|
224
234
|
rate_K_per_min,
|
|
225
235
|
client.temperature.approach_mode.<enum_option>)
|
|
226
236
|
```
|
|
227
|
-
|
|
228
|
-
Note that the mode is set using the client.temperature.approach_mode enum, which has items *fast_settle* and *no_overshoot.* The temperature and status are read back using:
|
|
237
|
+
The <enum_options> mode is set using the client.temperature.approach_mode enum, which has items *fast_settle* and *no_overshoot.* The temperature and status are read back using:
|
|
229
238
|
```python
|
|
230
239
|
temperature, status = client.get_temperature()
|
|
231
240
|
```
|
|
@@ -236,14 +245,16 @@ client.set_field(set_point,
|
|
|
236
245
|
rate_oe_per_sec,
|
|
237
246
|
client.field.approach_mode.<enum_option>)
|
|
238
247
|
```
|
|
239
|
-
|
|
248
|
+
The <enum_option> approach mode is set using the client.field.approach_mode enum, which has items *linear,* *no_overshoot,* and *oscillate.* The VersaLab does not support *no_overshoot*. In addition, the PPMS magnet can be run *driven* or *persistent*, so it has a fourth input
|
|
240
249
|
which is specified using the client.field.driven_mode enum. For the PPMS flavor:
|
|
241
250
|
```python
|
|
242
251
|
client.set_field(set_point,
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
252
|
+
rate_oe_per_sec,
|
|
253
|
+
client.field.approach_mode.<enum_option>,
|
|
254
|
+
client.field.driven_mode.<enum_option>)
|
|
246
255
|
```
|
|
256
|
+
Specifying the driven_mode for other platforms will result in a MultiPyVuError.
|
|
257
|
+
|
|
247
258
|
The field and status are read back using:
|
|
248
259
|
```python
|
|
249
260
|
field, status = client.get_field()
|
|
@@ -253,37 +264,48 @@ field, status = client.get_field()
|
|
|
253
264
|
```python
|
|
254
265
|
client.set_chamber(client.chamber.mode.<enum_option>)
|
|
255
266
|
```
|
|
256
|
-
This is set using the client.chamber.mode enum, which has items *seal,* *purge_seal,* *vent_seal,* *pump_continuous,* *vent_continuous,* and *high_vacuum.*
|
|
267
|
+
This is set using the <enum_option> client.chamber.mode enum, which has items *seal,* *purge_seal,* *vent_seal,* *pump_continuous,* *vent_continuous,* and *high_vacuum.*
|
|
257
268
|
And read back using:
|
|
258
269
|
```python
|
|
259
|
-
|
|
270
|
+
chamber = client.get_chamber()
|
|
260
271
|
```
|
|
261
272
|
Note that this command is not used by the OptiCool.
|
|
262
273
|
|
|
263
274
|
**Wait For**<a class="anchor" id="waitfor"></a>
|
|
275
|
+
When a setting on a cryostat is configured, it will take time to reach the new set point. If desired, one can wait for the setting to become stable using the .wait_for(delay, timeout, bitmask) command. A delay will set the time in seconds after the setting is stable, which can be useful to make sure a sample has time to thermalize; timeout is the seconds until the command will give up; bitmask tells the system which settings need to be stable. This can be set using the client.subsystem enum, and multiple parameters are combined using bit-wise or. In the example below, the wait_for command will wait at least 90 seconds for the temperature, field, and chamber to stabilize, and will then immediately go on to the next command.
|
|
264
276
|
```python
|
|
265
|
-
client.wait_for(0, 90, client.temperature.waitfor | client.field.waitfor
|
|
277
|
+
client.wait_for(0, 90, client.temperature.waitfor | client.field.waitfor|
|
|
278
|
+
client.chamber.waitfor)
|
|
266
279
|
```
|
|
267
|
-
|
|
280
|
+
|
|
281
|
+
**Is Steady**<a class="anchor" id="is_steady"></a>
|
|
282
|
+
Similar to the .wait_for() command is a method to see if the cryostat has stabilized using .is_steady(bitmask). One useful example of this command is to set a temperature, then have a script collect data while .is_steady(bitmask) returns False. The bitmask is defined the same way as for the .wait_for() command.
|
|
283
|
+
```python
|
|
284
|
+
client.set_temperature(1.8,
|
|
285
|
+
5.0,
|
|
286
|
+
client.temperature.approach_mode.fast_settle)
|
|
287
|
+
while not client.is_steady(client.temperature.waitfor):
|
|
288
|
+
t, s = client.get_temperature()
|
|
289
|
+
```
|
|
268
290
|
|
|
269
291
|
**OptiCool Auxillary Thermometer**<a class="anchor" id="aux_therm"></a>
|
|
270
292
|
|
|
271
|
-
To read the OptiCool auxillary thermometer, use the following command. This will throw a MultiPyVuException
|
|
293
|
+
To read the OptiCool auxillary thermometer, use the following command. This will throw a MultiPyVuException for all other platforms.
|
|
272
294
|
```python
|
|
273
295
|
aux_temperature, status = client.get_aux_temperature()
|
|
274
296
|
```
|
|
275
297
|
|
|
276
298
|
**Resistivity Option**<a class="anchor" id="brt"></a>
|
|
277
299
|
|
|
278
|
-
MultiPyVu provides access to several commands used to collect electrical resistance data. The bridge channels must be configured for the resistivity option. This can be done in MultiVu, and then python can be used to simply collect data, or the bridges can be configured using python. Note that bridge configuration using python will not show up in MultiVu.
|
|
300
|
+
MultiPyVu provides access to several commands used to collect electrical resistance data if you have a BRT CAN module installed. The bridge channels must be configured for the resistivity option. This can be done in MultiVu with the resistivty option, and then python can be used to simply collect data, or the bridges can be configured using python. Note that bridge configuration using python will not show up in MultiVu. Implementation of the resistivity option is not implemented for the PPMS model 6000.
|
|
279
301
|
|
|
280
302
|
The command to configure each channel is client.resistivity.bridge_setup(bridge_number, channel_on, current_limit_uA, power_limit_uW, voltage_limit_mV). An example for how to configure the bridge is:
|
|
281
303
|
```python
|
|
282
304
|
client.resistivity.bridge_setup(bridge_number=1,
|
|
283
305
|
channel_on=True,
|
|
284
|
-
current_limit_uA=8000,
|
|
285
|
-
power_limit_uW=500,
|
|
286
|
-
voltage_limit_mV=1000)
|
|
306
|
+
current_limit_uA=8000.0,
|
|
307
|
+
power_limit_uW=500.0,
|
|
308
|
+
voltage_limit_mV=1000.0)
|
|
287
309
|
```
|
|
288
310
|
Note that when using this command, the module will take some time to properly configure itself, so we recommend adding a pause of about 5 seconds before collecting data.
|
|
289
311
|
|
|
@@ -337,10 +359,17 @@ data.create_file_and_write_header('my_graphing_file.dat', 'Using Python')
|
|
|
337
359
|
# collect some data
|
|
338
360
|
with mpv.Server() as server:
|
|
339
361
|
with mpv.Client() as client:
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
362
|
+
mode = client.temperature.approach_mode.fast_settle
|
|
363
|
+
client.set_temperature(273.15,
|
|
364
|
+
7.0,
|
|
365
|
+
mode)
|
|
366
|
+
|
|
367
|
+
mask = client.temperature.waitfor
|
|
368
|
+
while not client.is_steady(mask):
|
|
369
|
+
temperature, status = client.get_temperature()
|
|
370
|
+
data.set_value('T', temperature)
|
|
371
|
+
data.set_value('status', status)
|
|
372
|
+
data.write_data()
|
|
344
373
|
|
|
345
374
|
# read data from the file and plot it
|
|
346
375
|
my_dataframe = data.parse_MVu_data_file('my_graphing_file.dat')
|
|
@@ -353,14 +382,37 @@ ax.scatter(x='Time Stamp (sec)',
|
|
|
353
382
|
plt.show()
|
|
354
383
|
```
|
|
355
384
|
|
|
385
|
+
### Querying the Server Status<a class="anchor" id="server_status"></a>
|
|
386
|
+
The server status can be queried from the command line. First, we can see if the server is running using:
|
|
387
|
+
```cmd
|
|
388
|
+
$ python -m MultiPyVu -running
|
|
389
|
+
```
|
|
390
|
+
By default, this queries the server at IP address = localhost and port = 5000. To query a different address, use the *-ip=* or *-p=* flags.
|
|
391
|
+
|
|
392
|
+
Similarly, in order to get the server status at a specific ip address, use:
|
|
393
|
+
```cmd
|
|
394
|
+
$ python -m MultiPyVu -status -ip=127.0.0.1
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
From the command line, one can get the computer's IP address:
|
|
398
|
+
```cmd
|
|
399
|
+
$ python -m MultiPyVu -get_ip
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
Finally, the server can be closed from the command line using:
|
|
403
|
+
```cmd
|
|
404
|
+
$ python -m MultiPyVu -quit
|
|
405
|
+
```
|
|
406
|
+
where again, the IP address and port can be defined using the *-ip=* and *-p=* flags.
|
|
407
|
+
|
|
356
408
|
### Testing the Server Using Scaffolding<a class="anchor" id="scaffolding"></a>
|
|
357
409
|
For testing the a script, QD has supplied scaffolding for the MultiVu commands to simulate their interactions with the server. This can be helpful for writing scripts on a computer which is not running MultiVu. To use this, start the server in scaffolding mode by using the -s flag. The scaffolding does not need MultiVu running, so it is also necessary to specify the platform. For example, to use scaffolding to test a script on a local computer which will be used with Dynacool:
|
|
358
|
-
```
|
|
359
|
-
python -m MultiPyVu -s dynacool
|
|
410
|
+
```cmd
|
|
411
|
+
$ python -m MultiPyVu -s dynacool
|
|
360
412
|
```
|
|
361
413
|
or, using only a command line interface:
|
|
362
|
-
```
|
|
363
|
-
python run_mv_server.py -s Dynacool
|
|
414
|
+
```cmd
|
|
415
|
+
$ python run_mv_server.py -s Dynacool
|
|
364
416
|
```
|
|
365
417
|
One could also run in scaffolding mode with one script using the following:
|
|
366
418
|
```python
|
|
@@ -374,20 +426,26 @@ with mpv.Server(flags=['-s', 'DYNACOOL']) as server:
|
|
|
374
426
|
|
|
375
427
|
### Troubleshooting<a class="anchor" id="troubleshooting"></a>
|
|
376
428
|
Typical connection issues are due to:
|
|
377
|
-
- Firewall. You might need to allow connections on port 5000 (the default port number) in your firewall. Windows Firewall may cause issues depending upon your network settings. If the server is open and a
|
|
429
|
+
- Firewall. You might need to allow connections on port 5000 (the default port number) in your firewall. Windows Firewall may cause issues depending upon your network settings. If the server is open and a connection fails disabling Firewalls temporarily may be your best option to troubleshoot. If your computers are on the same domain disabling the Domain Firewall may be sufficient.
|
|
378
430
|
- Port conflict. If port 5000 is in use, a different number can be specified when instantiating MultiPyVu.Server() and MultiPyVu.Client().
|
|
379
431
|
```python
|
|
380
432
|
server = mpv.Server(port=6000)
|
|
381
433
|
client = mpv.Client(port=6000)
|
|
382
434
|
```
|
|
435
|
+
- Ensure that MultiVu and Python are installed and run at the same permissions level. If Python was installed as administrator it may have issues if MultiVu is not run as administrator.
|
|
383
436
|
- A log file named QdMultiVu.log shows the traffic between the server and client which can also be useful during troubleshooting.
|
|
384
437
|
|
|
385
438
|
## Changelog<a class="anchor" id="changelog"></a>
|
|
386
|
-
**
|
|
387
|
-
-
|
|
439
|
+
**3.1.0**
|
|
440
|
+
- October 2024
|
|
441
|
+
- Log the version number when the Client connects to the Server.
|
|
442
|
+
- Check that the Server and Client are running the same version.
|
|
443
|
+
- Increase the number of backup logs to 5.
|
|
444
|
+
- Bugfix to allow Client to run on Linux or Mac systems.
|
|
388
445
|
- Corrected a bug that prevented the Server from recognizing PPMS and MPMS3 MultiVu flavors
|
|
389
|
-
-
|
|
390
|
-
-
|
|
446
|
+
- Limit server to hosting only one client at a time.
|
|
447
|
+
- Add the ability to call -quit, -is_running, -status, -get_ip from the command line using python -m MultiPyVu
|
|
448
|
+
- Miscellaneous bug fixes and refactoring.
|
|
391
449
|
|
|
392
450
|
**2.1.4**
|
|
393
451
|
- October 2023
|