|Download Help (Windows Only)|
Using the time when the signal frame is transmitted according to the database, this mode resamples the signal data from a waveform with a fixed sample rate. This mode typically is used for synchronizing XNET data with DAQmx analog/digital output channels.
The resampling translates from the waveform timing to each frame's transmit timing. When the time for the frame to transmit occurs, it uses the most recent signal values in the waveform that correspond to that time.
Use nxWriteSignalWaveform for this mode.
You specify the resample rate using the Resample Rate property.
The frames for this mode are stored in queues.
This mode is not supported for a LIN interface operating as slave. For more information, refer to LIN Frame Timing and Session Mode.
In this example network, frame C is a cyclic frame that transmits on the network once every 2.0 ms. Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2.5 ms. For information about cyclic and event-driven frames, refer to Cyclic and Event Timing.
Each frame contains two signals, one in the first byte and another in the second byte.
The example uses CAN. The following figure shows a timeline of a frame transfer on the CAN network. Each frame contains its name (C or E), followed by the value of its two signals. The timeline begins with a single call to nxWriteSignalWaveform.
The following figure shows the data provided to the call to nxWriteSignalWaveform. The session contains all four signals and uses the default resample rate of 1000.0 samples per second.
Assuming the Auto Start? property uses the default of true, the session starts within the call to nxWriteSignalWaveform. Frame C transmits followed by frame E, both using signal values from the first sample (index 0 of all four Y arrays).
The waveform elements t0 (timestamp of first sample) and dt (time between samples in seconds) are ignored for the call to nxWriteSignalWaveform. Transmit of frames starts as soon as the XNET session starts. The frame properties in the database determine the each frame's transmit time. The session resample rate property determines the time between waveform samples.
In the waveforms, the sample at index 1 occurs at 1.0 ms in the frame timeline. According to the database, frame C transmits once every 2.0 ms, and frame E is limited to an event-driven transmit with interval 2.5 ms. Therefore, the sample at index 1 cannot be resampled to a transmitted frame and is discarded.
Index 2 in the waveforms occurs at 2.0 ms in the frame timeline. Frame C is ready for its next transmit at that time, so signal values 5 and 6 are taken from the first two Y arrays and used for transmit of frame C. Frame E still has not reached its transmit time of 2.5 ms from the previous acknowledgment, so signal values 1 and 2 are discarded.
At index 3, frame E is allowed to transmit again, so signal values 5 and 6 are taken from the last two Y arrays and used for transmit of frame E. Frame C is not ready for its next transmit, so signal values 7 and 8 are discarded.
This behavior continues for Y array indices 4 through 7. For the cyclic frame C, every second sample is used to transmit. For the event-driven frame E, every sample is interpreted as an event, such that every third sample is used to transmit.
Although not shown in the frame timeline, frame C transmits again at 8.0 ms and every 2.0 ms thereafter. Frame C repeats signal values 5 and 6 until the next call to nxWriteSignalWaveform. Because frame E is event driven, it does not transmit after the timeline shown, because no new event has occurred.
Because the waveform timing is fixed, you cannot use it to represent events in the data. When used for event driven frames, the frame transmits as if each sample was an event. This mismatch between frame timing and waveform timing is a disadvantage of the Signal Output Waveform mode.
When you use the Signal Output XY mode, the signal values provided to nxWriteSignalXY are mapped directly to transmitted frames, and no resampling occurs. Unless your application requires correlation of output data with DAQmx waveforms, Signal Output XY is the recommended mode for writing a sequence of signal values.