Wiki

Clone wiki

subinitial / Getting Started

Getting Started with Stacks

Installing The Subinitial Python Library

The Subinitial Python Library is available through our public Git repository: https://subinitial@bitbucket.org/subinitial/subinitial.git

1. Install Python

Python 3.5+ is the recommended programming language for the Stacks Python Library. Python 2.7 is also supported for the Subinitial Stacks library if you require it, but not the Subinitial Equipment or the Subinitial Automation libraries. You can write test-equipment interface code and test procedures (ATP) entirely in Python. Python is freely available at https://www.python.org/downloads/

If your system uses and depends on Python 2 then take care not to allow Python 3 to be added to your system's PATH environment variable. If necessary Python 2 and 3 can both be installed and used at the same time. In this case you can use the popular option to install Python 3 in your system and add it to your path using the executable name python3. This way python3 does not conflict with any programs that assume the executable named "python" is a Python 2 runtime.

Both the Python Software Foundation and Stack Overflow have a wealth of information on configuring Python on a variety of systems.

2. Install Git

Git is a distributed version control system. It is freely available at http://git-scm.com/downloads. Be sure to add Git to your system's PATH when installing. After installing ensure git is installed correctly by opening a command prompt and entering the command "git". You should see git program usage information and commonly used git commands read out on your screen.

3. Use pip to install the latest Subinitial Stacks python library to your computer

Using the command line:

pip3 install --user git+https://bitbucket.org/subinitial/subinitial.git
You should now be able to import subinitial.stacks within Python.

NOTES:

  • You can use pip2 instead of pip3 to install the library as a Python2.7 package
  • The --user flag allows you to pip install packages to your user account without admin privileges
  • Common package install locations with the --user flag:
    • GNU/Linux Python3.5: /home/$USER/.local/lib/python3.5/site-packages/...
    • Windows7+ Python3.5: C:\Users\$USER\AppData\Roaming\Python\Python35\site-packages\...

5. Run A Test Script To Verify Correct Installation

Create an empty text file called "si_python_test.py", copy the Python code below into it, and save the file.

#!python
import subinitial.stacks as stacks
print("Stacks Library Major Version:", stacks.VERSION_STACKS[0])
Execute si_python_test.py
python si_python_test.py
Verify that the program runs without error and outputs the following text
Stacks Library Major Version: 1

Setting Up Your Stacks Hardware

To get an overview of how to set up your Stacks hardware please refer to the Stacks Hardware Getting Started Guide Each product's datasheet includes connector/interface pinouts.

Verifying Network Connectivity with the Stacks Core

When your Stacks hardware is powered you must verify your LAN is properly configured. Please refer to the Stacks Connectivity Troubleshooting Guide for information on setting up your network.

Begin Writing Your Code

Open the editor of your choice and begin writing code. Each Stacks product has library documentation and usage documentation available in this repository.

Picking a Text Editor / IDE

For those who don't have a favorite text editor/IDE for Python or want to try something new we suggest Jetbrains PyCharm. You can download the open-source "Community Edition" for free at jetbrains.com. The "Community Edition" is more than adequate to develop, debug, and deploy professional programs and test automation using Stacks.

Updated