Technical Notes |
|
Modeling character mode (VT and HP) host applications can be different from modeling 3270 block mode host applications, so the Verastream Host Integrator Design Tool provides configuration options to help you with this process. This technical note contains a collection of tips on how to use these options. Refer to the online help for more details on how to apply the synchronization tips.
This technical note covers the following topics:
To follow along and view a model example of a VT host application while reviewing this document, follow the steps below.
Your host application may be unpredictable when slower execution masks missed synchronization issues. Synchronization in a Host Integrator model ensures that the entire host screen has been received before reading or transmitting data. If you don't develop methods to ensure synchronization, the model can read incorrect values from attributes and fields, write to the wrong locations, or fail to position the cursor at a desired location.
Synchronization is important in operations, when writing attributes, and when using cursor movement commands. Implementing synchronization techniques is critical for any VT or HP character mode model.
Note: Some of the following recommendations rely on improvements to operation handling added in version 6.0. If you are working on a model in version 6.0 or higher that was originally created with an earlier version of Host Integrator, disable the compatibility setting Verastream 5.5 Host Data Processing Compatibility. For more information about compatibility settings, see Technical Note 40023.
In general, using an appropriate Wait command after every transmission is the most reliable technique for ensuring synchronization in your operations. The Wait commands below are listed with the most highly recommended strategies first.
Note: VHI 6.0 implements the following recommendations when generating operations for VT and HP hosts when the "Automatically generate operations" option is selected on the Settings > Preferences > Operation tab.
Because there is nothing in the character mode datastream to denote what constitutes a screen, configuring entity validation is helpful when modeling character mode applications. This validation enables Verastream to delay its entity arrival notification until certain conditions are met.
To access this functionality:
Select one of the following options to configure entity validation:
Option 1: Select the Wait for cursor check box to validate the entity once the cursor arrives at a certain position. Specify the position in the Row and Col boxes.
Option 2: If Option 1 fails, select the Wait for patterns check box and move one or more configured patterns from the Unused list to the Check list. Once a validation pattern is moved to the Check list, Verastream does not validate the entity until this pattern is identified.
Note the following:
Option 3: Select the Wait for condition check box to create a condition in the Condition Edit dialog box. This option often handles situations where the final cursor position may be at any of several locations.
Configuring character mode data entry for attributes and recordset fields is important when Verastream needs to write to more than one attribute or recordset field on a single entity.
Select the "Wait for string to echo at cursor" option to wait for the exact data string to be written back to the terminal screen after data has been sent to the host. This is the most robust option you can use when working with character mode hosts. Note: With character mode applications, the cursor must be wherever characters are being written to the screen. For this reason, use this option to synchronize with the host application.
Other options are "Wait for same number of characters to echo," "Wait for next tabstop," or "Wait for next tabstop or string to echo at cursor." For more details on these options, see the online help.
To globally configure all attribute data to be cached on new entities, select the "Cache all attribute writes" check box on the Entity tab of the Preferences Setup dialog box.
To cache attribute writes on a selected entity, select the entity in the Entity window and select the "Cache all attribute writes" check box on the General tab of Advanced Entity Properties dialog box.
This setting can also be defined as the default for new attributes or recordset fields in the View Settings dialog box. To configure this setting:
If the above steps did not help, then try caching all field writes by selecting the "Cache all field writes" option on the Recordset Fields tab.
Caching all field writes creates a temporary storage area for data assigned to recordset fields. In an operation, field data can be assigned using write commands like DefaultValue and TransmitToField. When Caching all field writes, the field data is temporarily stored until an operation issues an UpdateAttribute or UpdateAttributes command to write the stored data to the terminal screen. Alternatively, an operation can call UpdateAttribute for each field in the desired order, inserting other commands in between as needed to modify cursor positioning, synchronize with the host state, or meet any other requirements to be executed by the operation.
To globally configure all recordset field data to be cached on new recordsets, select the Cache all field writes check box on the Recordset tab of the Preferences Setup dialog box.
To cache all recordset field rights on a selected recordset, select the Cache all field writes check box on the Fields tab of the selected recordset.
You typically need to define cursor movement command lists for VT and HP applications because character mode host applications use cursor positioning to determine when to write data. Cursor movement definitions are especially important when the cursor cannot be moved to a location on the screen with the arrow keys. Without a cursor movement command list, Verastream's default is to use the arrow keys. For example, if the cursor is at (2,2) and the attribute is at (2,10), Verastream sends eight right arrow keys to the host attempting to end up at the correct location. Sometimes, these host applications can be unpredictable and the cursor may not end up in the same position each time that screen is used. If Verastream does not reach the expected location, you will receive the error that the cursor could not be moved.
If the host uses the Tab key to move between fields, define a global move forward cursor movement command list in the Advanced Model Properties dialog box. To access this dialog box, click Model > Properties, and then click Advanced.
Example using the Tab key with a VT host:
TransmitTerminalKey rcVtTabKeyExample using the Return key with an HP host:
TransmitTerminalKey rcHPReturnKeyNote: On HP host applications, the Enter key and the Return key are quite different. On HP host applications, the Enter key refers to the keypad Enter key.
In each case, the command sends the tab key or return key to move the cursor. If the host does more than move the cursor to the next location (for example, it updates a status line or redraws other sections of the screen), then you should be using tabstops. Use the Model Debug Messages Window (in version 6.0 or higher) or the Datastream Window (in version 5.5) to determine if the host is doing more than just moving the cursor.
Once you've defined a move forward command list, Verastream repeatedly executes this command list until it arrives at the starting location for the attribute or attributes you are writing to. If the host never positions the cursor at the attribute, you will receive an error that the cursor could not be moved.
If the host sends more than one packet in response to the tab key, define tabstops on any entity that has multiple attributes. When tabstops have been defined on an entity, Verastream waits for the cursor to arrive at a defined tabstop after each execution of a move forward or move backward command list.
You can define tabstops for an entity on the Cursor tab. Typically, you can click the Generate Next button to generate them automatically. By default, the tabstop order is not significant because Verastream only requires that a given position be defined as a tabstop.
The following suggestions provide some additional solutions to synchronization problems.
If you are using recordsets in your model, use the features available on the Recordset Operations, Recordset Termination Options, and Recordset Options dialog boxes to maximize synchronization between a character mode host application and Verastream. These dialog boxes can be accessed by clicking the Operations, Termination, and Options buttons located on the main Verastream Recordset tab.
To increase the global navigation timeout duration, click Model > Properties. This change may eliminate timeout problems with large recordset or procedure output.
Note: After increasing model timeouts you may also need to increase the client timeout. See Technical Note 10044.
In VHI 6.0, use the Model Debug Messages debug option to review the real-time data sent and received from a host. For more information, see Technical Note 10065.