setTriggerCondition
Syntax
Description
setTriggerCondition(
configures a trigger value comparison for the signal hub
,signalName
,enable
,signalValue
)name
in trigger
stage 1 for the first data capture IP. hub
is a customized data capture
hub object. The enable
argument indicates whether this signal is part
of the overall trigger condition.
setTriggerCondition(
specifies options using one or more name-value arguments. For example,
hub
,signalName
,enable
,signalValue
,Name=Value
)TriggerStageIndex=2
sets the trigger stage to 2.
Examples
Set Up Trigger Conditions for Multiple Trigger Stages and Data Capture IPs
This example uses a customized data capture hub object,
DC
, that connects with two data capture IPs. The first data capture
IP is datacapture1
and the second data capture IP is
datacapture2
. Each IP defines two signals for both trigger and data
capture. Signal A
is 1 bit and signal B
is 8 bits.
The maximum number of trigger stages is set to 2.
Set number of trigger stages to 2 for both the IPs.
setNumberofTriggerStages(hub,2,DataCaptureName="datacapture1"); setNumberofTriggerStages(hub,2,DataCaptureName="datacapture2");
Set up a trigger condition to capture data when the FPGA detects a high value on
signal A
and a value 17 on signal B
. Set this
condition in trigger stage 1 for the datacapture1
IP.
setTriggerCondition(hub,'A',true,'High'); setTriggerCondition(hub,'B',true,uint8(17));
Set up a trigger condition to capture data when the FPGA detects a high value on
signal A
. Set this condition in trigger stage 2 for the
datacapture1
IP.
setTriggerCondition(hub,'A',true,'High',TriggerStageIndex=2);
Set up a trigger condition to capture data when the FPGA detects a high value on
signal A
. Set this condition in trigger stage 2 for the
datacapture2
IP.
setTriggerCondition(hub,'A',true,'High', ... TriggerStageIndex=2,DataCaptureName="datacapture2");
Input Arguments
hub
— Data capture hub object
dataCaptureHub
object
Data capture hub object that interacts with each data
capture IP, specified as a dataCaptureHub
object.
signalName
— Name of trigger component signal
character vector
Name of trigger component signal, specified as a character vector.
This name must match one of the signal names configured on creation of the data capture IPs. The signal must be configured as a possible trigger signal.
Data Types: char
enable
— Indication that signal is part of trigger condition
true
or 1
| false
or 0
Indication that the signal is part of the trigger condition, specified as a numeric
or logical 1
(true
) or 0
(false
). To use this signal in the overall trigger condition, set
this value to 1
(true
). When you set this value to
0
(false
), the signal is not used for the
overall trigger condition.
signalValue
— Value to compare this signal to as part of the trigger condition
decimal | binary | hexadecimal | 'Low'
| 'High'
| 'Rising edge'
| 'Falling edge'
| 'Both edges'
The trigger condition comprises value comparisons of one or more signals. This input specifies the value to match for each signal.
For a multibit signal, specify a decimal, binary, or a hexadecimal value within the
range of the data type associated with the signal. While providing hexadecimal or binary
values, you can provide values with a combination of X
or
x
(don't care value) to enable bit masking. That means, while
comparing the values, the trigger condition ignores the place values with
X
or x
and provides the output.
To separate a group of bits for better readability, you can use _
between bits. For example, you can represent a 32-bit binary value as
'0b1010_XXXX_1011_XXXX_1110_XXXX_1111XXXX'
and a 32-bit hexadecimal
value as '0xAB_CDEXFX'
.
For logical signals, specify a string that indicates the level or edge to match. For more information, see Triggers.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: setTriggerCondition(hub,'A',true,'High',DataCaptureName="datacapture1");
TriggerStageIndex
— Trigger stage
1
(default) | integer from 1 to M
Trigger stage, specified as an integer from 1 to M, where M is set by the Max trigger stages parameter of the FPGA Data Capture Component Generator tool.
DataCaptureName
— Name of data capture IP
"generatedIPName1"
(default) | character vector | string scalar
Name of the data capture IP, specified as a character vector or string scalar. The
default value for this argument is
"generatedIPName1"
, where
generatedIPName1 is the name of the first data capture IP set by
the Generated IP name parameter of
the FPGA Data Capture Component Generator
tool.
Version History
Introduced in R2024a
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)