Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Some PF keys not mapping on wc3270 #48

Open
robinmatz opened this issue Sep 15, 2022 · 5 comments
Open

Question: Some PF keys not mapping on wc3270 #48

robinmatz opened this issue Sep 15, 2022 · 5 comments

Comments

@robinmatz
Copy link

robinmatz commented Sep 15, 2022

Hi there!

This is a question coming from MarketSquare/Robot-Framework-Mainframe-3270-Library#69

The project is a wrapper for py3270 for robotframework.

The user was receiving the error message "Function key not allowed" when sending PF(3) to wc3270 when launched from script. However, when launching wc3270 manually, the issue did not occur.

In the analysis, we found out that it is the -xrm wc3270.model:2 parameter that causes the issue.

Can you explain why this is the case?

@pmattes
Copy link
Owner

pmattes commented Sep 15, 2022

The main difference that the model parameter makes is the size of the emulated 3270 screen. wc3270 and s3270 do not use the model number to decide which function keys work, and "Function key not allowed" is not a wc3270/s3270 error message in any case.

My guess is that your application is behaving differently depending on the screen size, and is getting itself into a bad state when it is not running on the screen size it expects.

Capturing some wc3270/s3270 traces in the 'good' and 'bad' cases would probably shed some light on your issue.

@robinmatz
Copy link
Author

I was able to reproduce this behavior on the publicly available pub400.com host.
Here is what I did:

  1. Start wc3270
  2. connect pub400.com
  3. Enter credentials
  4. send PF(4) and PF(3) to get into and exit information
  5. disconnect

I did this with both model 4 (default) and model 2.
With model 4 the PF keys worked as expected, with model 2 they didn't. Please find both trace files attached.
wc3270-model4.txt
wc3270-model2.txt

@pmattes
Copy link
Owner

pmattes commented Sep 16, 2022

Interesting issue!

Here is the big difference: With a model 2, the host accepts that the terminal is a real 3270 and the session uses the 3270 data stream protocol (what is what wc3270 is intended for). With a model 4, the host is apparently unhappy with the protocol negotiation and leaves the session in TELNET NVT mode, where wc3270 is emulating an xterm (ANSI/VT100-like serial terminal).

What the AS/400 host really wants to talk to is an IBM 5250 terminal. The host has a 5250 translation layer for the TELNET session, and it looks like the PF key mappings are different between the 3270-to-5250 translations (used for model 2) and the VT100-to-5250 translations (used for model 4).

For a 3270, the following document applies: https://www.ibm.com/docs/en/i/7.2?topic=sessions-3270-keyboard-mapping-telnet-servers
As you can see in that document, the 3270 PF4 key is actually the 5250 'Print' function, which the trace shows is how it was interpreted. If you want the 5250 F4 key, you need to press PA1, followed by PF4, on wc3270.

For a VT100 terminal, the mappings are direct: PF4 is interpreted as the 5250 F4 key. Of course, that means that the 5250 Print function is not available.

@robinmatz
Copy link
Author

robinmatz commented Sep 17, 2022

Hi Paul,

Thanks for the quick help! Since there is no to do for the x3270 project, I think this issue can be closed.

@FWDQK
Copy link

FWDQK commented Sep 26, 2022

Hi Paul,

Thanks for the quick help! Since there is no to do for the x3270 project, I think this issue can be closed.

wc3270 trace for page down.zip
Hi,
Please find the attached trace for the details where I have tried to execute PF7 directly and with Execute command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants