Section 7: TSP command reference
Models 707B and 708B Switching Matrix Reference Manual
7-148
707B-901-01 Rev. B / January 2015
scan.state()
This function provides the present state of a running background scan.
Type
TSP-Link accessible
Affected by
Where saved
Default value
Function
Yes
Usage
scanState
,
scanCount
,
stepCount
= scan.state()
scanState
The present state of the scan running in the background. Possible states include:
scan.EMPTY
or
0
scan.BUILDING
or
1
scan.RUNNING
or
2
scan.ABORTED
or
3
scan.FAILED
or
4
scan.FAILED_INIT
or
5
scan.SUCCESS
or
6
scanCount
The current number of scans that have completed
stepCount
The current number of steps that have completed
Details
scanCount
is the number of the current iteration through the scan portion of the trigger model. This
number does not increment until the scan begins. Therefore, if the instrument is waiting for an input to
trigger a scan start, the scan count represents the previous number of scan iterations. If no scan has
begun, the scan count is zero (0).
stepCount
is the number of times the scan has completed a pass through the channel action portion
of the trigger model. This number does not increment until after the action completes. Therefore, if the
instrument is waiting for an input to trigger a channel action, the step count represents the previous
step. If no step has yet completed, the step count is zero. If the step count has yet to complete the
first step in a subsequent pass through a scan, the scan count represents the last step in the previous
scan pass.
Example
scan.background()
scanState, scanCount, stepCount = scan.state()
print(scanState)
Runs a scan in the background.
Check the present scan state.
View value of
scanState
.
Output shows that scan is running:
2.000
Also see
(on page 7-139)
(on page 7-145)
(on page 3-1)