SourcePoint Intel Help

Table of Contents

Python/CScripts Introduction, Installation and Usage

Introduction

CScripts (Customer Scripts) are a collection of Python scripts provided by Intel to assist customers with platform debug and validation. ย Asset-InterTech has support in place to run these scripts in its SourcePoint product. ย 

Note: ย This technical note discusses running CScripts from within the SourcePoint Command view. ย CScripts can also be run in an external CLI. ย This has the advantage of supporting tab completion, coloring, and other advanced features. ย See the OpenIPC Integration, Installation and Usage for more information.

Requirements

CScripts are designed to be run inside SourcePoint, using its Command view. ย Therefore, the host system requirements are the same as the requirements and pre-requisites for SourcePoint. ย Refer to SourcePointโ€™s Installation Guide for these requirements.

As CScripts are written in Python, the host system will need to have Python installed. ย Current support is in place for 32-bit Python version 2.7. ย Some scripts are compiled, so CScripts will not function correctly if you have a different version of Python installed on your host.

In case you donโ€™t already have a python installation, SourcePointโ€™s installer comes packaged with Python 2.7.5. ย Allow the installer to maintain the default settings to ensure compatibility.

Installation

CScripts come packaged in a .zip file. This .zip file can be extracted to anywhere on the host system; however, it is recommended that it be extracted into the C:\CS folder. If a different location is chosen, please ensure there are no blank spaces in the folder name. It is a requirement that the directory structure be kept intact when extracting the .zip file, as individual script files reference other files using virtual path names.

Usage in SourcePoint

The SourcePoint Command View is not a separate python command window, rather a python environment integrated inside the application's GUI. Some aspects of SourcePoint python may not behave identically to Intel ITP II's CLI, or to a native python command window, but the CScripts should provide the same behavior.

SourcePoint python retains the concept of a viewpoint processor and supports the Intel ITP II logical node tree and the CScripts devicelist-based logical node tree.

This userโ€™s guide describes using SourcePoint on a Microsoft Windows system with USB interface. It does not describe setup of the network interface. The SourcePoint help files have documentation on these topics.

Known current limitations:

SourcePoint does not support pyreadline, and has no tab-completion. Use the dir() command with a module name to see names of interest.

Invoking CScripts under SourcePoint

There are currently three ways to load CScripts. Option #1 is easy and recommended for both new and experienced users.

Option #1:

  • Locate the root directory of the CScripts and use the mouse drag/drop technique to drag the file <startup script name>.py into the SourcePoint Command view. This will switch to python mode, import the CScripts, and display the initial screen.

Option #2:

  • In the Command view, enter 'python' to switch to python mode.

  • Enter a second prompt to cause the python version to appear, indicating interactive mode python initialization.

  • At the prompt, enter (for example) 'arium.runfile("<path>\startivt_oem_arium.py")' to import the CScripts. ย The name of the startup script may be slightly different from the above, depending on the version of CScripts being used. ย If thatโ€™s the case, just replace the name in the above command with the correct script name.

Option #3:

  • In the command view, enter 'python' to switch to python mode.

  • Enter a second prompt to cause the python version to appear, indicating interactive mode python initialization.

  • At the prompt enter 'arium.runfile()' and hit return to bring up a windows explorer window, then navigate to the root directory of the CScripts package and double-click on the startup script start_oem_arium.py (or similar) to run it.

The various functions of CScripts can now be used as described in the CScripts User Guide from the SourcePoint Command view, noting that tab completion doesnโ€™t work, and the display will be embedded in the application UI. ย The CScripts User Guide can be found in the root directory of the CScripts package.

To exit the session, enter the command 'cscript()' to exit python mode, then exit to leave SourcePoint.