documentation for AdiCmdServerClient for Matlab

Hi,
I'm using EVAL-TPG-ZYNQ3 with ADRV9008-2 and ADRV9008-1.

When using TES software, everything is fine.

Also when I export the initialization Matlab script, this script runs on Matlab with no issue.

But I would like to transmit and receive data using matlab and not TES.

where can I find AdiCmdServerClient documentation, since the communication between Matlab and and FPGA is done through this library.

I coudn't use "adi.ADRV9009.Tx" since It doesn't support my Matlab version (2016b)

thanks.

  • 0
    •  Analog Employees 
    on Nov 12, 2020 8:22 AM 5 months ago

    Moving to Linux forum.

  • I don't know why moving to Linux forum.

    TES and Matlab run on windows, and AdiCmdServerClient that I'm talking about is a Matlab System Object.

    The TES autogenerated Matlab code is the following :

    %Make DLL visible to matlab
    NET.addAssembly('C:\Program Files (x86)\Analog Devices\ADRV9009 Transceiver Evaluation Software\AdiCmdServerClient.dll');            
                
    Link = AdiCmdServerClient.AdiCommandServerClient.Instance;
    status = Link.hw.Connect('192.168.1.10', 55555);
    if status == 1
        fprintf('Connected to Zync\n');
    else
        fprintf('Unable to connect to Zync platform\n');
    end
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % % GUI Version: 3.5.0.11		DLL Version: 3.5.0.2	FPGA Version: 4E00021A	ArmVersion: 5.0.3 Build type = TAL_ARM_BUILD_RELEASE	StreamVersion: 2.16
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Link.FpgaTalise.StopTxData();
    Link.Ad9528.InitDeviceDataStructure(122880000, 30720000, 122880000);
    Link.Ad9528.ResetDevice();
    Link.Ad9528.Initialize();
    pause(0.5);
    arePllsLocked = Link.Ad9528.WaitForPllLock();
    fprintf('Ad9528 arePllsLocked = %d\n', arePllsLocked);
    
    Link.Ad9528.EnableClockOutputs(hex2dec('300A'));
    Link.SetSpiChannel(1);
    Link.FpgaTalise.ResetFpgaRegisters();
    Link.FpgaTalise.ResetFpgaIp(AdiCmdServerClient.FpgaResets.ClearAllRst);
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Init Structures
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Link.Talise.InitClearProfiles();
    Link.Talise.InitClocks(1, 122880, 9830400, 2, AdiCmdServerClient.HsDiv.HsDiv2p5);
    Link.Talise.InitRfPllUseExternalLo(1, 0);
    Link.Talise.InitTxProfiles(1, 1, 1, 2, 2, 2, 1, 245760, 100000000, 225000000, 225000, 113000, [212, 140, 175, 90, 1280, 699, 1304, 59, 1343, 33, 913, 27, 48, 48, 34, 192, 0, 0, 0, 0, 48, 0, 7, 6, 42, 0, 7, 6, 42, 0, 25, 27, 0, 0, 25, 27, 0, 0, 165, 44, 31, 905]);
    Link.Talise.InitFirFilters(1, AdiCmdServerClient.FilterName.Tx, 'C:\Program Files (x86)\Analog Devices\ADRV9009 Transceiver Evaluation Software\Resources\DigitalFilters\TxPFIRApp110_IR245p76_BW225_PriSigBW100.ftr');
    Link.Talise.InitTxSettings(1, AdiCmdServerClient.TxAttenStepSize.TxAtten0P05DB, AdiCmdServerClient.TxChannel.Tx1, 41950, 0, AdiCmdServerClient.DeframerSelect.DeframerB, AdiCmdServerClient.TxDataIfPllUnlock.TxRampedDownToZero);
    Link.Talise.InitObsProfiles(1, 1, 4, 2, 245760, 200000000, 225000, [185, 141, 172, 90, 1280, 942, 1332, 90, 1368, 46, 1016, 19, 48, 48, 37, 208, 0, 0, 0, 0, 52, 0, 7, 6, 42, 0, 7, 6, 42, 0, 25, 27, 0, 0, 25, 27, 0, 0, 165, 44, 31, 905],[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],AdiCmdServerClient.OrxDdcMode.OrxDdcDisabled, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
    Link.Talise.InitFirFilters(1, AdiCmdServerClient.FilterName.ORx, 'C:\Program Files (x86)\Analog Devices\ADRV9009 Transceiver Evaluation Software\Resources\DigitalFilters\ORxPFIRApp307_BW200_ADC1966p08_OR245p76.ftr');
    Link.Talise.InitObsRxSettings(1, AdiCmdServerClient.ObsRxChannel.ObsRx1, AdiCmdServerClient.ObsRxLoSource.RfPll, AdiCmdServerClient.FramerSelect.FramerA);
    Link.Talise.InitRfPllEnablePhaseSync(1, AdiCmdServerClient.RfPllMcs.InitAndContTrack);
    Link.Talise.InitRxNcoShiftCfg(1, 0, 0, 0, 0, 0, 0, 0, 0);
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Init Jesd
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Link.Talise.InitJesd204bFramer(1, AdiCmdServerClient.FramerSelect.FramerA, 0, 0, 0, 2, 32, 4, 16, 1, 1, 1, 228, 31, 0, 0, 0, 1, 0, 0);
    Link.FpgaTalise.SetupTxConvXbar(AdiCmdServerClient.FpgaFramerSelect.FramerA, hex2dec('E4'));
    Link.FpgaTalise.SetupTxConvXbar(AdiCmdServerClient.FpgaFramerSelect.FramerB, hex2dec('E4'));
    Link.GetPcbDescript();
    Link.Talise.InitJesd204bDeframer(1, AdiCmdServerClient.DeframerSelect.DeframerB, 0, 0, 0, 2, 32, 1, 1, 1, 228, 17, 0, 1, 16, 1, 0, 0, 0, 0);
    Link.FpgaTalise.ResetFpgaIp(AdiCmdServerClient.FpgaResets.TxJesdRst);
    pause(0.5);
    Link.FpgaTalise.ResetFpgaIp(AdiCmdServerClient.FpgaResets.ClearAllRst);
    Link.FpgaTalise.SetupJesd204(122880, 0, 0, 0, 32, 1, 0, 0, 245760, 2, 1, 32, 1, 16, 245760, 2, 1, 32, 1, 1, 16, AdiCmdServerClient.FpgaFramerSelect.FramerB, AdiCmdServerClient.FpgaDeframerSelect.DeframerA, AdiCmdServerClient.FpgaDeframerSelect.DeframerA, false);
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Program Talise
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Link.Talise.ResetDevice();
    Link.Talise.Initialize();
    Link.Talise.SetDacFullScale(AdiCmdServerClient.DacFullScale.DacFs0dB);
    pllStatus = Link.Talise.GetPllsLockStatus();
    fprintf('Talise pllStatus = %d\n', pllStatus);
    Link.Talise.EnableMultichipSync(hex2dec('1'), hex2dec('0'));
    Link.Ad9528.RequestSysref(1);
    Link.Ad9528.RequestSysref(1);
    Link.Ad9528.RequestSysref(1);
    pause(0.1);
    mcsStatus = Link.Talise.EnableMultichipSync(hex2dec('0'), hex2dec('0'));
    fprintf('MCS Status = %d\n', mcsStatus);
    
    Link.FpgaTalise.SetupJesd204bOversampler(AdiCmdServerClient.FpgaDeframerSelect.DeframerB, AdiCmdServerClient.FpgaSampleDecimation.DecimateBy1);
    Link.SetLogLevel(0);
    if pllStatus && 1
    	Link.Talise.InitArm();
    	Link.Talise.LoadStreamProcessor('C:\Users\Fadi\AppData\Local\Temp\TaliseStream.bin');
    	Link.Talise.LoadArm('C:\Program Files (x86)\Analog Devices\ADRV9009 Transceiver Evaluation Software\Resources\arm_firmware\TaliseTxArmFirmware.bin');
    	isArmGood = Link.Talise.VerifyArmChecksum();
    	fprintf('isArmGood = %d\n', isArmGood);
    	if isArmGood && 1
    		fprintf('ARM Loaded Successfully\n');
    	else
    		fprintf('ARM File not loaded correctly\n');
    	end
    else
    	fprintf('ARM File not loaded correctly\n');
    end
    Link.Talise.GetArmVersion();
    Link.SetLogLevel(63);
    Link.Talise.SetPllLoopFilter(AdiCmdServerClient.PllName.RfPll, 50, 3);
    Link.Talise.SetRfPllFrequency(AdiCmdServerClient.PllName.RfPll, 1800000000);
    pllStatus = Link.Talise.GetPllsLockStatus();
    fprintf('Talise pllStatus = %d\n', pllStatus);
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % InitCals
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Link.Talise.AbortInitCals(0);
    %initCalMask = 0
    %initCalMask |= int(Link.Talise.CalMask.TxBaseBandFilter);
    %initCalMask |= int(Link.Talise.CalMask.AdcTuner);
    %initCalMask |= int(Link.Talise.CalMask.Tia3dBCorner);
    %initCalMask |= int(Link.Talise.CalMask.DcOffset);
    %initCalMask |= int(Link.Talise.CalMask.FlashCal);
    %initCalMask |= int(Link.Talise.CalMask.PathDelay);
    %initCalMask |= int(Link.Talise.CalMask.TxLoLeakageInternal);
    %initCalMask |= int(Link.Talise.CalMask.TxQecInit);
    %initCalMask |= int(Link.Talise.CalMask.LoopbackRxLoDelay);
    %initCalMask |= int(Link.Talise.CalMask.LoopbackRxRxQecInit);
    %initCalMask |= int(Link.Talise.CalMask.ORxQecInit);
    %initCalMask |= int(Link.Talise.CalMask.TxDac);
    Link.Talise.RunInitCals(hex2dec('61DCF'));
    Link.Talise.WaitInitCals(60000, 0);
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Framer/Deframer
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Link.FpgaTalise.EnableJesd204bFramer(AdiCmdServerClient.FpgaFramerSelect.DisableAll);
    Link.FpgaTalise.ResetFpgaIp(AdiCmdServerClient.FpgaResets.TxJesdRst);
    Link.FpgaTalise.ResetFpgaIp(AdiCmdServerClient.FpgaResets.ClearAllRst);
    Link.FpgaTalise.EnableJesd204bFramer(AdiCmdServerClient.FpgaFramerSelect.FramerB);
    Link.Talise.EnableDeframerLink(AdiCmdServerClient.DeframerSelect.DeframerB, 0);
    Link.Talise.EnableDeframerLink(AdiCmdServerClient.DeframerSelect.DeframerB, 1);
    Link.Talise.EnableSysrefToDeframer(AdiCmdServerClient.DeframerSelect.DeframerB, 1);
    Link.FpgaTalise.EnableJesd204bDeframer(AdiCmdServerClient.FpgaDeframerSelect.DisableAll);
    Link.Talise.EnableFramerTestData(AdiCmdServerClient.FramerSelect.FramerA, AdiCmdServerClient.FramerDataSource.FtdAdcData, AdiCmdServerClient.FramerInjectPoint.FtdFramerInput);
    Link.Talise.EnableFramerTestData(AdiCmdServerClient.FramerSelect.FramerB, AdiCmdServerClient.FramerDataSource.FtdAdcData, AdiCmdServerClient.FramerInjectPoint.FtdFramerInput);
    Link.FpgaTalise.ResetFpgaIp(AdiCmdServerClient.FpgaResets.ClearAllRst);
    Link.FpgaTalise.ResetFpgaIp(AdiCmdServerClient.FpgaResets.RxJesdRst);
    Link.FpgaTalise.ResetFpgaIp(AdiCmdServerClient.FpgaResets.ClearAllRst);
    Link.FpgaTalise.EnableJesd204bDeframer(AdiCmdServerClient.FpgaDeframerSelect.DeframerA);
    Link.Talise.EnableFramerLink(AdiCmdServerClient.FramerSelect.FramerA, 0);
    Link.Talise.EnableFramerLink(AdiCmdServerClient.FramerSelect.FramerA, 1);
    Link.Talise.EnableSysrefToFramer(AdiCmdServerClient.FramerSelect.FramerA, 1);
    Link.Ad9528.RequestSysref(1);
    Link.Talise.ReadFramerStatus(AdiCmdServerClient.FramerSelect.FramerA);
    Link.Talise.ReadDeframerStatus(AdiCmdServerClient.DeframerSelect.DeframerB);
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Tracking Cals
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    pause(1);
    %trackingCalMask = 0
    Link.Talise.EnableTrackingCals(0);
    Link.Talise.SetObsRxManualGain(AdiCmdServerClient.ObsRxChannel.ObsRx1, 255);
    Link.Talise.SetObsRxManualGain(AdiCmdServerClient.ObsRxChannel.ObsRx2, 255);
    Link.Talise.SetTxAttenuation(AdiCmdServerClient.TxChannel.Tx1, 21.95);
    Link.Talise.SetTxAttenuation(AdiCmdServerClient.TxChannel.Tx2, 20);
    
    Link.hw.Disconnect();

  • The mentioned auto-generated code configures everything for me.

    I would like to know how to transmit a custom user waveform and transfer the received data to Matlab using the same library.

    When I search in documentation, I find only docs about "adi.ADRV9009.Tx" that supports only matlab 2019a and earlier.

    Can I transmit/receive using the library used in the previous code.

  • 0
    •  Analog Employees 
    on Nov 13, 2020 6:01 PM 5 months ago in reply to Geniant

    Moving back to TES forum. The Transceiver Toolbox does not support TES. You will have to use the generated code.

    -Travis

  • 0
    •  Analog Employees 
    on Feb 9, 2021 10:43 AM 2 months ago in reply to travisfcollins

    Please refer to the attached Rx data capture and Load Tx data ironpython script. 

    You can to adapt this script  and develop for Matlab.

    LoadTxDataFile.zip

    rxDataCapture.zip