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
+72-7Lines changed: 72 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,31 +15,90 @@ Use these code samples to start learning how to communicate with your SpikeSafe
15
15
16
16
## Usage
17
17
18
+
### Python
19
+
Download and install [Python](https://www.python.org/downloads/), which will install:
20
+
- IDLE
21
+
- Python Launcher
22
+
- Python3 Interpreter
23
+
24
+
#### Windows Setup
25
+
26
+
##### Use the Standard Console Command Prompt
27
+
To open Command Prompt press the key combination Windows + R to open a Run dialog, and then type cmd and hit Enter or click Ok.
28
+
29
+
##### Add Python to PATH
30
+
It is recommended that the path of Python Interpreter is added for easy usage. There are two ways to add Python to Windows PATH.
31
+
32
+
1. During Python installation check the box Add Python to PATH when prompted.
33
+
- Confirm Python PATH is set in **Command Prompt** by typing `python3 --version` to verify the Python version
34
+
35
+
2. Manually add Python to Windows Path:
36
+
- Press the key combination **Windows + R** to open a Run dialog
37
+
- Type `sysdm.cpl` to open the System Properties
38
+
- Press **Advanced** tab and then press on **Environment Variables…** to open Environment Variables dialog
39
+
- Under the **User variables** box, press on **New…** to add the `Path` variable (if your **Path** variable already exists, then press on **Edit…** instead):
40
+
- Set the Path **Variable value** to the 1) `Python application path` and 2) `Python Scripts path`. To find these paths and set the value:
41
+
- Type `Python` in the Windows Search Bar
42
+
- Right-click on the **Python App**, and then press **Open file location**
43
+
- Right-click on the **Python shortcut**, and then press **Open file location** (this is the `Python application path`)
44
+
- Navigate to the **scripts** folder (this is the `Python Scripts path`)
45
+
- Set the Path **Variable value** to `Python application path;Python Scripts path` (paths are separated by a semicolon)
46
+
- Press **OK**
47
+
- Confirm Python PATH is set in **Command Prompt** by typing `python3 --version` to verify the Python version
48
+
49
+
#### Mac OS X Setup
50
+
51
+
##### Use the Standard Console Terminal
52
+
To open Terminal navigate to Applications, then Utilities, then double-click the Terminal program.
53
+
54
+
##### Add Python to PATH
55
+
It is recommended that the path of Python Interpreter is added for easy usage. To do this:
56
+
57
+
- The path for Python interpreter can be found by opening **Python Launcher application** (this is the `Python install directory`)
58
+
- Open **Terminal**
59
+
- Type `sudo nano /etc/paths`
60
+
- Enter path of the `Python install directory` here
61
+
- Press `Control + X` to exit
62
+
- Press `Y` to save
63
+
- Confirm Python PATH is set in **Terminal** by typing `python3 --version` to verify the Python version
64
+
18
65
### IDEs
19
66
20
67
#### Visual Studio Code and Using a Virtual Environment
21
-
To run these sequences a light-weight IDE, or to target cross-platform development, use the free [Visual Studio Code](https://code.visualstudio.com/). See [Getting Started with Python in VS Code](https://code.visualstudio.com/docs/python/python-tutorial) to simply setup your IDE with Python. Optionally, using a [virtual environment](https://docs.python.org/3/tutorial/venv.html) is recommended to successfully meet the installation requirements to run these sequences. Using the commands `py -3 -m venv .venv` followed by `.venv\scripts\activate` is a simple way to setup your virtual environment. After your IDE and virtual environment is setup, continue to install the remaining Python packages below.
68
+
To run these sequences a light-weight IDE, or to target cross-platform development, use the free [Visual Studio Code](https://code.visualstudio.com/). See [Getting Started with Python in VS Code](https://code.visualstudio.com/docs/python/python-tutorial) to simply setup your IDE with Python. Optionally, using a [virtual environment](https://docs.python.org/3/tutorial/venv.html) is recommended to successfully meet the installation requirements to run these sequences. Using the commands `python3 -m venv .venv` followed by `.venv\scripts\activate` is a simple way to setup your virtual environment. After your IDE and virtual environment is setup, continue to install the remaining Python packages below.
22
69
23
70
#### Visual Studio Community
24
71
To run these sequences in a more feature rich IDE, use the free [Visual Studio Community](https://visualstudio.microsoft.com/vs/community/). See [Python In Visual Studio](https://docs.microsoft.com/en-us/visualstudio/python/tutorial-working-with-python-in-visual-studio-step-00-installation?view=vs-2022) to simply setup your IDE with Python. Optionall, using a [virtual environment](https://docs.microsoft.com/en-us/visualstudio/python/managing-python-environments-in-visual-studio?view=vs-2022) is recommended to successfully meet the installation requirements to run these sequences.
25
72
26
73
### Packages
27
74
28
-
#### Installing spikesafe-python Package
29
-
The [spikesafe-python](https://pypi.org/project/spikesafe-python/) library will need to be installed 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.2.3.
75
+
#### Managing Packages
76
+
##### How to Install/Upgraded Packages
77
+
Installing packages use pip. It is recommended that pip be updated to latest version `python3 -m pip install --upgrade pip`
78
+
79
+
The version of pip can be displayed with the following command `pip3 -V`
80
+
81
+
##### How to View All Installed Packages
82
+
A list of all installed packages can be found with `pip3 freeze` command
83
+
84
+
##### How to View Details of an Installed Package
85
+
After a package is installed the details of a package can be displayed with the following command `pip3 show <package name>` (e.g. `pip3 show spikesafe-python`)
86
+
87
+
##### Installing spikesafe-python Package
88
+
The [spikesafe-python](https://pypi.org/project/spikesafe-python/) library will need to be installed using the command `python3 -m pip install spikesafe-python`. Vektrex recommends always having the latest version of spikesafe-python when running these sequences; the current version is 1.2.3.
30
89
31
90
Once the spikesafe-python package is installed, each script in this repository can be run independently as a standalone Python file. Run a file in its current state and verify that the expected outputs are obtained, as specified by the file's markdown description.
32
91
33
92
Complete class documentation is available for spikesafe-python in [spikesafe-python API Overview](spikesafe_python_lib_docs).
34
93
35
94
#### Installing matplotlib Package
36
-
Some sequences involve graphing measurement results. To properly graph results, the [matplotlib](https://matplotlib.org/) library is required (version 3.2.1 or greater). Use the command `python -m pip install matplotlib` to install the latest version of matplotlib. Once the matplotlib library is installed, each sequence that involves graphing can be run as a standalone Python file.
95
+
Some sequences involve graphing measurement results. To properly graph results, the [matplotlib](https://matplotlib.org/) library is required (version 3.2.1 or greater). Use the command `python3 -m pip install matplotlib` to install the latest version of matplotlib. Once the matplotlib library is installed, each sequence that involves graphing can be run as a standalone Python file.
37
96
38
97
#### Installing PyCLibrary Package
39
-
Some sequences require external C resources, and requires the [PyCLibrary](https://pyclibrary.readthedocs.io/en/latest/) library. To install this library, enter the command `python -m pip install pyclibrary`. Once the PyCLibrary library is installed, each sequence that involves external C resources can be run as a standalone Python file.
98
+
Some sequences require external C resources, and requires the [PyCLibrary](https://pyclibrary.readthedocs.io/en/latest/) library. To install this library, enter the command `python3 -m pip install pyclibrary`. Once the PyCLibrary library is installed, each sequence that involves external C resources can be run as a standalone Python file.
40
99
41
100
#### Installing pyserial Package
42
-
Some sequences involve connecting to a serial interface instrument and requires the [pyserial](https://pypi.org/project/pyserial/) library (version 3.5 or greater). Use the command `python -m pip install pyserial` to install the latest version of pyserial. Once the pyserial library is installed, each sequence that involves a serial interface can be run as a standalone Python file.
101
+
Some sequences involve connecting to a serial interface instrument and requires the [pyserial](https://pypi.org/project/pyserial/) library (version 3.5 or greater). Use the command `python3 -m pip install pyserial` to install the latest version of pyserial. Once the pyserial library is installed, each sequence that involves a serial interface can be run as a standalone Python file.
43
102
44
103
### General Usage
45
104
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'`.
@@ -67,16 +126,22 @@ First start with [TCP Socket Sample](getting_started/tcp_socket_sample) to learn
67
126
68
127
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/VektrexElectronicSystems/SpikeSafePythonSamples/tags).
69
128
129
+
## FAQ
130
+
131
+
I'm developing an application using NI-VISA, what is the recommended practice for handling termination characters?<br />
132
+
See [Termination Characters in NI-VISA](https://www.ni.com/en-us/support/documentation/supplemental/06/termination-characters-in-ni-visa.html)
133
+
70
134
## Support/Feedback
71
135
72
136
If any further assistance is needed beyond the information provided within this repository, email [email protected].
73
137
74
-
Feature requests and bug reports can be submitted to [the Vektrex website's support page](https://www.vektrex.com/request-support/). Select "Other" as the Product/System and enter "GitHub Repository" as the Subject.
138
+
Feature requests and bug reports can be submitted to [the Vektrex website's support page](https://www.vektrex.com/request-support/). Select "Other" as the Product/System and enter "SpikeSafePythonSamples GitHub Repository" as the Subject.
Copy file name to clipboardExpand all lines: application_specific_examples/controlling_thermal_platform_temperature/ControllingThermalPlatformTemperature.py
Copy file name to clipboardExpand all lines: application_specific_examples/fixed_pulse_count_using_software_timing/FixedPulseCountUsingSoftwareTimingExample.py
0 commit comments