Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

wrong IO data buffer when using COS or cyclic

Hello All,
 
I am using CVI 7.0 for DeviceNet communication with or device...
 
I have a problem with ReadIO with COS or Cyclic...
It works perfectly when I open a polled IO connection, the data buffer retrieved correspond to my selected assembly...
If I open a COS or Cyclic IO, the Data buffer is giving me random number... If I explicitly read the proper Epath through the Assembly Object, the buffer looks fine...
 
This is the code that I use to get the proper data
 
    NCTYPE_UINT8 locServiceCode = 0;
    NCTYPE_UINT8 locServiceData[ 80 ];                                                                                                                            
    NCTYPE_UINT8 * locpServiceDataPointer = locServiceData;                                                                                                         
    NCTYPE_UINT16 locActualServiceDataLength = 0;
    NCTYPE_UINT16 locProduceInstance = 0;    
    
// Read
    if (glConnType == eCOS)
    {
     GetAttributeSingle(GetGlobalDeviceHandle(), eCONNNECTION_ID, 1, 102, &locProduceInstance);
    }
    else
    {
     GetAttributeSingle(GetGlobalDeviceHandle(), eCONNNECTION_ID, 1, 104, &locProduceInstance);
    }
    locActualServiceDataLength = 1;
    locServiceData[0] = 0x03;
    locErrorCode = DoService(GetGlobalDeviceHandle(), 0x0E, eASSY_ID, locProduceInstance, &locActualServiceDataLength, locServiceData, sizeof( locServiceData ), locServiceData );
    memcpy(*locpReadIoDataBuff, locServiceData, locActualServiceDataLength);
    }
0 Kudos
Message 1 of 2
(3,145 Views)

this is fixed by the customer, see the link:

 

http://forums.ni.com/ni/board/message?board.id=30&message.id=1510

0 Kudos
Message 2 of 2
(3,108 Views)