Configuring a Peer-to-Peer Endpoint
- Updated2023-10-16
- 2 minute(s) read
Configuring a Peer-to-Peer Endpoint
Any NI-FGEN property that is associated with an instance of an endpoint is an endpoint-based property; much like the Gain property is channel-based because it is associated with a specific channel number. The syntax FIFOEndpoint N is used to tell NI-FGEN which signal generator endpoint is being specified, where N is an integer starting with 0. If the signal generator supports multiple endpoints, the first is FIFOEndpoint0, the second is FIFOEndpoint1, and so on. Set the Active Channel property using this string when configuring endpoint-based properties. To determine how many endpoints your signal generator supports, query the Endpoint Count property. Use the Destination Channels property to specify which channel(s) receives the endpoint data.
FIFOEndpointN Destination Channels | Channel List |
---|---|
Channel 0 | 0 |
Channel 1 | 1 |
Channel 0 and Channel 1 (interleaved) | 0, 1 |
For devices that support multiple endpoints, physical channels cannot be contained within the destination channels for multiple endpoints.
To use NI-P2P in NI-FGEN, configure the signal generator to use Script output mode. Use the script command stream n, where n is an integer number of samples to stream from an endpoint to the channels specified by the Destination Channels property.
The following figure shows an NI-FGEN session configured to stream 10,240 samples received at FIFO endpoint 0 to channel 0.

To stream continuously until the generation is aborted from the host or by a peer, create a script that nests the stream n command in a repeat forever loop, as shown in the following script code.
Script myScript repeat forever stream 10240 end repeat end script
Refer to Stopping a Peer-to-Peer Generation for information about stopping this generation.