dll function variable deceleration

hai i am using a ADC with USB to SPI converter(MCP2210). i have loaded the dll of converter into matlab. i can able to configure GPIO,clk of converter etc.
But not able to Receive the data with function TxferSpiData in dll of converter.
but with software provided by microchip(SPI terminal mcp2210.exe) getting the ADC data through Converter. i dont understand how to pass arguments with this function and get data into array.
Data provided by Micochip for dll function TxferSpiData use
Name: TxferSpiData
Purpose: Transfer the specified SPI data
Parameters:
Inputs: dataTx (array<Byte>^) - Array of SPI data to send to device. This array should be at least the same size as numBytes or larger.
Outputs: dataRx (array<Byte>^) Array that contains SPI data received. This array should be at least the same size as numBytes or larger.
Returns: int -
Return value: negative = error
0 = success
*khan=NET.addAssembly('E:\ikram\project\brain machin interface\softwares\usb\MCP2210DLL-M.dll');
khan= MCP2210.DevIO(hex2dec('04D8'),hex2dec('00DE'));
b=buffer(216,27);
c=buffer(216,27);
khan.Functions.TxferSpiData(b,c)*
data is not getting loaded into the variable 'c' buffer, is this deceleration is correct as per the microchip? how to used this function. please Guide me in using this function.
Thanks & Regards Ikram khan

2 Comments

it is my final year project, any one help
You may want to look at the documentation for Call .NET Methods With ref Keyword.

Sign in to comment.

Answers (0)

Categories

Find more on Communications Toolbox in Help Center and File Exchange

Products

Tags

Asked:

on 31 Mar 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!