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 the
    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 3
(3,678 Views)
Sorry for the 2 previous posting, Somehow I must have press tab and press submit post every time I tapped enter...
Any how... Is any body else has encounter the same problem?
0 Kudos
Message 2 of 3
(3,673 Views)
You know what... my mistake.... The device I have, for some reason, does not work... sorry for all the troubles... (strange though that It works with explicit messages)
0 Kudos
Message 3 of 3
(3,666 Views)