This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM2434: IO-Link Stack Unable to Write Out Process Data Request

Part Number: AM2434

Tool/software:

Hello,

I am finding myself unable to write out a Process Data request via the SMI API. I've tried both code examples from both the Industrial Com SDK itself as well as from the user guide. Whenever the request is sent out it's returning an error for an invalid ArgBlock Length. Please advise if this code usage is incorrect.

// Allocate ArgBlock Memory
IOLM_SMI_SPDOut *psuReq = malloc(sizeof(IOLM_SMI_SPDOut)); // Pointer to Process Data Output Struct
INT16U u16Length = sizeof(IOLM_SMI_SPDInOut);   // Argument Block Length
INT16U u16Error;                                // Return Error

// Fill Request
psuReq->u16ArgBlockID = IOLM_SMI_ENDIAN_16(IOLM_SMI_eArgBlockID_PDOut); // Big Endian Arg Block ID
psuReq->u8OE = 0x01;    // Output Enabled
psuReq->u8OutputDataLength = 0x02; // Length of Process Data Output is 2 Bytes

// Data
psuReq->au8Data[0] = 0xFF;
psuReq->au8Data[1] = 0x00;

// Method 1 Send and Callback
// Send Out Request
IOLM_SMI_vPDOutReq(IOLM_SMI_CLIENT_APP, portNumber, u16Length, (INT8U*)psuReq);

// Callback
void IOLM_EXMPL_cbPDOutCnf(uint8_t clientID, uint8_t portNumber, uint16_t error)
{
    (void)clientID;

    if (error != IOL_eErrorType_NONE)
    {
        // Returns 0x4034 - IOL_eErrorType_ARGBLOCK_LENGTH_INVALID
        portArray[portNumber].exampleState = IOLM_EXMPL_PortErrorHandler(portNumber, error);
    }
    else
    {
        IOLM_EXMPL_printf("---------------Write Process Data Success-----------------\n");
        portArray[portNumber].exampleState = IOLM_eExampleState_ReadProcessDataValue;
    }
}

// Method 2 Send Out and Confirm
// Send Out Request
u16Error = IOLM_SMI_u16PDOutReqCnf(IOLM_SMI_CLIENT_APP, portNumber, u16Length, (INT8U*)psuReq);
// Confirm
if (u16Error == IOL_eErrorType_NONE)
{
    IOLM_EXMPL_printf("---------------Write Process Data Success-----------------\n");
    portArray[portNumber].exampleState = IOLM_eExampleState_ReadProcessDataValue;
}
else
{
    // Returns 0x4034 - IOL_eErrorType_ARGBLOCK_LENGTH_INVALID
    portArray[portNumber].exampleState = IOLM_EXMPL_PortErrorHandler(portNumber, error);
}

Thank You,

- Joe Pfaltzgraff