You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the most important contributions you can make is to add support for new instruments. The architecture was designed to make this process straightforward by following a set of well-defined steps. Essentially, these are the same steps the original developers followed when adding new modules.
90
+
91
+
#### Understanding the Architecture
92
+
Code duplication is considered acceptable to avoid over-abstraction, which can make the project harder to maintain.
93
+
94
+
#### Start with a Template
95
+
96
+
The easiest way to start is to copy an existing module that is closest to your task or has the functionality you need.
97
+
98
+
#### 1. Create New Files
99
+
100
+
1. Create a new directory for your instrument under the appropriate vendor (e.g., `pica/new_vendor/my_instrument/`).
101
+
2. Paste the copied files into this new directory.
102
+
3. Rename the files to reflect your new module (e.g., `IV_ABC_Instrument_GUI.py` and `IV_ABC_Instrument_Control.py`).
103
+
104
+
#### 2. Implement the Instrument Control Logic
105
+
106
+
Start with the basic instrument communication, then add measurement protocols, data saving, and plotting. Ensure that instrument communication (handled by `PyVISA` or `pymeasure`) uses the correct SCPI commands. Your instrument's programming manual is the definitive source for these commands.
107
+
108
+
1. Open your new `...Instrument_Control.py` file.
109
+
2.**Consult your instrument's programming manual.** This is essential for finding the correct SCPI commands.
110
+
3. Modify the `PyVISA` sections of the script. Replace the existing SCPI commands (e.g., `*IDN?`, `:SOUR:VOLT`, `:MEAS:CURR?`) with the commands specific to your instrument.
111
+
4. Adjust the data parsing logic to handle the output format of your instrument.
112
+
113
+
#### 3. Modify the GUI (`..._GUI.py`)
114
+
115
+
1. Open your new `..._GUI.py` file.
116
+
2. Update the `Tkinter` widgets (labels, entry boxes, dropdowns) to match the parameters required for your instrument (e.g., voltage range, compliance, measurement speed).
117
+
3. Ensure the "Start" button calls your new control logic script, passing the necessary parameters from the GUI.
118
+
119
+
#### 4. Integrate into the PICA Launcher
120
+
121
+
To make your new module accessible from the main dashboard:
122
+
123
+
1. Open `pica/main.py`.
124
+
2. Find the section where the instrument buttons are created (search for a `tk.Button` that launches an existing module).
125
+
3. Add a new `tk.Button` for your module. The button's `command` should be a function that launches your new `..._GUI.py` script. You can model this on the existing launcher functions.
126
+
127
+
#### 5. Test and Document
128
+
129
+
- Run your new module standalone and from the PICA launcher to ensure it works as expected. Test edge cases. It's often helpful to have a new user try it, as they can often find bugs you might have missed.
130
+
- Consider adding a section for your new instrument in `docs/User_Manual.md` and adding a screenshot to `pica/assets/Images/screenshots/`.
131
+
87
132
## Support
88
133
89
134
For any questions, support, or assistance, please open a GitHub Issue in the main repository. This is the preferred and primary method for getting in touch with the development team and community for support.
0 commit comments