Difference between revisions of "VT 1"

From DIDEAS Wiki
Jump to: navigation, search
m (The Tool GUI and Command Line Interface)
m (buttons)
Line 39: Line 39:
 
===buttons===
 
===buttons===
 
*STOP : Clicking this button is the preferred way to stop the Tool.  The two figures and connection will be closed.
 
*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
+
*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.
 
*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 <strong>DATA_ACCUMULATOR_MAX_LENGTH</strong> (currently 480,000) samples from each field.   
 
*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 <strong>DATA_ACCUMULATOR_MAX_LENGTH</strong> (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.  The gxlog_20150328_093407.sqlite3
 
*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.  The gxlog_20150328_093407.sqlite3
 +
 +
*** At present the pause/resume button behavior is broken.
  
 
===sliders===
 
===sliders===

Revision as of 13:38, 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. The gxlog_20150328_093407.sqlite3
      • At present the pause/resume button behavior is broken.

sliders

Command Line Interface

A combination of Selecting the variables

Within the plotting windows

The sliding controls at the bottom are still under development and have somewhat broken the graphic pause feature. The left slide controls the viewing window size, the right control should control the location of the viewing window within the total data set (480,000 samples maximum)

There are 2 types of pausing: 1) "GRAPH" - where the data is still received but plotting isn't update. (In theory) 2) "DATA" - where the gx message data_command:stop_data_stream / start_data_send. All data from the source should be temporally stopped.

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:

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


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.