Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT_SendBurstTransfer dll command

Rank

Total Posts: 8

Joined 2012-11-16

PM

I'm having a problem with ANT_SendBurstTransfer comman.
I call it passing an array or 128 byte ,so 16 packets of 8 bytes.
My code (delphi) is very simple :
cont:= length(burst)
ANT_SendBurstTransfer(0,burst,Round(cont/8)); 

But the dll send always a lot of burst packets filled by 0. I seems to ignore
the number of packets I put in the second argument.

Here an antware log:
Received BURST_DATA_0x50
:: 50, 00-12-00-80-C2-80-00-02-00
Received BURST_DATA_0x50
:: 50, 20-02-02-D2-D3-23-02-F2-40
Received BURST_DATA_0x50
:: 50, 40-1E-00-D0-1C-C2-93-D0-1C
Received BURST_DATA_0x50
:: 50, 60-FD-23-F2-F0-FE-FF-23-02
Received BURST_DATA_0x50
:: 50, 20-5B-43-5F-42-6F-1C-4F-93
Received BURST_DATA_0x50
:: 50, 40-07-24-7F-90-0A-00-2A-24
Received BURST_DATA_0x50
:: 50, 60-7F-90-0C-00-9B-20-3C-3C
Received BURST_DATA_0x50
:: 50, 20-5E-42-C9-1C-4E-9F-04-24
Received BURST_DATA_0x50
:: 50, 40-F2-40-0A-00-6F-1C-ED-3F
Received BURST_DATA_0x50
:: 50, 60-5F-42-CB-1C-4F-9E-E9-23
Received BURST_DATA_0x50
:: 50, 20-C2-9F-DB-1C-04-24-C2-4F
Received BURST_DATA_0x50
:: 50, 40-DB-1C-B0-12-B0-C7-B0-12
Received BURST_DATA_0x50
:: 50, 60-14-C8-5F-42-D2-1C-4B-9F
Received BURST_DATA_0x50
:: 50, 20-08-2C-C2-43-D2-1C-B2-D0
Received BURST_DATA_0x50
:: 50, 40-10-00-00-07-B2-D0-03-00
Received BURST_DATA_0x50
:: 50, 60-00-07-B0-12-FE-D5-B0-12
Received BURST_DATA_0x50
:: 50, 20-50-D0-CF-3F-C2-93-DB-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 20-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 40-00-00-00-00-00-00-00-00
Received BURST_DATA_0x50
:: 50, 60-00-00-00-00-00-00-00-00
[/size]

Please help me!!

Thank you.
     
RankRankRankRank

Total Posts: 156

Joined 2013-01-07

PM

Hi,

Could you verify that the arguments being passed to the dll through delphi are the correct size?

Also, is the content of the first 16 bytes correct?
     
Rank

Total Posts: 8

Joined 2012-11-16

PM

Hi,
thank you for the fast reply.

Yes, the packet counter is a word ( 16 bit unsigned) .      
RankRankRankRank

Total Posts: 156

Joined 2013-01-07

PM

Hi,

I tried running the ANT_SendBurstTransfer using the DEMO_DLL project available in the ANT_Libraries solution and it runs fine.

If I run the demo code:
{
            
// Send Burst Data (10 packets)
            
UCHAR aucTempBuffer[8*10];
            
            for (
int i 08*10i++)
               
aucTempBuffer[i] i;   
            
            
ANT_SendBurstTransfer(USER_ANTCHANNELaucTempBuffer10);
            break;


The slave receives:

Received BURST_DATA_0x50
  
:: 5000-00-01-02-03-04-05-06-07
Received BURST_DATA_0x50
  
:: 5020-08-09-0A-0B-0C-0D-0E-0F
Received BURST_DATA_0x50
  
:: 5040-10-11-12-13-14-15-16-17
Received BURST_DATA_0x50
  
:: 5060-18-19-1A-1B-1C-1D-1E-1F
Received BURST_DATA_0x50
  
:: 5020-20-21-22-23-24-25-26-27
Received BURST_DATA_0x50
  
:: 5040-28-29-2A-2B-2C-2D-2E-2F
Received BURST_DATA_0x50
  
:: 5060-30-31-32-33-34-35-36-37
Received BURST_DATA_0x50
  
:: 5020-38-39-3A-3B-3C-3D-3E-3F
Received BURST_DATA_0x50
  
:: 5040-40-41-42-43-44-45-46-47
Received BURST_DATA_0x50
  
:: 50E0-48-49-4A-4B-4C-4D-4E-4F 


I would try printing out your arguments before you call ANT_SendBurstTransfer() to make sure they are the correct values you assume.

Also, I noticed you receive 17 packets of non-zero burst data. Do the first 16 bytes have the correct information?. I am not sure how delphi initialises arrays or passes them to C, I would try to verify the data in the array passed to the dll by printing it.

     
Rank

Total Posts: 8

Joined 2012-11-16

PM

Hi,

we fixed the problem importing the DLL function using this signature:

type
  UCHAR 
byte;
  
pUCHAR = ^byte;

....
....
Procedure ANT_SendBurstTransfer(ucChannelUCHARpucDataPUCHARusNumDataPacketsUSHORT);
cdeclexternal 'ANT_DLL'


Then the array passed must be a static array.

With this indication the burst comunication works correctly.

Thank you for the support.