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

ikram khan
ikram khan 2013년 4월 1일
it is my final year project, any one help
Kaustubha Govind
Kaustubha Govind 2013년 4월 1일
You may want to look at the documentation for Call .NET Methods With ref Keyword.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Communications Toolbox에 대해 자세히 알아보기

제품

태그

질문:

2013년 3월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by