Configuring a Trigger with a P2P Stream
- Updated2023-09-20
- 3 minute(s) read
Configuring a Trigger with a P2P Stream
NI 5160/5162 supports the following modes of P2P which you can select using the Stream Relative To property:
- Start Trigger
- Reference Trigger
- Sync Trigger
Start Trigger
In Start Trigger mode, all data is streamed from the start trigger until the end of post-reference trigger sampling. This mode is same as the P2P streaming behavior of the NI 5122/5622. Depending on the type of trigger configured for the acquisition, data is not written to the P2P endpoints in the same way as it is written to onboard memory.
Immediate Trigger
Because of differences in the data path leading to the P2P endpoints and the onboard memory, the first sample written to the P2P endpoints is from an earlier time than the first sample written to onboard memory.
All data written to the P2P endpoints is valid, but the samples are not aligned with the same record stored in onboard memory.
Configured Reference Trigger
While streaming relative to Start, when the trigger type is anything other than immediate, the digitizer sends all data between the Start trigger and the End of Record event to the endpoint.
Reference Trigger
In Reference Trigger mode, only pre-reference trigger and post-reference trigger samples are streamed relative to the reference trigger. In this mode, data that would be fetched from memory is streamed over P2P. The amount of data streamed per record can be determined by reading the P2P Samples Transferred Per Record attribute.
In a multi-record acquisition, the NI 5160/5162 sends data records continuously to the peer. For example, if a user requests three records, 1000 samples, and a 50% reference position, the NI 5160/5162 will transfer 3000 samples. Each record will be 1000 samples long, with 500 pre-reference trigger and 500 post-reference trigger samples. In this example, record 0 is samples 1 to 1000, record 1 is samples 1001 to 2000, and record 3 is samples 2001 to 3000.
Sync Trigger
In Sync Trigger mode, pre-reference trigger and post-reference trigger samples are streamed relative to the sync trigger, but extra pre-reference trigger samples are added to account for the variability in trigger position with TClk. You must use the Sync Trigger mode with TClk to synchronize data across multiple boards. The amount of data streamed per record can be determined by reading the P2P Samples Transferred Per Record attribute. The “Reference to Sync Delay” time value can vary between 1 and 2 TClk periods which means that 2 TClk periods of pre-reference trigger samples are added to every streamed record to prevent missing pre-reference trigger samples.