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
Copy file name to clipboardExpand all lines: README.md
+10-7Lines changed: 10 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,7 +118,7 @@ To install/upgrade pip, run command:
118
118
| macOS |`python3 -m pip install --upgrade pip`|
119
119
120
120
##### Installing spikesafe-python Package
121
-
The [spikesafe-python](https://pypi.org/project/spikesafe-python/) library will need to be installed. Vektrex recommends always having the latest version of spikesafe-python when running these sequences; the current version is 1.5.15.
121
+
The [spikesafe-python](https://pypi.org/project/spikesafe-python/) library will need to be installed. Vektrex recommends always having the latest version of spikesafe-python when running these sequences; the current version is 1.5.17.
122
122
123
123
To install this package, run command:
124
124
| OS | Command |
@@ -165,17 +165,17 @@ A list of all installed packages can be displayed.
165
165
To view all installed packages, run command:
166
166
| OS | Command |
167
167
| - | - |
168
-
| Windows |`pip freeze`|
169
-
| macOS |`pip3 freeze`|
168
+
| Windows |`py -m pip freeze`|
169
+
| macOS |`python3 -m pip freeze`|
170
170
171
171
##### How to View Details of an Installed Package
172
172
After a package is installed the details of a package can be displayed.
173
173
174
174
To view details of a package, run command:
175
175
| OS | Command |
176
176
| - | - |
177
-
| Windows |`pip show <package name>`|
178
-
| macOS |`pip3 show <package name>`|
177
+
| Windows |`py -m pip show <package name>`|
178
+
| macOS |`python3 -m pip <package name>`|
179
179
180
180
### General Usage
181
181
For most examples, you may need to modify the specified IP address within a sequence to match the IP address that is physically set on your SpikeSafe's DIP switch. In each sequence, the default IP address of 10.0.0.220 is set in the line `ip_address = '10.0.0.220'`.
@@ -205,12 +205,15 @@ We use [SemVer](http://semver.org/) for versioning. For the versions available,
205
205
206
206
## FAQ
207
207
208
-
I'm developing an application using NI-VISA, what is the recommended practice for handling termination characters?<br />
208
+
I'm developing an application using NI-VISA, what is the recommended practice for handling termination characters?
209
209
See [Termination Characters in NI-VISA](https://www.ni.com/en-us/support/documentation/supplemental/06/termination-characters-in-ni-visa.html)
210
210
211
-
I'm developing an application using MATLAB, how do I get started?<br />
211
+
I'm developing an application using MATLAB, how do I get started?
212
212
See [System Requirements for MATLAB Engine API for Python](https://www.mathworks.com/help/matlab/matlab_external/system-requirements-for-matlab-engine-for-python.html) to ensure your system can support Python. Then see [Call Python from MATLAB](https://www.mathworks.com/help/matlab/call-python-libraries.html) on how to access Python libraries in MATLAB.
213
213
214
+
Why does my script's performance vary between different operating systems and machines?
215
+
See [Remarks](/spikesafe_python_lib_docs/Threading/wait/README.md#remarks) describing resolution of system timers between operating systems.
216
+
214
217
## Support/Feedback
215
218
216
219
If any further assistance is needed beyond the information provided within this repository, email [email protected].
Copy file name to clipboardExpand all lines: getting_started/README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,8 @@ For first-time users, Vektrex recommends running the sequences in the order show
11
11
1.[Read *IDN?](read_idn) - Uses the SCPI Standard "*IDN?" query and following information queries to obtain the model of your SpikeSafe
12
12
1.[Read All Events](read_all_events) - Reads all events from the SpikeSafe event queue
13
13
1.[Read Memory Table Data](read_memory_table_data) - Reads the SpikeSafe status and obtains current operational information from the SpikeSafe
14
-
1.[SCPI Logging](scpi_logging) - Shows how to log SpikeSafe SCPI messages sent over the TCP socket to a file.
14
+
1.[Discharge Channel](discharge_channel) - Shows how to properly shut down the SpikeSafe channel and wait for the load voltage to discharge before taking further action
15
+
1.[SCPI Logging](scpi_logging) - Shows how to log SpikeSafe SCPI messages sent over the TCP socket to a file
15
16
16
17
## Usage
17
18
To run these sequences, an IDE such as [Visual Studio Code](https://code.visualstudio.com/) is required. The [spikesafe-python](https://pypi.org/project/spikesafe-python/) repository will need to be installed as a package using the command `python -m pip install spikesafe-python`. Vektrex recommends always having the latest version of spikesafe-python when running these sequences; the current version is 1.1.0. It may help to run these sequences in a [virtual environment](https://docs.python.org/3/tutorial/venv.html).
# Examples for Discharging a SpikeSafe PRF or PSMU Channel
2
+
3
+
## **Purpose**
4
+
Demonstrate how to use a SpikeSafe PRF or PSMU to deliver high precision DC current to an LED or Laser load to increase its forward voltage for testing, once testing is complete turn off the current supply, and then wait to properly discharge the load voltage before taking any further action such as delivering current again to the load or removing it.
5
+
6
+
Vektrex recommends using the SpikeSafe Get Discharge Complete query to properly discharge the load voltage. This is available starting with SpikeSafe Firmware Version 3.6.1 consisting of Rev 3.0.5.5 and DSP version 2.0.45. Refer to [Discharge SpikeSafe Channel Using Get Discharge Complete query](#discharge-spikesafe-channel-using-get-discharge-complete-query) below.
7
+
8
+
For older SpikeSafe Firmware Versions, use a time delay to properly discharge the load voltage. Refer to [Discharge SpikeSafe Channel Using Time Delay](#discharge-spikesafe-channel-using-time-delay) below.
9
+
10
+
## **Discharge SpikeSafe Channel Using Get Discharge Complete query**
11
+
12
+
### Overview
13
+
Operates the first test using SpikeSafe as a DC current source with single output current, stops current output, and then uses the SpikeSafe Get Discharge Complete query to properly discharge the load with the intent of running a second test. Afterwards, the same process is repeated for the second and final test, then the SpikeSafe Discharge Complete query is used again with the intent of ensuring the load is safe to be disconnected.
14
+
15
+
### Expected Output
16
+
Once the SpikeSafe Get Discharge Complete query returns `TRUE` after the first test has completed, the second test begins supplying output current again to the load. Once the second test has completed, the SpikeSafe Get Discharge Complete query is monitored until all load voltage is discharged to notify the operator that it is safe be disconnected.
17
+
18
+
#### Log Output Between test #1 and test #2
19
+
Sending SCPI command: `OUTP1 0`
20
+
`0, OK`
21
+
Waiting for Channel 1 to fully discharge after test #1...
22
+
Sending SCPI command: `OUTP1:DISC:COMP?`
23
+
Read Data reply: `FALSE`
24
+
Sending SCPI command: `OUTP1:DISC:COMP?`
25
+
Read Data reply: `FALSE`
26
+
Sending SCPI command: `OUTP1:DISC:COMP?`
27
+
Read Data reply: `FALSE`
28
+
Sending SCPI command: `OUTP1:DISC:COMP?`
29
+
Read Data reply: `FALSE`
30
+
Sending SCPI command: `OUTP1:DISC:COMP?`
31
+
Read Data reply: `FALSE`
32
+
Sending SCPI command: `OUTP1:DISC:COMP?`
33
+
Read Data reply: `TRUE`
34
+
Sending SCPI command: `OUTP1 1`
35
+
36
+
#### Log Output Between test #2 and Completing the Script
37
+
Sending SCPI command: `OUTP1 0`
38
+
`0, OK`
39
+
Waiting for Channel 1 to fully discharge after test #2...
40
+
Sending SCPI command: `OUTP1:DISC:COMP?`
41
+
Read Data reply: `FALSE`
42
+
Sending SCPI command: `OUTP1:DISC:COMP?`
43
+
Read Data reply: `FALSE`
44
+
Sending SCPI command: `OUTP1:DISC:COMP?`
45
+
Read Data reply: `FALSE`
46
+
Sending SCPI command: `OUTP1:DISC:COMP?`
47
+
Read Data reply: `FALSE`
48
+
Sending SCPI command: `OUTP1:DISC:COMP?`
49
+
Read Data reply: `FALSE`
50
+
Sending SCPI command: `OUTP1:DISC:COMP?`
51
+
Read Data reply: `FALSE`
52
+
Sending SCPI command: `OUTP1:DISC:COMP?`
53
+
Read Data reply: `TRUE`
54
+
discharge_channel_using_delay.py completed.
55
+
56
+
## **Discharge SpikeSafe Channel Using Time Delay**
57
+
58
+
### Overview
59
+
Operates SpikeSafe as a DC current source with single output current, stops current output, and then uses the [spikesafe-python](https://pypi.org/project/spikesafe-python/)[`get_spikesafe_channel_discharge_time()`](../../spikesafe_python_lib_docs/Discharge/get_spikesafe_channel_discharge_time/) and [`wait()`](../../spikesafe_python_lib_docs/Threading/wait/) functions to properly discharge the load with the intent of running a second test. Afterwards, the same process is repeated for the second and final test, then the SpikeSafe Discharge Complete query is used again with the intent of ensuring that it is safe to be disconnected.
60
+
61
+
### Expected Output
62
+
Once the delay to discharge after the first test has completed, the second test begins supplying output current again to the load. Once the second test has completed, another delay to discharge occurs until all load voltage is discharged to notify the operator that it is safe to be disconnected.
63
+
64
+
Each delay will show the following message in the log:
65
+
Waiting 0.027 seconds for Channel 1 to fully discharge...
66
+
67
+
### Remarks
68
+
System timers dictate the resolution of time delays. See [Remarks](../../spikesafe_python_lib_docs/Threading/wait/README.md#remarks) describing resolution of system timers between operating systems.
0 commit comments