SonixDAQ Software (SDK)

Introduction
As mentioned before DAQ is only a receive module and has not control over the transmit. The DAQ SDK uses Texo SDK in order to provide full control over the transmit. This way the transmit sequence can be customized using the Texo and the corresponding pre-beamformed channel data can be received using the DAQ.

Initialization
The DAQ SDK is very similar to the Texo SDK. First, both DAQ and Texo need to be initialized. For proper initialization of the Texo refer to Texo SDK. The following code initializes the DAQ. The code first checks to see if DAQ is connected or not. If connected the software checks to see if the DAQ has already been programmed. If this is the case the software will skip the programming. Otherwise will start the programming.

For proper initialization of the DAQ make sure DAQ_FIRMWARE_PATH is referring to the correct path for the DAQ firmware

#define DAQ_FIRMWARE_PATH "D:\\mydaq\\fw\\" 

Note: Inside the fw folder there are different folders for different versions of the DAQ. The software will automatically use the correct folder. Thus, sub folders should not be included in the firmware path.

The variable sampling_80MHz tells the DAQ either to load the 80MHz sampling bitstream or original 40MHz sampling bitstream. To see this better, if you check the firmware folder you can see there are two bitsreams one called daqrx.bit and the other called daqrx80.bit.


 * sampling_80MHz = true, the DAQ will load 80MHz sampling bitstream.
 * sampling_80MHz = false, the DAQ will load 40MHz sampling bitstream.

daq = sonixdaq::getInstance; if (!daq->isConnected) {       printf("DAQ not connected or off\n"); scanf("%c", &sel); return -1; }   else {       printf("is connected ... "); }

if (!daq->isInitialized) {       daq->setFirmwarePath(DAQ_FIRMWARE_PATH); printf("Programming ... "); if (!daq->init(sampling_80MHz)) {           printf(daq->getLastError.c_str); scanf("%c", &sel); return -1; }       printf("Done\n\n"); }

The following two steps will finalize the initialization. Firs,

tex.setSyncSignals(0, 1, 3);

The first line sets up the synchronization pulses for BNC cables. The inputs for setSyncSignals are as follows

tex.setSyncSignals(input trigger, 1st output trigger, 2nd output trigger)

The above setting sets the Sonix to send line Trigger (i.e. 1) to the first BNC output and 40MHz clock (i.e. 3) to the second BNC output. For further information refer to Texo SDK.

Note: Clock output is only available on the SonixTouch and Upgraded SonixRP systems.

Assuming that the DAQ is connected to the lower probe connector i.e. 3, the second step is to open this connector so that it can listen to the same echoes that are coming back from the transducer simultaneously

tex.forceConnector(3);

Loading a Sequence
After initialization, a probe need to be selected and a transmit sequence need to be loaded into the hardware. These steps are very similar to programming Texo SDK. Some custom transmit sequences are provided as examples. These include fixed plane wave transmit and transmits with sliding aperture.

Running The Sequence for Data Collection
Once you trigger run function, both Texo and DAQ will start the data collection simultaneously. For each transmit, Texo will collect one beamformed scan line and DAQ will collect pre-beamformed channel data corresponding to the same transmit.

Saving Data
Following data collection you can save the data. Once you enter the folder name, the DAQ data will be recorded in the following address:

D:\\DAQDATA\\myfolder

The corresponding texo data will also be recorded in the same folder with the name data.txo.

DAQ Parameters
The followings are the DAQ parameters that can be programmed in the DAQ SDK. The parameter corresponds the same settings that are provided in the DAQ control software

rlprms.lineDuration = 110; // line duration in micro seconds rlprms.numSamples = 4000 / (1 + rlprms.decimation); // assuming 3000 samples at 40MHz

seqprms.freeRun = false; seqprms.hpfBypass = false; seqprms.divisor = 10; // data size = 16GB / 2^divisor seqprms.externalTrigger = true; seqprms.externalClock = false; // set to true if external clock is provided seqprms.lnaGain = 1; // 16dB, 18dB, 21dB seqprms.pgaGain = 1; // 21dB, 24dB, 27dB, 30dB seqprms.biasCurrent = 1; // 0,1,2,...,7 ...

Acquisition Parameters

 * lineDuration: acquisition time, this value is in micro seconds
 * numSamples: number of samples to be acquired from each channel
 * freeRun: which sets the DAQ to acquire continuously or stop after defined acquisition data size.
 * hpfBypass: to by pass the digital high pass filter or not.
 * divisor: defines the size of data to be acquired i.e. dataSize = 16GB / 2^divisor
 * externalTrigger: defines whether the DAQ should listen to the external sync signal or not. To have synchronized data, this parameter has to be true. Otherwise, the acquisition of the DAQ will not be in sync with transmit.
 * externalClock: defines whether the DAQ should use the external clock or use its own internal clock. Set this to false if external clock is not provided.

Gain Parameters

 * lnaGain: LNA gain [0:1:2] corresponds to [16dB, 18dB, 21dB].
 * pgaGain: PGA gain [0:1:3] corresponds to [21dB, 24dB, 27dB, 30dB].
 * biasCurrent: switch gain [0:1:7] where 0 completely turns off the switch.

TGC Parameters

 * fixedTGC: defines whether the DAQ should use flat TGC or adjustable TGC.
 * fixedTGCLevel: [0:1:100] fixed TGC value.
 * TGCcurve: is defines by 3 points with X, Y values ranging from 0 to 1 where 1 corresponds to maximum value for Y and maximum depth for X.

if (seqprms.fixedTGC) {       seqprms.fixedTGCLevel = 100; }   else {       // set TGC curve tgc.setX(0, 0.0f); tgc.setX(1, 0.5f); tgc.setX(2, 0.8f);

tgc.setY(0, 1.0f); tgc.setY(1, 1.0f); tgc.setY(2, 1.0f); }

Sampling Frequency
The following two parameters control the sampling frequency of the DAQ data: sampling, decimation. Setting the boolean variable parameters sampling_80MHz will take care of sampling frequency in the code as follows:

// sampling and decimation if (sampling_80MHz) {       rlprms.sampling = 80;   // DAQ sampling frequency 80 -> 80 [MHz] rlprms.decimation = 0; // no decimation for 80MHz sampling }   else {       rlprms.sampling = 40;   // DAQ sampling frequency 40 -> 40 [MHz] rlprms.decimation = 0; // Fs = sampling / (1+decimation) e.g. decimation = 1 -> Fs=20 MHz }