busTransition
busTransition(o_busWaveform t_yFrom t_yTo[n_nth] [t_xName] ) =>t_nthTransition/t_nthLastTransition/t_allTransitions/nil
Description
Returns the time when a bus value is changed from a specified value to another specified value.
Arguments
Value Returned
Examples
The following example creates an empty Waveform window and returns its window ID.
awvCreatePlotWindow()
=> window:3
The following example creates a bus with x- and y-vector values.
xvec=drCreateVec('double '(1.1 2.2 3.3 4.4 5.5 6.6))
=> srrVec:0x31403020
yvec=drCreateVec('busVec '("11" "00" "11" "00" "11" "00"))
=> srrVec:0x31403030
myBus=drCreateWaveform(xvec yvec)
=> srrWave:0x31451020
The following example plots the waveform represented by waveform object myBus.
awvPlotWaveform(
awvGetCurrentWindow()
list(myBus)
?expr list("myBus")
?color list("y6")
)
=> t

The following example returns the x-axis value at which the bus myBus transitions from binary value 0b11 (3decimal) to binary value 0b00 (0decimal) the third time.
busTransition(myBus "0b11" "0b00" 3)
=> 6.6

The following example returns the x-axis value at which the bus myBus transitions from binary value 0b11 (3decimal) to binary value 0b00 (0decimal) the second-last time.
busTransition(myBus "0b11" "0b00" -2)
=> 4.4

The following example returns all x-axis values at which the bus myBus transitions from binary value 0b11 (3decimal) to binary value 0b00 (0decimal) because n=0.
Note that the x-axis unit of the resulting waveform, which is stored in a variable allTransitions, is time.
allTransitions=busTransition(myBus "0b11" "0b00" 0 'time)
=> srrWave:0x31451030
The following example plots the waveform represented by allTransitions.
awvPlotWaveform(
awvGetCurrentWindow()
list(allTransitions)
?expr list("busTransitionTime")
?color list("y12")
?lineStyle list("dot")
?lineThickness list("thick")
?showSymbols list(t)
?dataSymbol list("x")
)
=> t

The following example returns all x-axis values at which the bus myBus transitions from binary value 0b11 (3decimal) to binary value 0b00 (0decimal) because n=0.
Note that the x-axis unit of the resulting waveform, which is stored in a variable allTransitionsC, is cycle.
allTransitionsC=busTransition(myBus "0b11" "0b00" 0 'cycle)
=> srrWave:0x31451040
The following example plots the waveform represented by allTransitionsC.
awvPlotWaveform(
awvGetCurrentWindow()
list(allTransitionsC)
?expr list("busTransitionTime")
?color list("y12")
?lineStyle list("dot")
?lineThickness list("thick")
?showSymbols list(t)
?dataSymbol list("O")
)
=> t

Return to top