Target PC Commands

Introduction

You have a limited set of commands that you can use to work the target application after it has been loaded to the target PC, and to interface with the scopes for that application.

The target PC command-line interface enables you to work with target and scope objects in a limited capacity. Methods let you interact directly with the scope or target. Property commands let you work with target and scope properties. Variable commands let you alias target PC command-line interface commands to names of your choice.

Refer to Using the Target PC Command-Line Interface for a description of how to use these methods and commands.

Target Object Methods

When you are using the target PC command-line interface, target object methods are limited to starting and stopping the target application.

The following table lists the syntax for the target commands that you can use on the target PC. The equivalent MATLAB syntax is shown in the right column, and the target object name tg is used as an example for the MATLAB methods. These methods assume that you have already loaded the target application onto the target PC.

Target PC Command

Description and Syntax

MATLAB Equivalent

start

Start the target application currently loaded on the target PC.

Syntax: start

tg.start or +tg

stop

Stop the target application currently running on the target PC.

Syntax: stop

tg.stop or -tg

reboot

Reboot the target PC.

Syntax: reboot

tg.reboot

Target Object Property Commands

When you are using the target PC command-line interface, target object properties are limited to parameters, signals, stop time, and sample time. Note the difference between a parameter index (0, 1, . . .) and a parameter name (P0, P1, . . .).

The following table lists the syntax for the target commands that you can use to manipulate target object properties. The MATLAB equivalent syntax is shown in the right column, and the target object name tg is used as an example for the MATLAB methods.

Target PC Command

Description and Syntax

MATLAB Equivalent

getpar

Display the value of a block parameter using the parameter index.

Syntax: getpar parameter_index

get(tg, 'parameter_name')

setpar

Change the value of a block parameter using the parameter index.

Syntax: setpar parameter_index = floating_point_number

set(tg, 'parameter_name', number)

stoptime

Enter a new stop time. Use inf to run the target application until you manually stop it or reset the target PC.

Syntax: stoptime = floating_point_number

tg.stoptime = number

sampletime

Enter a new sample time.

Syntax: sampletime = floating_point_number

tg.sampletime = number

set(tg, 'SampleTime', number)

P#

Display or change the value of a block parameter. For example, P2 or P2=1.23e-4.

Syntax: parameter_name or
parameter_name = floating_point_number

parameter_name is P0, P1, . . .

tg.getparam(parameter_ index)
tg.setparam(parameter_ index,floating_point_ number)

S#

Display the value of a signal. For example, S2.

Syntax: signal_name

signal_name is S0, S1, . . .

tg.getsignal(signal_index)

Scope Object Methods

When using the target PC command-line interface, you use scope object methods to start a scope and add signal traces. Notice that the methods addscope and remscope are target object methods on the host PC, and notice the difference between a signal index (0, 1, . . .) and a signal name (S0, S1, . . .).

The following table lists the syntax for the target commands that you can use on the target PC. The MATLAB equivalent syntax is shown in the right column. The target object name tg and the scope object name sc are used as an example for the MATLAB methods.

Target PC Command

Description and Syntax

MATLAB Equivalent

addscope

addscope scope_index
addscope

tg.addscope(scope_index)
tg.addscope

remscope

remscope scope_index
remscope all

tg.remscope(scope_index)
tg.remscope

startscope

startscope scope_index

sc.start or +sc

stopscope

stopscope scope_index

sc.stop or -sc

addsignal

addsignal scope_index = signal_index1, signal_index2, . . .

sc.addsignal(signal_index_vector)

remsignal

remsignal scope_index = signal_index1, signal_index2, . . .

sc.remsignal(signal_index_vector)

viewmode

Zoom in to one scope or zoom out to all scopes.

Syntax: viewmode scope_index or left-click the scope window

viewmode 'all' or right-click any scope window

Press the function key for the scope, and then press V to toggle viewmode.

tg.viewMode = scope_index
tg.viewMode = 'all'

ylimit

ylimit scope_index
ylimit scope_index = auto
ylimit scope_index = num1, num2

sc.YLimit
sc.YLimit='auto'
sc.YLimit([num1 num2])

grid

grid scope_index on
grid scope_index off

sc.Grid = on
sc.Grid = off

Scope Object Property Commands

When you use the target PC command-line interface, scope object properties are limited to those shown in the following table. Notice the difference between a scope index (0, 1, . . .) and the MATLAB variable name for the scope object on the host PC. The scope index is indicated in the top left corner of a scope window (SC0, SC1, . . .).

If a scope is running, you need to stop the scope before you can change a scope property.

The following table lists the syntax for the target commands that you can use on the target PC. The equivalent MATLAB syntax is shown in the right column, and the scope object name sc is used as an example for the MATLAB methods

Target PC

MATLAB Equivalent

numsamples scope_index = number

sc.NumSamples = number

decimation scope_index= number

sc.Decimation = number

scopemode scope_index = 0 or numerical, 1 or redraw, 2 or sliding, 3 or rolling

sc.Mode = 'numerical', 'redraw', 'sliding', 'rolling'

triggermode scope_index = 0, freerun, 1, software, 2, signal, 3, scope

sc.TriggerMode = 'freerun', 'software', 'signal', 'scope'

numprepostsamples scope_index = number

sc.NumPrePostSamples = number

triggersignal scope_index = signal_index

sc.TriggerSignal = signal_index

triggersample scope_index = number

sc.TriggerSample = number

triggerlevel scope_index = number

sc.TriggerLevel = number

triggerslope scope_index = 0, either, 1, rising, 2, falling

sc.TriggerSlope = 'Either', 'Rising', 'Falling'

triggerscope scope_index2 = scope_index1

sc.TriggerScope = scope_index1

triggerscopesample scope_index= integer

sc.TriggerScopeSample = integer

Press the function key for the scope, and then press S.

sc.trigger

Aliasing with Variable Commands

The following table lists the syntax for the aliasing variable commands that you can use on the target PC. The MATLAB equivalent syntax is shown in the right column.

Target PC Command

Description and Syntax

MATLAB Equivalent

setvar

Set a variable to a value. Later you can use that variable to do a macro expansion.

Syntax: setvar variable_name = target_pc_command

For example, you can type setvar aa=startscope 2, setvar bb=stopscope 2.

None

getvar

Display the value of a variable.

Syntax: getvar variable_name

None

delvar

Delete a variable.

Syntax: delvar variable_name

None

delallvar

Delete all variables.

Syntax: delallvar

None

showvar

Display a list of variables.

Syntax: showvar

None

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS