Basic Structure -
For each chirp that is done by the DSM, the controlling program should adhere to the following structure:
- Hardware Intialization
- Signature Intialization
- Control Settings
- Pre-Waveform User Page Selection
- Waveform Parameters
- Download Data
- Pre-Memory Start User Page Selection
- Start Memory
- Stop Memory (optional)
Hardware Initialization
The initialization of the DSM board only needs to be done once in a program. Initialization must be done first before all other steps and you must follow the order as prescribed below:
- First you should find out how many DSM boards are connected by reading the number property in the DSM_Group_API class.
- Then call the get_sn member function in the DSM_Group_API class to get the board Series Number.
- The next step is the most important step in the entire DSM program writing process: after you have instantiated a DSMX object, you must initialize it by calling the ini with the board Series Number as argument. Simply having an DSMX object without calling the ini method will cause your program to fail.
- After initializing the DSMX instance, you should read the module_id_number to ensure that the hardware matches with the software that you will be writing for it.
Always call the ini function immediately after instantiating a DSMX object!
Signature Initialization
- You will now need to initialize the signature file so that the hardware will operate correctly at a specified frequency. To do this, call the signature_ini method if your signature file is located in the same folder as your program executable. If the signature file is in a different folder, then you will need to call the signature_ini_dir method and pass the folder location in as the argument.
- To complete signature intialization, you will need to set the Clock_Frequency property so that it matches with your input clock to the DSM. When you write to this property, the correct signature settings will be downloaded to the board.
Control Settings
Control settings will determine how a waveform will be output as opposed to what the waveform contents are as defined in the waveform defintion parameters. The order of the settings does not matter.
| Loop Count: | loop_count |
| Memory Depth | memory_depth |
| Phase Reset by Memory Enable/Disable: | dds_reset_by_memory |
Optional: |
|
| Slave Mode: | slave_mode |
Please note that if you did not purchase the multi-module option, then you cannot set your module to Slave mode. By default, Slave mode is disabled and therefore you do not need to set it if you want to operate in Master mode.
Pre-Waveform User Page Selection
Before defining the waveform parameters, you will need to specify which user page to download the parameters. You can specify which user page you want by setting the user_page property.
Waveform Parameters
There are three ways you can set up your waveforms. The easiest way is to just define waveform parameters using the built-in waveform properties:
| Built-In Waveform Parameters | Implementation |
| Start frequency: | chirp1 |
| Stop frequency: | chirp2 |
| Step frequency: | chirp3 |
| Waveform code: | code |
| Delay | delay |
When we talk about the "built-in waveform" we are referring to a waveform that was constructed using these five parameters.
The second way to define a waveform is to use the
user_define_bulk function.
The final way to define a waveform is to use the
user_define_file function.
Whether you use the built-in waveform generator or one of the User-Defined methods, you must always set the
data_length of the waveform.
| Mandatory Parameter | Implementation |
| Data Length | data_length |
Finally, there are a few optional parameters that may be useful for your waveform.
| Optional Parameters | Implementation |
| Marker Enable: | marker_enabled |
| Marker Polarity: | marker_polarity |
| Marker Start: | marker_start |
| Marker Width: | marker_width |
| Phase Reset Time 1 | RESET_T1 |
| Phase Reset Time 2 | RESET_T2 |
| Phase Reset Time 3 | RESET_T3 |
Download Data
The next step is to download all of the information stored in the computer memory to the memory on the DSM. To do this for the built-in waveform you should use the download method.
For the User-Defined functions, whenever the functions are called the data is automatically downloaded to the DSM memory.
Pre-Memory Start User Page Selection
Before starting waveform output or arming the board, you will need to specify again your desired user page. You can specify which user page you want by setting the user_page property.
Start Memory
When in Free Run mode, start the memory by using the restart method.
For Master mode, use the arm method to arm the board. When armed, the Master board will wait for the trigger signal then start the memory.
For Slave mode, use the slave_mode property to arm the board. When armed, the Slave board will wait for the trigger signal then start the memory.
Stop Memory (optional)
In the absence of a stop command, the DSM will continue to chirp until the power is shut off. If you want to stop the DSM memory use the stop method.