14: TSP command reference 2470 High Voltage SourceMeter Instrument
14-228 2470-901-01 Rev. A / May 2019
The counter is reset to 0 when the trigger model starts. It is incremented each time trigger model
execution reaches the counter block.
If you are using remote commands, you can query the counter. The counter is incremented
immediately before the branch compares the actual counter value to the set counter value. Therefore,
the counter is at 0 until the first comparison. When the trigger model reaches the set counter value,
branching stops and the counter value is one greater than the setting. Use
trigger.model.getbranchcount() to query the counter.
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:
Also see
trigger.model.getbranchcount() (on page 14-215)
trigger.model.setblock() — trigger.BLOCK_RESET_BRANCH_COUNT (on page 14-246)
trigger.model.setblock() — trigger.BLOCK_BRANCH_DELTA
This function defines a trigger model block that goes to a specified block if the difference of two measurements
meets preset criteria.
Type TSP-Link accessible Affected by Where saved Default value
Instrument reset
Usage
trigger.model.setblock(blockNumber, trigger.BLOCK_BRANCH_DELTA, targetDifference,
branchToBlock)
trigger.model.setblock(blockNumber, trigger.BLOCK_BRANCH_DELTA, targetDifference,
branchToBlock, measureBlock)
The sequence of the block in the trigger model
The value against which the block compares the difference between the
measurements.
The block number of the trigger model block to execute when the difference between
the measurements is less than or equal to the targetDifference
The block number of the measure block that makes the measurements to be
compared; if this is 0 or undefined, the trigger model uses the previous measure
block
Details
This block calculates the difference between the last two measurements from a measure block. It
subtracts the most recent measurement from the previous measurement.
The difference between the measurements is compared to the target difference. If the difference is
less than the target difference, the trigger model goes to the specified branching block. If the
difference is more than the target difference, the trigger model proceeds to the next block in the
trigger block sequence.