Share this page

# RteGenerateDeviceName

Some protocols, such as APPC, require a unique device name for each terminal that logs on to the system. Using the runtime settings, you can specify that the TE_connect function generate a unique 8-character device name for each virtual user, and connect using this name. Although this solves the requirement for uniqueness, some systems have additional requirements, e.g., that the device names must conform to a specific format, or be contained in a specific list.

To define the format of the device names that the TE_connect function uses to connect a script to the system, add an RteGenerateDeviceName function to the script. The function has the following prototype:

void RteGenerateDeviceName(char buf[32])

The device name should be written into buf.

If an RteGenerateDeviceName function exists in a script, the Vuser calls the function each time a new device name is needed. If no RteGenerateDeviceName function is defined in the script—and unique device names are required—the TE_connect function generates the required names.

### Example

In the following example, the RteGenerateDeviceName function generates unique device names with the format "TERMx". The first name is TERM0, followed by TERM0, TERM2, etc.

RteGenerateDeviceName(char buf[32])

{

static int n=0;

sprintf(buf, "TERM%d", n);

n=n+1;

}

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