Difference between revisions of "VT 1"

From DIDEAS Wiki
Jump to: navigation, search
m (The Tool GUI and Command Line Interface)
m (Command Line Interface)
Line 55: Line 55:
 
==Command Line Interface==
 
==Command Line Interface==
  
While
+
The MATLAB command line
 +
 
 
mc.help()
 
mc.help()
 
mc.send_user_command_string('icore_datarate 100');
 
mc.send_user_command_string('icore_datarate 100');

Revision as of 14:08, 28 March 2015

Visualization Tool


Installation

The tool is known to operate under Windows (64 and 32 bits) and MAC OS systems.

  • At present, MATLAB 2014b or later is required. Versions prior to 2014b do not support the direct interface with python utilized by the VT.
    • In the future, a compiled version of the VT may exist.
  • Python 2.7.9 [1]. Choose the same number of bits as the version of MATLAB (python support under MATLAB requires that the 'bits' match)
  • The Tool lives in the repository Master Branch at the location \Tools\Matlab
    • Pull into a convenient directory (referred to as VT_HOME). To run the tool, this will need to be MATLABs current directory.
  • Optional : For direct connection a UART device, or to a PSoC using the USB CDC profile, the pyserial module is required and the Cypress USBSER driver are required. USBSER instructions are possibly specified in the repository Master Branch under the Documentation directory.
    • The easy install is to open a command prompt or terminal window and type pip install pyserial
    • If the pip command is unknown, then its likely not in your path. It typically lives in c:\Python27\Scripts, in which case you may run c:\Python27\Scripts\pip install pyserial
    • For 64 bit windows, if there is a problem with the pip install, another trusted source is the team at UCI : pyserial‑2.7‑py2‑none‑any.whl


Starting Tool (gui_3) for TCP/IP Operation

Start MATLAB 2014b+ and then cd to the VT_HOME directory. Under Windows you may wish to create a MATLAB shortcut where VT_HOME the startup directory.

  • You'll need to know the IP address or host names of the instrument. Lets assume its 192.168.7.2
  • Within MATLAB, run the command : gui_3('connect', '192.168.7.2')


The Tool GUI and Command Line Interface

The tool may be interacted with both graphically and via the MATLAB command line.

Graphical Interface

Upon startup if the connection is successful, two MATLAB figures will be created. The plotting figure by default is docked with MATLAB and the Variable Chooser is floating.

The variables to be plot are selected by (left) clicking their name within the Variable Chooser figure. Multiple variables are selected by using SHIFT click and/or CTRL click.

The Plot Figure contains several buttons (lower left) and two sliders (bottom).

buttons

  • STOP : Clicking this button is the preferred way to stop the Tool. The two figures and connection will be closed.
  • GRAPH*** : Pause / Resume the update of the graphic display. In the background, data from the instrument is collected. (At
  • DATA : Sending a command to the instrument to stop or start sending data. After stopping and restarting, the graph will typically contain an empty space for the stopped time interval.
  • SAVE : Save a snapshot of the GUI and the instrument data within the 'data accumulator circular queue' variables. The snap shot may require many seconds (a minute?) during which time, current data from the instrument may be lost. This data structure maintains the most recent DATA_ACCUMULATOR_MAX_LENGTH (currently 480,000) samples from each field.
  • LOG and edit box: When LOG 1, all plotable vectors sent from the instrument are save into a sqlite3 database (on the local file system). The base filename for the SQL DB is specified in the edit box. The base file name is extended with current date and time and the extension .sqlite3 (eg The gxlog_20150328_093407.sqlite3)

*** At present the pause/resume button behavior is broken.

sliders

The sliding controls at the bottom are still under development and have broken the graphic pause feature. The sliders themselves are also somewhat working / broken depending on one's expectations.

  • Viewport width slider : The left slider controls the viewport window size. The control linear position (x) specifies an 10^x seconds viewport size. The limits are 1 second and 1000 seconds. This slider operates as expected, although the initial position does not match the actual viewport.
  • Viewport position slider : The larger right slider control the start position of the viewport within the complete set of captured samples with left the oldest data. Ideally moving the slider from the right position would pause the graph at that position, however instead the graph continues to scroll at a reduced by moving it to the right.


Command Line Interface

The MATLAB command line

mc.help() mc.send_user_command_string('icore_datarate 100'); mc.stop_data_stream(); mc.start_data_stream();


Access to the data on the MATLAB command line is via the 'daf' (data accumulator fields) and 'da' (data accumulator) variable.

For obtain the 'fd' data with : daf.iCore_in_fd.get()


A user command is sent via the matlab command line. The object 'mc' (matlab client) contains the methods. Some of which are:


Also, I've created a file called: live_data_test.m

Which will access the live data in 'daf' and plot it at 5Hz. Of course, calculations could be performed on the data before plotting.

Bugs / Issues

  • When the 480k sample buffer fills, the current (unreleased) tool crashes. The released too may also.
  • When the data dictionary contains the L data type (unsigned long), values between 2^31 and 2^32-1 cause the tool to crash.
  • Fix right slider behavior. Moving slider from extreme right will cause a pause
  • Selecting pause will adjust position of right slider slightly left. Selecting resume will move the slider to the extreme right.
  • Fix initial values of the sliders


Features To Be Added

  • Ability to save / load a configuration file.
    • The config file will contain the set of selected variables and any other user made interface adjustments (to be developed)
  • Ability to specify the Y axis limits
  • Ability to load saved data from VT created .mat files and sqlite3 databases
  • Ability to place multiple fields within a single subplot
  • Multiple plot figures
  • Ability to stream from a local / remote SQL server/database
  • ? Ability to send commands from the plot figure
  • simplify startup allowing the GUI to list / select the instrument connection