Writing a MEG Command File
- Updated2026-02-20
- 3 minute(s) read
Create a TDMS file containing a sequence of MEG commands and specific properties related to the generation of those commands.
Note MEG command TDMS
files must be copied to the PXIe controller or RAID. For optimal performance, copy the files
to the RAID.
NI recommends the following order for TDMS file function calls:
- Open: Creates a reference to the TDMS file that will be
generated.
Use the following calls: TDMS Advanced Open and TDMS Set Channel Information
Figure 26. MEG Command File Open 
- Write Data: Writes the MEG commands in, the array of cluster of
the parameters listed in Multi-Emitter Generation Command (MEG CMD) API
Reference. This function wraps the write so only 512 bytes are written at a time.
The conversion from cluster to bit array follows little-endian, where the least
significant bits are stored at lower locations.
Use the following call: TDMS Advanced Synchronous Write
Figure 27. MEG Command File Write Data 
- Write Properties: Writes the properties required by the TDMS
file.
- scenario length (ms): The latest time at which a pulse finishes playing in the scenario. Indicating a shorter time than the actual scenario duration may cause the application to try to stop sooner than necessary.
- user waveform group name: The name of the user waveform group referenced by the MEG commands. These are the user waveforms that will be loaded into memory for playback. This name must match a waveform group name specified through the User Waveform Group Manager.
- core composition: Use 1, which corresponds to six dynamic cores and two waveform playback cores.
- system bandwidth: Use 1, which corresponds to 2 GHz.
- center frequency: The value, in Hz, for the center frequency used to generate the MEG commands. Note that the MEG Commands play in a relative frequency. When this value is specified incorrectly, the scenario plays, but relative to the incorrect set center frequency.
Use the following call: TDMS Set Properties
Figure 28. MEG Command File Write Properties 
- Close: Safely closes the reference to the TDMS file.
Use the following call: TDMS Advanced Close
