
Model 2450 Interactive SourceMeter® Instrument Reference Manual
Section 8: TSP command reference
2450-901-01 Rev. B/September 2013
8-193
trigger.model.setblock() — trigger.BLOCK_BRANCH_COUNTER
This function defines a trigger model block that branches to a specified block a specified number of times.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
Yes
Restore configuration
Instrument reset
Power cycle
Configuration script Not applicable
Usage
trigger.model.setblock(
blockNumber
, trigger.BLOCK_BRANCH_COUNTER,
targetCount
,
branchToBlock
)
blockNumber
The sequence of the block in the trigger model
targetCount
The number of times to repeat
branchToBlock
The trigger model block to execute when the counter is less than the
targetCount
value
Details
This command defines a trigger model building block that branches to another block using a counter to iterate a
specified number of times.
Counters increment every time the trigger model reaches them until they are more than or equal to the count
value.
Example
trigger.model.setblock(4, trigger.BLOCK_BRANCH_COUNTER, 10, 2)
print(trigger.model.getbranchcount(4))
When the trigger model reaches this block, the trigger model returns to block 2. This repeats 10 times.
An example of the return if the trigger model has reached this block 5 times is:
5
Also see
trigger.model.getbranchcount()
(on page 8-187)