- Python 2.7 or Python 3.8 install and added to your path. For more details on how to add Python to your path use the following link.
- NIC-500 with SDK.
- Git must be included on your system. Follow this link to download Git. When installing Git make sure it's installed on your Windows Command Prompt.
The API reference documentation is hosted on GitHub pages.
Commands work for Python 2.7 or 3.8. If you have both you need to modify the name of the python.exe and specify the Python version (i.e. python3) when running Python commands. Refer to this link for more details on how to update the name of the Python executable.
-
Open Command Prompt from the Start Menu.
-
Install a Python virtual environment
python -m pip install virtualenv -
Create Python environment. We are calling it nic-sdk-python${VERSION}.
For Python 2 use this command:
python -m virtualenv nic-sdk-python2For Python 3 use this command:
python -m venv nic-sdk-python3 -
Navigate to your Python environment. From the command above it should state the path where the environment was installed.
For example:
creator CPython3Windows(dest=C:\Users\${USERNAME}\nic-sdk, clear=False, no_vcs_ignore=False, global=False)Replace PATH_TO_ENV to the path of your environment (i.e.
C:\Users\${USERNAME}\nic-sdk).cd ${PATH_TO_ENV} -
Activate the environment.
Scripts\activate -
Navigate back to home, create a workspace, and clone your repo. If you have a workspace clone it there.
Replace ${USERNAME} with your computer name. If you get stuck use the command
dir. It'll tell you where you are and what files you can navigate into to using thecdcommand.cd C:\Users\${USERNAME}mkdir workspacecd workspacegit clone git@github.com:SensoftInc/spidar-sdk.git -
Navigate into the example directory
cd example -
Install the requirements to run the software.
python -m pip install -r requirements.txt -
When you are finish with your environment deactivate it
deactivate
Example scripts of running SPIDAR SDK are available in the example subfolder.
This sample script demonstrates how to collect data from a NIC500.
To run the collection script navigate into the example directory and use the following command.
python collect_data_from_nic500_sdk.py
This sample script demonstrates how to run reset data socket command during collection. An example use case of this command is when Ethernet cable disconnects from the NIC500 and Computer.
To run the reset data socket script navigate into the example directory and use the following command.
python reset_data_socket_during_collection_sdk.py
Each script will output what commands it ran. For more details on what the script does refer to the python file.