Share this page

# Example: lrs_decimal_to_hex_string

In the following example, the lrs_decimal_to_hex_string function converts an integer into a hexadecimal string. The script displays the value of the HEX string if it is not NULL.

    lrs_send("socket0", "buf3", LrsLastArg);

    lrs_receive("socket0", "buf4", LrsLastArg);

    tmp = lrs_get_received_buffer("socket0", 29, 1, NULL);

        /* translate 4 to \x04 */

    tmp2 = lrs_decimal_to_hex_string("socket0",tmp,1);

    if (NULL != tmp2 && lrs_get_user_buffer_size("socket0") == 4 )

    {

        lr_output_message("tmp2=%s",tmp2);

    }

    lrs_send("socket0", "buf5", LrsLastArg);

    lrs_receive("socket0", "buf6", LrsLastArg);

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: