Synchronize block-mode (IBM) terminals
The TE_wait_sync function is used for synchronization RTE Vusers operating block-mode (IBM) terminals. Block-mode terminals display the "X SYSTEM" message to indicate that the system is in Input Inhibited mode. When a system is in the Input Inhibited mode no typing can take place because the terminal emulator is waiting for a transfer of data from the server.
When you record a script on a block-mode terminal, by default, VuGen generates and inserts a TE_wait_sync function into the script each time the "X SYSTEM" message appears. You use VuGen's recording options to specify whether or not VuGen should automatically insert TE_wait_sync functions.
When you run a Vuser script, the TE_wait_sync function checks if the system is in the X SYSTEM mode. If the system is in the X SYSTEM mode, the TE_wait_sync function suspends script execution. When the "X SYSTEM" message is removed from the screen, script execution continues.
Note: You can use the TE_wait_sync function only with IBM block-mode terminals emulators (5250 and 3270).
In general, the TE_wait_sync function provides adequate synchronization for all block-mode terminal emulators. However, if the TE_wait_sync function is ineffective in a particular situation, you can enhance the synchronization by including a TE_wait_text function. For more information on the TE_wait_text function, see Synchronize character-mode (VT) terminals, and the Function Reference.
In the following script segment, the Vuser logs on with the user name "QUSER" and the password "MYLAB". The Vuser then presses Enter
to submit the login details to the server. The terminal emulator displays the X SYSTEM message while the system waits for the server to respond.
The TE_wait_sync statement causes the Vuser to wait until the server has responded to the login request, that is, for the X SYSTEM message to be removed—before executing the next line of the script.
TE_type("QUSER"); lr_think_time(2); TE_type("<kTab>MYLAB"); lr_think_time(3); TE_type("<kEnter>"); TE_wait_sync(); ....
When a TE_wait_sync function suspends the execution of a script while an X SYSTEM message is displayed, the Vuser continues to monitor the system—waiting for the X SYSTEM message to disappear. If the X SYSTEM message does not disappear before the synchronization timeout expires, the TE_wait_sync function returns an error code. The default timeout is 60 seconds.

-
Select Vuser > Runtime Settings. The runtime settings dialog box appears.
-
Select the RTE:RTE node in the Runtimesetting tree.
-
Under X SYSTEM Synchronization, enter a value (in seconds) in the Timeout box.
-
Click OK to close the runtime settings dialog box.
After a Vuser executes a TE_wait_sync function, the Vuser waits until the terminal is no longer in the X S YSTEM mode . When the terminal returns from the X S YSTEM mode, the Vuser continues to monitor the system for a short period to verify that the terminal is fully stable, that is, that the system does not return to the X S YSTEM mode. Only then does the TE_wait_sync function terminate and allow the Vuser to continue executing its script. The period that the Vuser continues to monitor the system, after the system has returned from the X SYSTEM mode, is known as the stable time. The default stable time is 1000 milliseconds.
You may need to increase the stable time if your system exhibits the following behavior:
When a system returns from the X SYSTEM mode, some systems "flicker" to and from the X SYSTEM for a short period of time until the system stabilizes. If the system remains out of the X SYSTEM mode for more than one second, and then returns to the X SYSTEM mode, the TE_wait_sync function assumes that the system is stable. If a Vuser then tries to type information to the system, the system shifts into keyboard-locked mode.
Alternatively, if your system never flickers when it returns from the X SYSTEM mode, you can reduce the stable time to less than the default value of one second.


-
Select Vuser > Runtime Settings. The runtime settings dialog box appears.
-
Select the RTE:RTE node.
-
Under X SYSTEM Synchronization, enter a value (in milliseconds) in the Stable time box.
-
Click OK to close the runtime settings dialog box.
For more information on the TE_wait_sync function, see the Function Reference.
You can instruct VuGen to record the time that the system remains in the X SYSTEM mode each time that the X SYSTEM mode is entered. To do so, VuGen inserts a TE_wait_sync_transaction function after each TE_wait_sync function, as shown in the following script segment:
TE_wait_sync(); TE_wait_sync_transaction("syncTrans1");
Each TE_wait_sync_transaction function creates a transaction with the name "default." This allows you to analyze how long the terminal emulator waits for responses from the server during a scenario run. You use the recording options to specify whether VuGen should generate and insert TE_wait_sync_transaction statements.


-
Select Vuser > Recording Options. The Recording Settings dialog box appears.
-
Select the Generate Automatic X SYSTEM transactions option, and then click OK.
