Automation Interface

www.kxcad.net Home > CAE Software Index > MATLAB Index >



Overview of Automation Interface ComponentIntroduction and definitions of Link for TASKING objects.
ClassesClasses provided with Link for TASKING.
Using ObjectsHow to create objects and find methods and properties.
List of MethodsTables showing the methods available for Link for TASKING objects.
Details of Particular MethodsInformation about particular methods, such as read/write memory units.

Overview of Automation Interface Component

The Link for TASKING Automation Interface Component provides powerful MATLAB API's for automating interacting with the TASKING EDE and CrossView Pro Debugger. See Automation Interface for a summary.

Objects for Link for TASKING

Link for TASKING uses object-oriented programming techniques and requires a basic knowledge of some object-oriented terminology. The following are some fundamental terms you should understand:

The following sections describe how to use and get help for Link for TASKING objects. See Objects Demo Example for an example demonstrating some basic capabilities of Link for TASKING objects.

Classes

The following table shows the different classes that are provided with Link for TASKING.

ClassDescription
tasking.edeapi Represents the TASKING EDE.
tasking.edeprojectspace Represents a project space in the TASKING EDE.
tasking.edeprojectRepresents a project in the TASKING EDE.
tasking.xviewapi Represents the TASKING CrossView Pro debugger.
tasking.Tasking_Configuration Property of a tasking.edeapi class representing TASKING configuration details.
tasking.EDE_Configuration Property of a tasking.tasking_Configuration representing EDE configuration details.
tasking.CrossView_Pro_ConfigurationProperty of a tasking.tasking_Configuration representing CrossView Pro configuration details.

Using Objects

The topics in this section are:

  1. Creating an Object

  2. Determining the Available Methods for a Class

  3. Obtaining Help for a Class Method

  4. Calling a Method

  5. Determining the Available Properties for a Class

  6. Accessing a Property

  7. Objects Demo Example

Creating an Object

To find out how to create an object of a particular class you can use the tasking_help function to find help for the constructor. At the MATLAB command prompt, enter

tasking_help <classname>.<constructorname>

For example, for the tasking.edeapi class, enter

tasking_help tasking.edeapi.edeapi

For the tasking.edeprojectspace class, enter

tasking_help tasking.edeprojectspace.edeprojectspace

Follow these steps to create example objects.

  1. To create a tasking.edeapi object, you call the constructor as follows:

    Ede = tasking.edeapi

    The name on the left side of the "=" could be any valid MATLAB identifier and is the handle to the object.

    You must choose a configuration, then communication is tested with the TASKING EDE. At the command line you see the configuration target preferences.

  2. To create a tasking.edeprojectspace object, you call the constructor as follows:

    tasking.edeprojectspace(projspace, edeapi) 

    where projspace is the absolute path of the TASKING Project Space this object will relate to, and edeapi is a tasking.edeapi object, as shown in the following example:

     ps = tasking.edeprojectspace('D:\MATLAB\work\
    myprojspace.psp', Ede)
  3. To create a tasking.edeproject object, you call the constructor as follows:

    tasking.edeproject(proj, edeprojspace)

    where proj is the absolute path of the TASKING Project this object relates to, and edeapiprojspace is a tasking.edeprojectspace object, as shown in the following example:

    proj = tasking.edeproject('D:\MATLAB\work\myproj.pjt', ps)
  4. To create a tasking.xviewapi object, you call the constructor as follows

    xv = tasking.xviewapi

    You must choose a configuration, then communication is tested with CrossView Pro. At the command line, you see the configuration target preferences.

Determining the Available Methods for a Class

After you create an object, you can find the available methods by running the "methods" function.

  1. For example, to find the methods available on the tasking.edeapi object created above (in Creating an Object), enter methods(Ede).

  2. To find the methods available on the tasking.edeprojectspace object previously created, enter methods(ps).

  3. To find the methods available on the tasking.edeproject object previously created, enter methods(proj).

  4. To find the methods available on the tasking.xviewapi object previously created, enter methods(xv).

To see the methods available, refer to the tables in List of Methods.

Obtaining Help for a Class Method

To get help for a class method, you can use the tasking_help function.

For example, to find out more about the getProject method of the tasking.edeapi class, you could enter the following command:

tasking_help tasking.edeapi.getProject

MATLAB returns the following output:

GETPROJECT - get the active Project in the EDE
project = getProject
project: edeproject object representing the active Project
 in the EDE
project will be empty if there is no open project

To see the methods available, refer to the tables in List of Methods.

Calling a Method

When you know the details of a class method, you can call it using dot (.) notation.

For example, to get a tasking.edeproject object representing the active project, run the following command:

project = Ede.getProject

Determining the Available Properties for a Class

After you create an object, you can find the available properties by running the get function.

For example, to find the properties available on the tasking.edeapi object created above, enter

get(Ede)

Accessing a Property

You can access a property of a class using dot (.) notation.

For example, to get the "configuration" property of the tasking.edeapi object created above, enter:

config = Ede.configuration
tasking.Tasking_Configuration (handle)
      Configuration_Description: 'C166'
              EDE_Configuration: [1x1 tasking.EDE_Configuration]
    CrossView_Pro_Configuration: [1x1 tasking.CrossView_Pro_
Configuration]

Objects Demo Example

For experience using objects, you can work through the demo example, tasking_demo_objects.m, found under Link for TASKING Demos.

This example provides step-by-step instructions for using Link for TASKING objects to communicate with the TASKING EDE and CrossView Pro debugger from the MATLAB command line. You can use any command available in the powerful CrossView Pro command language. The demo illustrates using objects during the process of building and debugging projects.

List of Methods

See the following tables for lists of available methods:

The public methods are shown in the tables (methods beginning with "p" or "p_" are private methods and should not be used).

Methods for Class tasking.edeapi

closegetOptionSetNames
dispgetProject
displaygetProjectSpace
edeapigetTargetProject
execgetToolchainInfo
execApiMacronewProject
execRetNumericnewProjectSpace
execRetStringnewProjectTemplates
getCreatedEDEProcessnewProjectTemplatesViaUI
getOptionSetnewTempProjectSpaceIfNoneOpen
openProjectTemplatesprocessTemplateProject
pwdvalidateToolchainDirectory
hilite_systemconnect
isconnected 

Methods for Class tasking.edeprojectspace

adddeleteParentDir
getEDEisopen
checkValiddisp
getOriginalPathnew
checkValidProjectdisplay
getPathopen
closeedeprojectspace
isequalremove

Methods for Class tasking.edeproject

addgetEDEisopen
buildgetFilesnew
checkValidgetHyperlinkopen
closegetIncludesrebuild
debuggetMakeCmdremove
dispgetOriginalPathrun
displaygetPathsetCDefines
edeprojectgetProjectSpacesetIncludes
getBuildOutputgetTargetsetPerformToolchainNameCheck
getCDefineshasFile 
getDirisequal 

Methods for Class tasking.xviewapi

addBreakpointCallbackgetEventReporting
getFunctionConfigurationdebug
disphalt
removeBreakpointCallbacks display
isRunning setEventReporting
downloadAndRunexecute
xviewapi executeAndWait
getCommandResponsegetExecutable
getProjecthilite_system
readMemoryUnitswriteMemoryUnits
resetstackProfile
stackProfileReset 

Details of Particular Methods

The following methods of the tasking.xviewapi object simplify reading from and writing to target memory units (the smallest addressable unit in the memory of the target).

Use these functions with the MATLAB functions, typecast and swapbytes, for reading and writing data of different datatypes.

To see examples of syntax, see the demo example, tasking_demo_objects.m, found under Link for TASKING Demos.

  


© 1984-2007 The MathWorks, Inc. Terms of Use Patents Trademarks Acknowledgments