Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Set_Receive_Type - Setting the receive type

&pagelevel(4)&pagelevel

The Set_Receive_Type (CMSRT) call sets the value for the conversation characteristic receive_type. In receive_type you define whether the Receive and Receive_Mapped_Data calls are to be executed with blocking or without. The call overwrites the value of receive_type which was assigned during the Initialize_Conversation call.

The Set_Receive_Type call is only permitted in one of the following states: “Initialize”, “Send” or “Receive”.

This function is one of the advanced functions.

UPIC local on Unix, Linux and Windows systems:
Local connection via UPIC local does not support the Set_Receive_Type call.

Syntax
CMSRT (conversation_ID, receive_type, return_code)

Parameters

--> conversation_ID

Identifier of the conversation

--> receive_type

Defines whether the following Receive / Receive_Mapped_Data calls are to be executed with blocking or without. You can specify the following values:

  • CM_RECEIVE_AND_WAIT
    The Receive and Receive_Mapped_Data calls have a blocking effect, i.e. if no information is available at the time of the call, the program run waits until information arrives for this conversation. Only then does the program run return from the Receive or
    Receive_Mapped_Data call and transfer the data to the program. If there is information available at the time of the call, the program receives it without waiting. If a maximum wait time (timeout timer) was set with Set_Receive_Timer before the Receive or Receive_Mapped_Data call, the program run returns from the Receive or Receive_Mapped_Data call on expiry of this wait time, even if there is still no information available.

  • CM_RECEIVE_IMMEDIATE
    The Receive and Receive_Mapped_Data calls have a non-blocking effect, i.e. if there is information present at the time of the call, the program receives it without waiting. If there is no information at the time of the call, the program does not wait. The program run returns from the Receive or Receive_Mapped_Data call immediately.

<-- return_code

Result of the function call.

          

Result (return_code)

CM_OK

The call is OK.

CM_PROGRAM_PARAMETER_CHECK

conversation_ID is invalid or the value of receive_type is undefined.

CM_PRODUCT_SPECIFIC_ERROR

The UPIC instance could not be found.

CM_CALL_NOT_SUPPORTED

The function is not supported.

State change

If there are no errors, this function returns the result CM_OK. This call does not change the state of the conversation.

Notes

  • If the return code is not CM_OK, the receive_type characteristic remains unchanged.

  • If Set_Receive_Type is called in the “Start” or “Reset” state, the value transferred in cconversation_ID is always invalid. The return code CM_PROGRAM_PARAMETER_CHECK is then always returned as the result of the call.

Behavior in the event of errors

CM_PROGRAM_PARAMETER_CHECK

Modify program.

CM_PRODUCT_SPECIFIC_ERROR

The operating system cannot provide sufficient memory for the internal buffers. Check whether the memory requirements of your program are too high and if necessary reboot your system.

CM_CALL_NOT_SUPPORTED

This return code only applies to Unix, Linux and Windows systems.
This is not necessarily an error: If the application is intended for both UPIC-L and UPIC-R this return code just means that the application is linked to a UPIC-L library. The program can take note of this return code and avoid making further Set_Receive_Type calls.

Function declaration: Set_Receive_Type
CM_ENTRY Set_Receive_Type ( unsigned char  CM_PTR  conversation_ID,
                           CM_RECEIVE_TYPE CM_PTR  receive_type,
                           CM_RETURN_CODE  CM_PTR  return_code )